1. Problem Scenario :
- One shared resource (e.g., a processor).
- Many "jobs" to do (e.g., processes).
Assume: Each job has a:
- weight wj ("priority")
- length lj
Question: In what order should we sequence the jobs?
2. Completion Times : The completion time Cj of job j = Sum of job lengths up to and including j.
3. Goal: Minimize the weighted sum of completion times: min{ Sum(j=1 to n) {wjCj} }
4. Two special case :
a) With equal lengths, schedule larger or smaller-weight jobs earlier? -- larger
b) With equal weights, schedule shorter or longer jobs earlier? -- shorter
5. Idea: Assign "scores" to jobs that are:
a) inscreasing in weight
b) decreasing in length
6. Two guess of the "score" function:
a) wj-lj
b) wj/lj
7. To distinguish among several greedy algorithm : Find example where the several algorithms produce different outputs. Only the one that has the best output can be the optimal algorithm.
a) l1 = 5, w1 = 3 (longer ratio)
b) l1 = 2, w1 = 1 (larger difference)
8. Proof of correctness of Algorithm #2 (use wj/lj as the score) : Fix arbitrary input of n jobs. Let G = greedy schedule, G* = optimal schedule. Will produce schedule even better than G*, contradicting purported optimality of G*.
Assume : All wj/lj is different
Renaming jobs: w1/l1 > w2/l2>...>wn/ln ( so greedy schedule is 1, 2, 3, ...n)
If G* <> G , then there are consecutive jobs i , j with i > j .
Exchange argument: Suppose we exchange order of i&j in G* , then the weighed completion time of other jobs except i,j are not changed. And :
a) i's weighed completion time goes up by wi*lj
b) j's weighed completion time goes down by wj * li
So the sum of weighed completion time of all the jobs goes up by wi*lj - wj*li, while because i > j , then wj/lj > wi/li ==> wj*li > wi*lj , so the total value goes down ==> G* is not optimal.
9. Claim: Algorithm #2 (order jobs in nonincreasing order of ratio wj/lj ) is always correct. (handling tie)
Fix arbitrary input of n jobs. Let G = greedy schedule, let G* = any other schedule. Will show G at least as good as G* ==> Implies that greedy schedule is optimal.
Proof. similar as proof of no ties scenario. Exchange Argument: exchange consecutive jobs i , j in G*, where i > j, if G <> G*, then after exchange, it will be no worse than G* because wi/li <= wj/lj ==> wi*lj <= wj*li ==> the total sum of weighed completion time will not increase. So after exchange the schedule is at least as good as G*. Continue to exchange ( at most C(n,2) such exchanges) until the schule is same as greedy schedule G ==> G is at least as good as any schedule G*
相关推荐
This book is a rich text for introducing diverse aspects of real-time systems including architecture, specification and verification, scheduling and real world applications. It is useful for advanced ...
操作系统scheduling java仿真,包含FCFS,SHORTEST JOB FIRST, ROUND ROBIN method,PRIORITY
• A methodology for simultaneous non-zero clock skew scheduling and design of the topology of the clock distribution network. This methodology is based on the pioneering works of Friedman [1] and ...
Generally, a parallel application consists of precedence constrained stochastic tasks, where task processing times and intertask communication times are random variables following certain probability ...
Flask is a web framework for Python, which ... It shows you how to build a small deployable scheduling application with pointers to the various design decisions you can make when developing with Flask.
Whether you’re designing a new Hadoop application, or planning to integrate Hadoop into your existing data infrastructure, Hadoop Application Architectures will skillfully guide you through the ...
标题“OSDT: A Scalable Application-Level Scheduling Scheme for TCP Incast Problem”中提到的是“OSDT”,这是该论文中提出的一种可扩展的应用层面调度方案。而“TCP Incast Problem”指的是在数据中心网络环境...
We will also refer to a chat and scheduling application developed for the purposes of the book. The entire application is openly available at https://github.com/flauc/angular2-edge-app. Table of ...
One of the most important topics in ... Hybrid scheduling strategy creates tasks in breadth-first order while executes tasks in work-first fashion during application execution. The former is capable of
The books contain step-by-step instructions on how to build a task manager application. The application is designed to highlight functionality that my Enterprise consulting clients commonly require, ...
and system administrators—especially those keen to embrace a DevOps approach—Using Docker will take you from Docker and container basics to running dozens of containers on a multi-host system with ...
A free, open source, cross-platform content backup, content compression, remote sending task scheduling application integration framework and engine based on Java. 中文 EasyBackup 是一个基于 Java 的...
Is it a wake up scheduling latency or a latency caused by interrupts being disabled, or is it a latency caused by preemption being disabled, or a combination of disabled interrupts and preemption....
Docker admins, Docker application developers, and container as a service (CAAS) developers. Some prerequisite knowledge of Linux and Docker is required. Apress Pro Docker is recommended as a companion...