Ecole Polytechnique, Nov 7, 2007 1 Minimizing Total Completion Time Each job specified by  procesing time (length p j )  release time r j Goal: compute.

Slides:



Advertisements
Similar presentations
Minimizing Average Flow-Time Naveen Garg IIT Delhi Joint work with Amit Kumar, Jivi Chadha,V Muralidhara, S. Anand.
Advertisements

1 EE5900 Advanced Embedded System For Smart Infrastructure Static Scheduling.
Greedy Algorithms Be greedy! always make the choice that looks best at the moment. Local optimization. Not always yielding a globally optimal solution.
Online Scheduling with Known Arrival Times Nicholas G Hall (Ohio State University) Marc E Posner (Ohio State University) Chris N Potts (University of Southampton)
Greedy Algorithms Basic idea Connection to dynamic programming
Greedy Algorithms Basic idea Connection to dynamic programming Proof Techniques.
Operating System Concepts with Java – 7 th Edition, Nov 15, 2006 Silberschatz, Galvin and Gagne ©2007 Processes and Their Scheduling.
Complexity 16-1 Complexity Andrei Bulatov Non-Approximability.
Computability and Complexity 23-1 Computability and Complexity Andrei Bulatov Search and Optimization.
Complexity 15-1 Complexity Andrei Bulatov Hierarchy Theorem.
1 IOE/MFG 543 Chapter 3: Single machine models (Sections 3.1 and 3.2)
Completion Time Scheduling Notes from Hall, Schulz, Shmoys and Wein, Mathematics of Operations Research, Vol 22, , 1997.
1 Single Machine Deterministic Models Jobs: J 1, J 2,..., J n Assumptions: The machine is always available throughout the scheduling period. The machine.
1 Ecole Polytechnque, Nov 7, 2007 Scheduling Unit Jobs to Maximize Throughput Jobs:  all have processing time (length) = 1  release time r j  deadline.
Rounding Technique We can simplify scheduling problem structure by rounding job sizes, release dates.
Resource augmentation and on-line scheduling on multiprocessors Phillips, Stein, Torng, and Wein. Optimal time-critical scheduling via resource augmentation.
1 Set # 3 Dr. LEE Heung Wing Joseph Phone: Office : HJ639.
6/25/2015Page 1 Process Scheduling B.Ramamurthy. 6/25/2015Page 2 Introduction An important aspect of multiprogramming is scheduling. The resources that.
CSE 421 Algorithms Richard Anderson Lecture 6 Greedy Algorithms.
Ecole Polytechnique, Nov 7, Online Job Scheduling Marek Chrobak University of California, Riverside.
Ecole Polytechnique, Nov 11, List Scheduling on Related Machines processors Related machines: machines may have different speeds  0.25 
A. Frank - P. Weisberg Operating Systems CPU Scheduling.
7/12/2015Page 1 Process Scheduling B.Ramamurthy. 7/12/2015Page 2 Introduction An important aspect of multiprogramming is scheduling. The resources that.
Hardness Results for Problems P: Class of “easy to solve” problems Absolute hardness results Relative hardness results –Reduction technique.
Modified from Silberschatz, Galvin and Gagne ©2009 Lecture 8 Chapter 5: CPU Scheduling.
Hardness Results for Problems
Minimizing Flow Time on Multiple Machines Nikhil Bansal IBM Research, T.J. Watson.
Paging for Multi-Core Shared Caches Alejandro López-Ortiz, Alejandro Salinger ITCS, January 8 th, 2012.
Called as the Interval Scheduling Problem. A simpler version of a class of scheduling problems. – Can add weights. – Can add multiple resources – Can ask.
CPU-Scheduling Whenever the CPU becomes idle, the operating system must select one of the processes in the ready queue to be executed. The short term scheduler.
Approximation schemes Bin packing problem. Bin Packing problem Given n items with sizes a 1,…,a n  (0,1]. Find a packing in unit-sized bins that minimizes.
Scheduling policies for real- time embedded systems.
Chapter 5 CPU Scheduling Bernard Chen Spring 2007.
Recursive Algorithms &
Graph Colouring L09: Oct 10. This Lecture Graph coloring is another important problem in graph theory. It also has many applications, including the famous.
Outline Introduction Minimizing the makespan Minimizing total flowtime
Approximation Algorithms Department of Mathematics and Computer Science Drexel University.
© The McGraw-Hill Companies, Inc., Chapter 12 On-Line Algorithms.
CS623: Introduction to Computing with Neural Nets (lecture-12) Pushpak Bhattacharyya Computer Science and Engineering Department IIT Bombay.
Process CPUArrival Time P P2 3 0 P3 3 0 The Gantt Chart for the schedule is: Waiting time for P1 = (7-7)=0; P2 = (0-0)=0; P3 = (3-0)
11 -1 Chapter 12 On-Line Algorithms On-Line Algorithms On-line algorithms are used to solve on-line problems. The disk scheduling problem The requests.
1 Distributed Vertex Coloring. 2 Vertex Coloring: each vertex is assigned a color.
The NP class. NP-completeness Lecture2. The NP-class The NP class is a class that contains all the problems that can be decided by a Non-Deterministic.
Chapter 4 CPU Scheduling. 2 Basic Concepts Scheduling Criteria Scheduling Algorithms Multiple-Processor Scheduling Real-Time Scheduling Algorithm Evaluation.
6/12/2016 Prepared by Dr.Saad Alabbad1 CS100 : Discrete Structures Proof Techniques(2) Mathematical Induction & Recursion Dr.Saad Alabbad Department of.
Chapter 5: CPU Scheduling. 5.2 Silberschatz, Galvin and Gagne ©2005 Operating System Concepts Chapter 5: CPU Scheduling Basic Concepts Scheduling Criteria.
Single Machine Scheduling Problem Lesson 5. Maximum Lateness and Related Criteria Problem 1|r j |L max is NP-hard.
Linear program Separation Oracle. Rounding We consider a single-machine scheduling problem, and see another way of rounding fractional solutions to integer.
Greedy Algorithms Many of the slides are from Prof. Plaisted’s resources at University of North Carolina at Chapel Hill.
The NP class. NP-completeness
Scheduling (Priority Based)
CPU Scheduling.
Computability and Complexity
James B. Orlin Presented by Tal Kaminker
CPU Scheduling G.Anuradha
CS 154, Lecture 4: Limitations on DFAs (I),
Lecture 11 Overview Self-Reducibility.
Lecture 11 Overview Self-Reducibility.
Greedy Algorithms: Homework Scheduling and Optimal Caching
Polynomial time approximation scheme
Richard Anderson Lecture 6 Greedy Algorithms
CS21 Decidability and Tractability
Richard Anderson Lecture 7 Greedy Algorithms
Lecture 14 Shortest Path (cont’d) Minimum Spanning Tree
CPU SCHEDULING CPU SCHEDULING.
Single Machine Deterministic Models
Richard Anderson Autumn 2015 Lecture 7
Lecture 13 Shortest Path (cont’d) Minimum Spanning Tree
CPU Scheduling.
Chapter 5: CPU Scheduling
Presentation transcript:

