1 / 33

Minimizing Weighted Flow Time

Minimizing Weighted Flow Time. Nikhil Bansal (CMU) Kedar Dhamdhere (CMU). Scheduling. What the heck is flowtime 1|r_j | pmtn | W_j F_j. Single Machine (with preemptions) Jobs arrive at different times Different sizes (service requirements). Keep users happy, some measure.

declan
Télécharger la présentation

Minimizing Weighted Flow Time

An Image/Link below is provided (as is) to download presentation Download Policy: Content on the Website is provided to you AS IS for your information and personal use and may not be sold / licensed / shared on other websites without getting consent from its author. Content is provided to you AS IS for your information and personal use only. Download presentation by click this link. While downloading, if for some reason you are not able to download a presentation, the publisher may have deleted the file from their server. During download, if you can't get a presentation, the file might be deleted by the publisher.

E N D

Presentation Transcript


  1. Minimizing Weighted Flow Time Nikhil Bansal (CMU) Kedar Dhamdhere (CMU)

  2. Scheduling What the heck is flowtime 1|r_j | pmtn | W_j F_j • Single Machine (with preemptions) • Jobs arrive at different times • Different sizes (service requirements) Keep users happy, some measure Nikhil Bansal

  3. Scheduling (contd) t=0 Flow Time of Job 1 Flow Time = Completion Time – Release Time = Time spent in system Measure: Total Weighted Flow Time ( 1| rj, pmtn | wj Fj) Competitive Ratio = Max. [Online Cost / Opt. Offline Cost] Nikhil Bansal

  4. Results Unweighted: Optimal’ 56 , SRPT (Shortest Rem. Proc. Time) P = max. size / min. size W= max. wt / min. wt Nikhil Bansal

  5. Results (Resource Augmentation) s-speed c-competitive algorithm [Kalyanasundaram, Pruhs’ 95] Onlines(I) · c . Opt Offline1(I) Nikhil Bansal

  6. An alternate view Weighted Flow Time of a job = wj£ (Time in system) think of contributing “wj” at each time step Total Wt. Flow Time W(t) = t Total weight(t) Local c-Competitive: If W(t) · c Wopt(t) for all t Clearly sufficient to guarantee c-competitive Also Necessary!! Need to keep total weight close to Opt at all times Nikhil Bansal

  7. A Balancing Act Also need to take care of BIG weights Need to keep total weight close to Opt at all times Density = Weight/ Remaining Service Greedy could be very BAD (W = 99, Size = 100) W=1, Size =1 What happens at time 100 ? Nikhil Bansal

  8. The Algorithm 1. Let the weights be w1 < w2 < … < wk 2. Put same weight jobs in a bucket. Work on the bucket with highest total weight (breaking ties in favor of the larger index). 3. Do SRPT within each bucket. W2=4 W1=1 Nikhil Bansal

  9. The Algorithm 1. Let the weights be w1 < w2 < … < wk 2. Put same weight jobs in a bucket. Work on the bucket with highest total weight (breaking ties in favor of the larger index). 3. Do SRPT within each bucket. W2=4 W1=1 Nikhil Bansal

  10. The Algorithm 1. Let the weights be w1 < w2 < … < wk 2. Put same weight jobs in a bucket. Work on the bucket with highest total weight (breaking ties in favor of the larger index). 3. Do SRPT within each bucket. W2=4 W1=1 Nikhil Bansal

  11. The Algorithm 1. Let the weights be w1 < w2 < … < wk 2. Put same weight jobs in a bucket. Work on the bucket with highest total weight (breaking ties in favor of the larger index). 3. Do SRPT within each bucket. W2=4 W1=1 Nikhil Bansal

  12. Analysis Idea Maintain an Invariant: Show does not change with time Simpler Problem: Optimality of SRPT (Shortest remaining processing time) wrt # of jobs: At all times SRPT has min # of jobs[Schrage’ 68] Nikhil Bansal

  13. Proof SRPT Other SRPT(2) Other(2) Let A(l)= Jobs in the first l levels under A Let |A(l)| = Total work contained in jobs 2 A(l) Invariant:|Srpt(l)| ¸ |Other(l)| , for all l = 1,2,3,… If true, it follows NSRPT (t) · NOther(t) Nikhil Bansal

  14. Proof (No arrival Case) SRPT Other SRPT always works on last job Nikhil Bansal

  15. Proof (No arrival Case) SRPT Other |Srpt(l)| decreases! Key Property: |Srpt(l)| decreases iff |Srpt(l)| = total work Nikhil Bansal

  16. Proof (Arrivals) SRPT Other Nikhil Bansal

  17. Proof (Arrivals, Case 1) SRPT Other Nikhil Bansal

  18. Proof (Arrivals) SRPT Other New |SRPT(5)| = Old |SRPT(4) | + |new arrival| New |Other(5)| = Old |Other(4) | + |new arrival| Nikhil Bansal

  19. Proof (Arrivals) SRPT Other Easy: SRPT’s prefix only increases Nikhil Bansal

  20. Our Algorithm • Let the weights be w1 < w2 < … < wk • Work on bucket with highest total weight (break ties in favor of the larger weight index) • Do SRPT within each bucket W2=4 W1=1 Nikhil Bansal

  21. Proof Idea Let (j,l) denote lth job with weight wj B(j,l) = (j,l) [ {jobs which cannot be executed before (j,l) } 1) Key Property : |B(j,l)| decreases iff |B(j,l)| = total work 2) Weight(B(j,l)) · k . l . Wj W2=4 W1=1 (2,1) (2,2) (1,2) (1,5) B(1,5) Nikhil Bansal

  22. Proof Idea P(j,l): Any packing of jobs with total weight · l £ wj Invariant: For every (j,l) packing, |B(j,l)| ¸ |P(j,l)| W2=4 W1=1 Opt un P(1,5) B(1,5) Nikhil Bansal

  23. Proof Idea P(j,l): Any packing of jobs with total weight · l £ wj Invariant: For every (j,l) packing, |B(j,l)| ¸ |P(j,l)| W2=4 W1=1 Opt P(1,5) un B(1,5) Could have holes Nikhil Bansal

  24. Invariant => Result Consider all jobs in Opt at time t. Total wt = W and min. wt = wj Let l = W/wj , and consider B(j,l) By Invariant, |B(j,l)| ¸ |P(j,l)| = total work in system B(j,l) = All the jobs Weight(B(j,l)) · k wj l = k Weight(Opt) Thus, K competitive Nikhil Bansal

  25. Proof Idea P(j,l): Any packing of jobs with total weight · l £ wj Invariant: For every (j,l) packing, |B(j,l)| ¸ |P(j,l)| Key Property: |B(j,l)| decreases iff |B(j,l)| = total work W2=4 W1=1 Opt P(1,5) un B(1,5) Nikhil Bansal

  26. Proving the Invariant (Arrival) W1=1 W2=4 More capacity here More elaborate argument: Presence of holes Want to show: B(1,5) >= P(1,5) on arrival Nikhil Bansal

  27. Proving the Invariant W1=1 W2=4 On arrival of red job P(1,5) increases, but B(1,5) does not Need to use that in fact B(1,4) > P(1,4) A couple more cases! Nikhil Bansal

  28. Open Problems • O(1) competitive for weighted flow time ? • O(1) approx ? • QPTAS, (nO(log W¢log P/^3)) time [Chekuri,Khanna] • 3) Non-clairvoyant case, better than 1+1/ • competitive for 1+ speed up ? Nikhil Bansal

  29. Thank You! Nikhil Bansal

  30. Proof Idea P(j,l): Any packing of jobs with total weight · l £ wj Invariant: For every (j,l) packing, |B(j,l)| ¸ |P(j,l)| W2=4 W1=1 Opt un P(1,5) B(1,5) Nikhil Bansal

  31. Proof (Arrivals, Case 2) SRPT Other Nikhil Bansal

  32. Proof (Arrivals, Case 2) SRPT Other Nikhil Bansal

  33. Proof (Arrivals, Case 2) SRPT Other |Other(2)| might increase but |Srpt(2)| does not But, in SRPT first 2 jobs bigger than new (red) , not so for Other! Nikhil Bansal

More Related