Lecture 6: Time/Cost Trade-off in Project Planning © J. Christopher Beck 2008 1 Outline Project Planning with Time/Cost Tradeoffs Linear and non-linear © J. Christopher Beck 2008 2 Readings P Ch 4.4-4.5 Slides borrowed from Twente & Iowa See Pinedo CD © J. Christopher Beck 2008 3 Time/Cost Trade-Offs What if you could spend money to reduce the job duration More money shorter processing time Run machine at higher speed © J. Christopher Beck 2008 4 Linear Costs Money c aj Cost to reduce job j by by 1 time unit max p min p p j j j c aj c bj Marginal c j max min p p cost j j cbj p min j © J. Christopher Beck 2008 p max j Processing time 5 Problem Spend money to reduce processing times so as to minimize: n c0Cmax cbj c j p max pj j j 1 “Overhead” cost © J. Christopher Beck 2008 Cost per activity 6 Solution Methods Objective: minimum cost of project Time/Cost Trade-off Heuristic Good schedules Works also for non-linear costs Linear programming formulation Optimal schedules Non-linear version not easily solved © J. Christopher Beck 2008 7 Sources, Sinks, & Cuts Cut set Sink node Source (dummy) node © J. Christopher Beck 2008 Minimal cut set 8 Cuts Sets & Minimal Cut Sets V is a set of nodes E is set of edges (arcs) Given a graph G(V,E) A cut set is a set of nodes S V such that in the graph formed by removing the nodes in S from G there is no path from the source to the sink A minimal cut set, R, is a cut set such that if you remove any node, a, from R, R \ {a} is not a cut set © J. Christopher Beck 2008 9 Is This a Cut Set? Is This a Minimal Cut Set? 2 4 7 10 1 6 3 © J. Christopher Beck 2008 9 12 11 14 13 10 Is This a Cut Set? Is This a Minimal Cut Set? 2 4 7 10 1 6 3 © J. Christopher Beck 2008 9 12 11 14 13 11 Is This a Cut Set? Is This a Minimal Cut Set? 2 4 7 10 1 6 3 © J. Christopher Beck 2008 9 12 11 14 13 12 Is This a Cut Set? Is This a Minimal Cut Set? 2 4 7 10 1 6 3 © J. Christopher Beck 2008 9 12 11 14 13 13 Is This a Cut Set? Is This a Minimal Cut Set? 2 4 7 10 1 6 3 © J. Christopher Beck 2008 9 12 11 14 13 14 Is This a Cut Set? Is This a Minimal Cut Set? 2 4 7 10 1 6 3 © J. Christopher Beck 2008 9 12 11 14 13 15 Time/Cost Trade-off Heuristic Step 1: Set all processing times at their maximum pj p max j Determine all critical paths Construct the graph Gcp of critical paths © J. Christopher Beck 2008 16 Time/Cost Trade-off Heuristic Step 2: Determine all minimal cut sets in Gcp Consider those sets where all processing times are larger than their minimum pj p min j , j Gcp If no such set STOP; otherwise continue to Step 3 © J. Christopher Beck 2008 17 Time/Cost Trade-Off Heuristic Step 3: For each minimum cut set: Compute the cost of reducing all processing times by one time unit. Take the minimum cut set with the lowest cost If this is less than the overhead per time unit go on to Step 4; otherwise STOP © J. Christopher Beck 2008 18 Time/Cost Trade-Off Heuristic Step 4: Reduce all processing times in the minimum cut set by one time unit Determine the new set of critical paths Revise graph Gcp and go back to Step 2 © J. Christopher Beck 2008 19 Example 4.4.2 Error in text Jobs 1 2 3 4 5 6 7 8 9 10 11 12 13 14 pmaxj 5 6 9 12 7 12 10 6 10 9 7 8 7 5 pminj 3 5 7 9 5 9 8 3 7 6 4 5 5 4 caj 20 25 20 15 30 40 35 25 30 20 25 35 20 10 cbj 6 22 12 6 22 31 27 13 18 5 19 29 12 2 cj 7 2 4 3 4 3 4 4 4 5 2 2 8 © J. Christopher Beck 2008 4 20 Warning: Example 4.4.2 Unfortunately, the text is wrong for this example! © J. Christopher Beck 2008 21 1. Step 1: Maximum Processing Times, Find Gcp 2 4 7 10 1 6 9 3 11 5 © J. Christopher Beck 2008 12 14 13 8 22 1. Step 1: Maximum Processing Times, Find Gcp Cmax 56 2 4 7 10 1 6 9 3 Cost = overhead + job costs = co * Cmax + Σcbj = 6 * 56 + 224 = 560 © J. Christopher Beck 2008 12 11 5 14 13 8 23 1. Step 2 & 3: Min. Cut Sets in Gcp & Lowest Cost c1=7 c6=3 6 1 c9=4 9 3 c3=4 Cut sets: {1},{3},{6},{9}, {11},{12},{14}. Arbitrarily choose 12 Reduce p12 from 8 to 7 © J. Christopher Beck 2008 c12=2 c14=8 12 14 11 c11=2 Minimum cut set with lowest cost 24 2. Step 4 & 1: Reduce p12 by 1 Cmax 55 2 4 7 10 1 6 9 3 Cost = overhead + processing = c0 * Cmax + Σjob costs = 6 * 55 + 226 = 556 © J. Christopher Beck 2008 12 11 5 14 13 8 25 2. Step 2 & 3: Min. Cut Sets in Gcp & Lowest Cost c1=7 c6=3 6 1 c9=4 9 3 c3=4 Cut sets: {1},{3},{6},{9}, {11},{12,13},{14} Why isn’t {12} a cut set? What is the cost of {12, 13}? © J. Christopher Beck 2008 c12=2 c14=8 12 14 11 13 c11=2 c13=4 Minimum cut set with lowest cost 26 3. Step 4 & 1: Reduce p11 by 1 Cmax 54 2 4 7 10 1 6 9 3 Cost = overhead + processing = c0 * Cmax + Σjob costs = 6 * 54 + 228 = 552 © J. Christopher Beck 2008 12 11 5 14 13 8 27 3. Step 2 & 3: Min. Cut Sets in Gcp & Lowest Cost c2=2 c4=3 2 4 c7=4 7 c1=7 c6=3 6 1 c9=4 9 3 c3=4 23 Min. cut sets! Where are they? Min cost min cut set: {2,11}: 4 Reduce Job 2 to 5 and Job 11 to 5 © J. Christopher Beck 2008 c10=4 10 c12=2 c14=8 12 14 11 13 c11=2 c13=4 Minimum cut set with lowest cost 28 4. Step 4 & 1: Reduce p2 & p11 by 1 Cmax 53 2 4 7 10 1 6 9 3 Cost = overhead + processing = c0 * Cmax + Σjob costs = 6 * 53 + 232 = 550 © J. Christopher Beck 2008 12 11 5 14 13 8 29 4. Step 2 & 3: Min. Cut Sets in Gcp & Lowest Cost c2=2 c4=3 2 4 c7=4 7 c1=7 c6=3 6 1 c9=4 9 3 c3=4 Can’t reduce Job 2 anymore. Why? Min cost min cut set: {11,12}: 4 Reduce Job 11 to 4, Job 12 to 6 © J. Christopher Beck 2008 c10=4 10 c12=2 c14=8 12 14 11 13 c11=2 c13=4 Minimum cut set with lowest cost 30 5. Step 4 & 1: Reduce p11 and p12 by 1 2 4 Cmax 52 7 10 1 6 9 3 Cost = overhead + processing = c0 * Cmax + Σjob costs = 6 * 52 + 236 = 548 © J. Christopher Beck 2008 12 11 5 14 13 8 31 5. Step 2 & 3: Min. Cut Sets in Gcp & Lowest Cost c2=2 c4=3 2 4 c7=4 7 c1=7 c6=3 6 1 3 c3=4 c9=4 9 c10=4 10 c12=2 c14=8 12 14 11 13 c11=2 c13=4 Cutset: {6, 12}: 4 Reduce Job 6 to 11, Job 12 to 5 © J. Christopher Beck 2008 32 6. Step 4 & 1: Reduce p6 and p12 by 1 Cmax 51 2 4 7 10 1 6 9 3 Cost = overhead + processing = c0 * Cmax + Σjob costs = 6 * 51 + 241 = 547 © J. Christopher Beck 2008 12 11 5 14 13 8 33 6. Step 2 & 3: Min. Cut Sets in Gcp & Lowest Cost c2=2 c4=3 2 4 c7=4 7 c1=7 c6=3 6 1 c9=4 9 3 c3=4 c10=4 10 c12=2 c14=8 12 14 11 13 c11=2 c13=4 All cut sets either can’t be reduced (a job at pmin) or has a cost ≥ 6. So we’re done. © J. Christopher Beck 2008 34 Example 4.4.2 It would be very useful for you to work through this entire example on your own! Remember the book is wrong. You should use the slides. © J. Christopher Beck 2008 35 Linear Programming Formulation The heuristic does not guarantee optimum See example 4.4.3 You are responsible for the LP formulation! see the text! © J. Christopher Beck 2008 36 Can Also Have Non-linear Costs Arbitrary function cj(pj) → cost of setting job j to processing time pj LP doesn’t work! See Section 4.5 A question I like: Given processing times and cj(pj), which algorithm would you use (heuristic or LP)? © J. Christopher Beck 2008 37