Ecole Polytechnique, Nov 7, Minimizing Total Completion Time Each job specified by  procesing time (length p j )  release time r j Goal: compute a schedule (preemptive or not) that maximizes the total completion time all integer C j = completion time of j in a given schedule In Graham’s notation:  Non preemptive version: 1|r j,p j |∑C j  Preemptive version: 1|r j,p j,pmtn|∑C j

Ecole Polytechnique, Nov 7, Preemptive Scheduling Example: Schedule A ∑C j = = 51 Schedule B ∑C j = = 38

Ecole Polytechnique, Nov 7, Online version: jobs are revealed at their release time algorithm must execute a job without knowing future jobs Note: different from list scheduling! (Decision time = processing time) Algorithm SRPT: At each step schedule the job with the shortest remaining processing time Theorem: Algorithm SRPT computes an optimal solution (that is, SRPT is 1-competitive) Example: Schedule B on previous slide is SRPT

Ecole Polytechnique, Nov 7, Proof: Exchange agument. Convert any schedule S into one satisfying the SRPT rule. Take any jobs i and j in S. W.l.o.g. assume r i ≤ r j. Let T = set of time slots occupied by i and j starting at r j ijijjjjiiiiiijj rjrj riri at r j : b units of j and a≤b units of i unit a+b in T ijijjjjiiiiiijj rjrj riri Reschedule i and j within T using SRPT: unit ≥ a in T unit a+b in T unit a in T So ∑C j cannot increase !!!

