1 Ecole Polytechnque, Nov 7, 2007 Scheduling Unit Jobs to Maximize Throughput Jobs:  all have processing time (length) = 1  release time r j  deadline.

Slides:



Advertisements
Similar presentations
Minimum Clique Partition Problem with Constrained Weight for Interval Graphs Jianping Li Department of Mathematics Yunnan University Jointed by M.X. Chen.
Advertisements

Incremental Linear Programming Linear programming involves finding a solution to the constraints, one that maximizes the given linear function of variables.
C&O 355 Lecture 23 N. Harvey TexPoint fonts used in EMF. Read the TexPoint manual before you delete this box.: A A A A A A A A A A.
Greedy Algorithms Greed is good. (Some of the time)
Approximation, Chance and Networks Lecture Notes BISS 2005, Bertinoro March Alessandro Panconesi University La Sapienza of Rome.
Online Scheduling with Known Arrival Times Nicholas G Hall (Ohio State University) Marc E Posner (Ohio State University) Chris N Potts (University of Southampton)
An Optimal Lower Bound for Buffer Management in Multi-Queue Switches Marcin Bieńkowski.
Greedy Algorithms Basic idea Connection to dynamic programming Proof Techniques.
Basic Feasible Solutions: Recap MS&E 211. WILL FOLLOW A CELEBRATED INTELLECTUAL TEACHING TRADITION.
1 Maximum Flow w s v u t z 3/33/3 1/91/9 1/11/1 3/33/3 4/74/7 4/64/6 3/53/5 1/11/1 3/53/5 2/22/2 
4/5/05Tucker, Sec Applied Combinatorics, 4rth Ed. Alan Tucker Section 4.3 Graph Models Prepared by Jo Ellis-Monaghan.
Complexity 16-1 Complexity Andrei Bulatov Non-Approximability.
Ecole Polytechnique, Nov 7, Minimizing Total Completion Time Each job specified by  procesing time (length p j )  release time r j Goal: compute.
An Improved Approximation Algorithm for Combinatorial Auctions with Submodular Bidders.
An Improved Approximation Algorithm for Combinatorial Auctions with Submodular Bidders Speaker: Shahar Dobzinski Joint work with Michael Schapira.
Approximation Algorithms
Online Algorithms Motivation and Definitions Paging Problem Competitive Analysis Online Load Balancing.
Lecture 11. Matching A set of edges which do not share a vertex is a matching. Application: Wireless Networks may consist of nodes with single radios,
CSE 421 Algorithms Richard Anderson Lecture 6 Greedy Algorithms.
The k-server Problem Study Group: Randomized Algorithm Presented by Ray Lam August 16, 2003.
Packet Scheduling with Bounded Buffers A router can send one packet at a time Arriving packets must be queued in a finite buffer B (though we often ignore.
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 
Competitive Analysis of Incentive Compatible On-Line Auctions Ron Lavi and Noam Nisan SISL/IST, Cal-Tech Hebrew University.
Approximation Algorithms Motivation and Definitions TSP Vertex Cover Scheduling.
Online Packet Switching Techniques and algorithms Yossi Azar Tel Aviv University.
C&O 355 Mathematical Programming Fall 2010 Lecture 17 N. Harvey TexPoint fonts used in EMF. Read the TexPoint manual before you delete this box.: AA A.
Called as the Interval Scheduling Problem. A simpler version of a class of scheduling problems. – Can add weights. – Can add multiple resources – Can ask.
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.
Copyright © The McGraw-Hill Companies, Inc. Permission required for reproduction or display. Sets.
1 Pruhs, Woeginger, Uthaisombut 2004  Qos Objective: Minimize total flow time  Flow time f i of a job i is completion time C i – r i  Power Objective:
Edge-disjoint induced subgraphs with given minimum degree Raphael Yuster 2012.
1 Online algorithms Typically when we solve problems and design algorithms we assume that we know all the data a priori. However in many practical situations.
Princeton University COS 423 Theory of Algorithms Spring 2001 Kevin Wayne Approximation Algorithms These lecture slides are adapted from CLRS.
Competitive Queue Policies for Differentiated Services Seminar in Packet Networks1 Competitive Queue Policies for Differentiated Services William.
Approximation Schemes Open Shop Problem. O||C max and Om||C max {J 1,..., J n } is set of jobs. {M 1,..., M m } is set of machines. J i : {O i1,..., O.
Linear Program Set Cover. Given a universe U of n elements, a collection of subsets of U, S = {S 1,…, S k }, and a cost function c: S → Q +. Find a minimum.
CS425: Algorithms for Web Scale Data Most of the slides are from the Mining of Massive Datasets book. These slides have been modified for CS425. The original.
© The McGraw-Hill Companies, Inc., Chapter 12 On-Line Algorithms.
1 Covering Non-uniform Hypergraphs Endre Boros Yair Caro Zoltán Füredi Raphael Yuster.
Buffering problems Moran Feldman Technion Based on joint work with Seffi Naor.
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.
C&O 355 Lecture 19 N. Harvey TexPoint fonts used in EMF. Read the TexPoint manual before you delete this box.: A A A A A A A A A A.
Approximation Algorithms based on linear programming.
Unconstrained Submodular Maximization Moran Feldman The Open University of Israel Based On Maximizing Non-monotone Submodular Functions. Uriel Feige, Vahab.
CHAPTER SIX T HE P ROBABILISTIC M ETHOD M1 Zhang Cong 2011/Nov/28.
1 Section 5.1 Analyzing Algorithms Let P be a problem and A an algorithm to solve P. The running time of A can be analyzed by counting the number of certain.
Linear program Separation Oracle. Rounding We consider a single-machine scheduling problem, and see another way of rounding fractional solutions to integer.
Dynamic Graph Partitioning Algorithm
Maximum Matching in the Online Batch-Arrival Model
Lectures on Network Flows
Exercise Exercise Proof that
Chapter 5. Optimal Matchings
Greedy Algorithms / Interval Scheduling Yin Tat Lee
Direct Proof and Counterexample V: Floor and Ceiling
Greedy Algorithms / Caching Problem Yin Tat Lee
Instructor: Shengyu Zhang
3.5 Minimum Cuts in Undirected Graphs
Lecture 11 Overview Self-Reducibility.
Lecture 11 Overview Self-Reducibility.
Richard Anderson Lecture 6 Greedy Algorithms
Richard Anderson Autumn 2016 Lecture 7
Richard Anderson Lecture 7 Greedy Algorithms
Richard Anderson Winter 2019 Lecture 7
Richard Anderson Autumn 2015 Lecture 7
List Scheduling Given a list of jobs (each with a specified processing time), assign them to processors to minimize makespan (max load) In Graham’s notation:
Integer and fractional packing of graph families
Chapter 2. Simplex method
An Optimal Lower Bound for Buffer Management in Multi-Queue Switches
Richard Anderson Autumn 2019 Lecture 7
Presentation transcript:

1 Ecole Polytechnque, Nov 7, 2007 Scheduling Unit Jobs to Maximize Throughput Jobs:  all have processing time (length) = 1  release time r j  deadline d j  weight w i Goal: compute a schedule that maximizes the total weight of completed jobs (that meet their deadlines) In Graham’s notation 1|r j,p j =1|∑w j U j all integer

2 Ecole Polytechnque, Nov 7, 2007 Example: jobs time slots

3 Ecole Polytechnque, Nov 7, 2007 Example: Schedule with weight = = 51 Can we do better?

4 Ecole Polytechnque, Nov 7, 2007 Example: Schedule with weight = = Can we do even better?

5 Ecole Polytechnque, Nov 7, 2007 Motivation: Packet Scheduling in QoS Networks drop transmit Buffer manager buffer 2, 1 4, 3 5, 4 weight incoming packets ? 5, 1 deadline

6 Ecole Polytechnque, Nov 7, 2007 Offline algorithm: Maximum weight matching in bipartite graphs jobstime slots n j Construct graph G: Compute max-weight matching in G Matched vertices on left= scheduled jobs Matched vertices on right = schedule times

7 Ecole Polytechnque, Nov 7, 2007 Offline algorithm: Maximum weight matching in bipartite graphs Construct graph G: Compute max-weight matching in G Matched vertices on left= scheduled jobs Matched vertices on right = schedule times jobstime slots n j 0 1 2

8 Ecole Polytechnque, Nov 7, 2007 Online version Jobs arrive at release times Online algorithm decides which jobs to schedule without the knowledge of the jobs released in the future Algorithm A is R-competitive if for each instance weight of the optimum schedule  R · weight of A’s schedule for randomized algorithms, expected # jobs This is time-online, not list-online. Different model than list scheduling !

9 Ecole Polytechnque, Nov 7, 2007 Algorithm ED: At each step schedule the earliest-deadline available job. Corollary: For any weights, if X is a feasible set of jobs then we can schedule the jobs in X according to the earliest-deadline policy. In particular, we can assume: in an optimal schedule, if at some time t, jobs i and j are pending, d i < d j and j is executed at time t then i will not be executed in the future (the ED property) Does not work in general, but …. Exercise: Prove that if all weights are equal (we maximize the number of completed jobs), then ED computes the optimum solution. Hint: An exchange argument: take any schedule and convert it into an ED schedule, step by step, without decreasing the number of completed jobs.

10 Ecole Polytechnque, Nov 7, 2007 Dilemma: execute an urgent light job or heavy but not urgent job? u > u > 1 execute 2 R = (u+1)/u execute u > 1 u u > 1 u R = 2u/(u+1) So the worst-case ratio is R = min{ (u+1)/u, 2u/(u+1) } To prove a lower bound, maximize R, equalize: (u+1)/u = 2u/(u+1) we get u = 1 + sqrt(2) So R = sqrt(2)  1.41

11 Ecole Polytechnque, Nov 7, 2007 Theorem: No online algorithm for unit job scheduling has competitive ratio better than sqrt(2)  We just proved: Theorem: No online algorithm for unit job scheduling has competitive ratio better than    = golden ratio = solution of x 2 = x+1. Proof: not easy. Can we do better?

12 Ecole Polytechnque, Nov 7, 2007 Greedy: At each step schedule a job with maximum value. 1 u 2 u+1 Exercise: Show that the competitive ratio of Greedy is ≥ R = (2u+1)/u  2

13 Ecole Polytechnque, Nov 7, 2007 Theorem: Greedy is 2-competitive Proof: “Charge” jobs in optimal schedule to Greedy’s schedule G such that each job j in G receives charge at most 2w j Total charge  2 times the weight of G  optimal weight  2 weight of G  Greedy is 2-competitive Charging scheme: let j be a job executed at time t Rule 1: if j executed before time t in G, charge w j to j j G opt t j j G t Rule 2: Otherwise, charge w j to the job executed at time t in G There must be a job here, since j is pending at t

14 Ecole Polytechnque, Nov 7, 2007 Claim: each job k in G gets a charge  2w k. k gets at most 2 charges (one for each rule) k G opt k j Charge from Rule 1 is = w k Charge from Rule 2 is  w k because j is pending and Greedy executes the heaviest pending job, so w j  w k the charge to k is  2w k Greedy is 2-competitive

15 Ecole Polytechnque, Nov 7, 2007 Different proof: Define potential funtion  : {configurations}  {non-negative reals} such that initially  = 0 and in each move 2·(Greedy’s gain)  (opt gain) +  potential change in this move This is sufficient by amortization: In step 1 2·(Greedy’s gain)  (opt gain) +  1  In step 2 2·(Greedy’s gain)  (opt gain) +  2  In step 3 2·(Greedy’s gain)  (opt gain) +  3  …. …. In step n 2·(Greedy’s gain)  (opt gain) +  n  potential change in move 1, etc In total 2·(total Greedy’s gain)  (total opt gain) +  final -  initial  (total opt gain)

16 Ecole Polytechnque, Nov 7, 2007 At a given time, let G = set of jobs pending by Greedy Q = set of jobs pending in the optimum schedule  = w(Q-G) Let j = job executed by opt k = job executed by Greedy (if Greedy does not have a pending job, assume w k = 0) Recall that we need (*) 2·(Greedy’s gain)  (opt gain) +  If j  Q-G then  ≤ -w j + w k and (*) holds because 2· w k  w j + (-w j + w k )  w j +  Else, j  Q  G, so j is pending for Greedy, so w k  w j and  ≤ w k and (*) holds because 2· w k  w j + w k  w j + 

17 Ecole Polytechnque, Nov 7, 2007 The 2-Bounded Case: for each j, d j ≤ r j +2. (A job released at time t expires at time t+1 or t+2) Algorithm Balance: At each time t, e = heaviest job with d j = t+1 h = heaviest job with d j = t+2 If w h ≥  ·w e, execute h else, execute e Theorem: Algorithm Balance is  -competitive.

18 Ecole Polytechnque, Nov 7, 2007 Proof: “Charge” jobs in optimal schedule to Balance’s schedule B such that each job j in G receives charge at most  w j Total charge   times the weight of G  optimal weight   weight of G  Balance is  -competitive Charging scheme: let j be a job executed at time t Rule 1: if j executed at time t or t-1 in G, charge w j to j j B opt t j j B t Rule 2: Otherwise, charge w j to the job executed at time t in G

19 Ecole Polytechnque, Nov 7, 2007 Claim: each job k in G gets a charge   w k. k gets at most 2 charges (one for each rule) k B opt k Charge from Rule 1 is = w k Charge from Rule 2 is   w k since j is pending and Balance would not execute k if there is another pending job j with w j >  w k j B opt k If there are both charges, then d k = t+2 so w k ≥  w j and the charge is d k +d j  d k + w k /  = (1+1/  )w k =  w k because 1+1/  =  j B opt k k

20 Ecole Polytechnque, Nov 7, 2007 Improving ratio using randomization? Idea: Choose a job to execute at random, using appropriate probabilities u > 1 Prob = p u Prob = 1-p u Intuition: p should be roughly u/(u+1) Suppose the instance is either {1,2} or {1,2,3} with r 3 =1 w 3 =u u {1,2} u u 3 {1,2,3} u {1,2} {1,2,3} u u 3

21 Ecole Polytechnque, Nov 7, 2007 Randomized competitive algorithms Algorithm can make random choices at each step Algorithm A is R-competitive if for each instance weight of optimum schedule  R · Exp[weight of A’s schedule] Expected value, with respect to A’s random choices

22 Ecole Polytechnque, Nov 7, 2007 Exercise: What is the competitive ratio for u=2 and p=1/3? Hint: compute the ratio for both instances and take the maximum Exercise 2: is 1/3 optimal (for these two instances)? Exercise 3: for any u, what is the optimal probability? u > 1 Prob = p u Prob = 1-p u u {1,2} u u 3 {1,2,3} u {1,2} {1,2,3} u u 3

23 Ecole Polytechnque, Nov 7, Competitive Randomized Algorithm h 1 - heaviest pending job h i+1 - heaviest pending job j with w j > w(h i ) and d j < d(h i ) Schedule h i with probability  i h1h1 h2h2 h3h3 hkhk... weight w(h 1 ) deadlines Algorithm RMix. At a give time step, consider only significant jobs (with no heavier jobs in front of them) and  i will be determined later to optimize the ratio

24 Ecole Polytechnque, Nov 7, 2007 Analysis: RM - set of pending jobs for RMix OPT - pending jobs in the optimal schedule (wlog optimal schedule is ED) t A B AB Define potential OPT RM Total weight of jobs pending in optimal schedule but not in Rmix’s schedule

25 Ecole Polytechnque, Nov 7, 2007 Job arrivals and expirations do not increase the potential OPT RM Denote v i = w(h i ) and v k+1 = w(h 1 ) The expected gain is Suppose the optimal schedule executes j. It is then enough to prove that

26 Ecole Polytechnque, Nov 7, 2007 soso Case 1: j  OPT - RM OPT RM j h(i) With probability  i Recall: j = job executed by opt

27 Ecole Polytechnque, Nov 7, 2007 Case 2: j  AD  RM Then w j  v 1 as j  X Let 1  p  k+1 be the largest index s.t. w j  v p h1h1 h2h2 h3h3 hkhk... weight w(h 1 ) deadlines The expected potential change is It remains to find R for which

28 Ecole Polytechnque, Nov 7, 2007 ? ? Denote v = v P We can assume v 1 = 1 (rescale all weights) Choose  (x),, so that left hand side is independent of v (solve differential equation). This yields: Theorem: Algorithm Rmix is e/(e-1)-competitive. e/(e-1) ≈ 1.58