Ecole Polytechnique, Nov 7, So we know: that one SPRT-reschedule does not increase ∑C j let k = minimum length job with r k = 0 SRPT will schedule one unit of k at time 0 start with any schedule Q repeat: apply SRPT-reschedule to all pairs i,j until Q does not change phase after phase 1, one unit of k will be scheduled at time 0 in Q and will remain there So Q and SRPT are the same at time unit 0 after phase 1 We can modify the instance: change p k = p k -1 change all release times r j =0 to r j =1 and apply the argument recursively to the new instance Thus we convert Q into SRPT without increasing ∑C j So ∑C j (SRPT) ≤ ∑C j (Q)

Ecole Polytechnique, Nov 7, Non-Preemptive Scheduling Example: Schedule A ∑C j = = 51 Schedule C ∑C j = = 39 Schedule B ∑C j = = 42

Ecole Polytechnique, Nov 7, Algorithm SPT: at each step, when no job is running, execute the job with shortest processing time Question: Is SPT’s schedule optimal? Intuition: If a big job is pending, an optimal schedule sometimes needs to wait to execute more small jobs that are about to arrive Question: Is SPT competitive? No: Schedule B on previous slide is SPT

Ecole Polytechnique, Nov 7, Question: Is SPT competitive? r 1 =0 p 1 =p n jobs with r i =1 and p i =1 ∑C j ≥ np ∑C j ≤ n(n+1) + (n+1+p) ≤ 2n(n+1)+p SPT: 0 Q: 1 So for p = 2n(n+1) ratio SPT/Q ≥ n·2n(n+1) / 4n(n+1) = n/2 

Ecole Polytechnique, Nov 7, Theorem: No online algorithm has competitive ratio < 2 r 1 =0 p 1 =p ∑C j (A) ≥ n(2p-1) = 2pn+  (n) So for p = n 2 ratio A/Q ≥ 2 - O(1/n)  2 Proof: A = online algorithm. At time 0 release job 1: If A schedules 1 at time t ≥ p-2 then ratio ≥ (2p-2)/p = 2-2/p  2 Else, release n jobs at time p-1 of length 1 Consider Q: ∑C j (Q) ≤ n(p-1+n)+(2p+n) = pn+  (n+p) In A:

Ecole Polytechnique, Nov 7, Intuition: To be competitive, an algorithm needs to wait even if jobs are available Algorithm SSPT: When job j arrives, reset its release time to r’ j = r j +p j Apply SPT with respect to these new release times Theorem: SSPT is 2-competitive. Proof idea: I = input instance. Define an SSPT-induced instance I” such that: optimum(I”) ≤ 2 · optimum(I) SSPT’s schedule for I = SRPT schedule for I” So ∑C j (SPT on I) = ∑C j (SRPT on I”) = optimum(I”) ≤ 2 · optimum(I)

Ecole Polytechnique, Nov 7, Claim 1: optimum(I”) ≤ 2 · optimum(I) Proof: Q = optimal schedule for I. Consider schedule Z for I” where S j (Z) = 2S j (Q)+p j Then Z is feasible for I” because jobs in Z do not overlap and S j (Z) = 2S j (Q)+p j ≥ 2r j + p j ≥ r” j ∑C j (Z) = 2∑C j (Q) because C j (Z) = S j (Z)+p j = 2 S j (Q)+p j +p j = 2[S j (Q)+p j ] = 2Cj(Q) Let T = schedule of SSPT on I Define I” by changing release times to r” j = min { S j (T), 2r j +p j }

Ecole Polytechnique, Nov 7, Claim 2: T is also an SRPT schedule for I” Proof: Suppose T executes k and h is pending Recall: T = schedule of SSPT on I I” obtained by changing r j to r” j = min{S j (T),2r j +p j } We need (SRPT of k) ≤ p h at any time t ≥ r” h. It’s enough to show it for t=S h (T) or t= 2r h +p h (since T runs k) T runs h after k so S h (T) ≥ C k (T)  we are OK for t = S h (T) At t=2r h +p h we need p h ≥ C k (T)-(2r h +p h ) This is equivalent to 2(r h +p h ) ≥ S k (T)+p k Case 1: h pending at S k (T). Since T chose k, we have p h ≥ p k and k only gets shorter so T obeys the SRPT rule for k and h h k Case 2: h was released after S k (T). h r’ h = r h +p h kh h kh 2r h +p h True, because 2(r h +p h ) ≥ 2S k (T) ≥ S k (T)+r’ k ≥ S k (T)+p k