Topic 11 Basic Project Scheduling Lecture Notes for Planning and Scheduling Prepared by Siggi Olafsson Overview No resource Constraints Project Scheduling Resource Constraints Critical Path Method (CPM) Program Evaluation and Review Technique (PERT) Heuristic Resource Leveling Integer Programming Formulations June 28, 2016 Lecture Notes for Planning and Scheduling Prepared by Siggi Olafsson 2 Critical Path Method (CPM) Think of unlimited machines in parallel … and n jobs with precedence constraints Processing times pj as before Objective to minimize makespan June 28, 2016 Lecture Notes for Planning and Scheduling Prepared by Siggi Olafsson 3 Critical Path Method Forward procedure: Starting at time zero, calculate the earliest each job can be started The completion time of the last job is the makespan Backward procedure Starting at time equal to the makespan, calculate the latest each job can be started so that this makespan is realized June 28, 2016 Lecture Notes for Planning and Scheduling Prepared by Siggi Olafsson 4 Forward Procedure Step 1: Set at time t = 0 for all jobs j with no predecessors, Sj’=0 and set Cj’ = pj. Step 2: Compute for each job j S 'j max Ck' , all k j Cj’ = Sj’ + pj. Step 3: The optimal makespan is Cmax max C1' , C2' ,..., Cn' STOP June 28, 2016 Lecture Notes for Planning and Scheduling Prepared by Siggi Olafsson 5 Backward Procedure Step 1: Set at time t = Cmax for all jobs j with no successors, Cj’’= Cmax and set Sj’’ = Cmax - pj. Step 2: Compute for each job j C 'j' min S k'' , k all j Sj’’ = Cj’’ - pj. Step 3: '' '' Verify that 0 min{ S1 ,..., S n }. STOP Lecture Notes for Planning and Scheduling June 28, 2016 Prepared by Siggi Olafsson 6 Comments The forward procedure gives the earliest possible starting time for each job The backwards procedures gives the latest possible starting time for each job If these are equal the job is a critical job. If these are different the job is a slack job, and the difference is the float. A critical path is a chain of jobs starting at time 0 and ending at Cmax. June 28, 2016 Lecture Notes for Planning and Scheduling Prepared by Siggi Olafsson 7 Example j 1 2 3 4 pj 5 6 9 12 7 2 5 4 6 7 8 12 10 6 9 10 11 12 13 14 10 9 7 8 7 5 7 10 1 6 9 3 11 5 June 28, 2016 12 14 13 8 Lecture Notes for Planning and Scheduling Prepared by Siggi Olafsson 8 Forward Procedure 5+6=11 11+12=23 2 4 5 1 23+10=33 7 33+9=42 10 43+8=51 51+5=56 14+12=26 26+10=36 6 9 5+9=14 3 12 11 5 14+7=21 June 28, 2016 Cmax 56 8 26+6=32 36+7=43 Lecture Notes for Planning and Scheduling Prepared by Siggi Olafsson 13 14 43+7=50 9 Backwards Procedure 24-12=12 34-10=24 2 4 14-9=5 1 10 36-10=26 26-12=14 56-5=51 43-7=36 6 9 3 12 11 5 35-10=26 June 28, 2016 43-9=34 7 51-8=43 8 43-7=36 51-8=43 Lecture Notes for Planning and Scheduling Prepared by Siggi Olafsson 13 56 14 56-5=51 10 Critical Path 2 4 7 10 1 6 9 3 11 5 June 28, 2016 12 14 13 8 Lecture Notes for Planning and Scheduling Prepared by Siggi Olafsson 11 Topic 12 Variable Processing Times Lecture Notes for Planning and Scheduling Prepared by Siggi Olafsson Time/Cost Trade-Offs Assumed the processing times were fixed More money shorter processing time min max Start with linear costs p j p j p j Processing time Marginal cost a b cj June 28, 2016 cj cj min p max p j j Lecture Notes for Planning and Scheduling Prepared by Siggi Olafsson 13 Linear Costs Resources (money) c aj cbj p June 28, 2016 min j p max j Lecture Notes for Planning and Scheduling Prepared by Siggi Olafsson Processing time 14 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 June 28, 2016 Lecture Notes for Planning and Scheduling Prepared by Siggi Olafsson 15 Sources, Sinks, and Cuts Cut set Sink node Source (dummy) node June 28, 2016 Minimal cut set Lecture Notes for Planning and Scheduling Prepared by Siggi Olafsson 16 Time/Cost Trade-Off Heuristic Step 1: Set all processing times at their maximum pj p max j Determine all critical paths with these processing times Construct the graph Gcp of critical paths Continue to Step 2 June 28, 2016 Lecture Notes for Planning and Scheduling Prepared by Siggi Olafsson 17 Time/Cost Trade-Off Heuristic Step 2: Determine all minimum 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 2 June 28, 2016 Lecture Notes for Planning and Scheduling Prepared by Siggi Olafsson 18 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 June 28, 2016 Lecture Notes for Planning and Scheduling Prepared by Siggi Olafsson 19 Time/Cost Trade-Off Heuristic Step 4: Reduce all processing times in the minimum cut set by one time units Determine the new set of critical paths Revise graph Gcp and go back to Step 2 June 28, 2016 Lecture Notes for Planning and Scheduling Prepared by Siggi Olafsson 20 Example j 1 2 3 4 5 pj 5 6 9 12 7 12 10 6 10 9 7 8 7 5 pj 3 5 7 9 9 7 6 5 5 2 5 6 7 8 8 3 9 10 11 12 13 14 5 cja 20 25 20 15 30 40 35 25 30 20 25 35 20 10 cj 7 June 28, 2016 2 4 3 4 3 4 4 4 5 Lecture Notes for Planning and Scheduling Prepared by Siggi Olafsson 2 2 4 8 21 Maximum Processing Times 2 4 7 10 1 6 9 3 11 5 June 28, 2016 12 14 13 8 Lecture Notes for Planning and Scheduling Prepared by Siggi Olafsson 22 Maximum Processing Times Cmax 56 2 4 7 10 1 6 9 3 11 5 June 28, 2016 12 14 13 8 Lecture Notes for Planning and Scheduling Prepared by Siggi Olafsson 23 Critical Path Subgraph (Gcp) C1=7 C6=3 6 1 3 C3=4 12 C14=8 14 11 C11=2 Cut sets: {1},{3},{6},{9}, {11},{12},{14}. June 28, 2016 C12=2 C9=4 9 Minimum cut set with lowest cost Lecture Notes for Planning and Scheduling Prepared by Siggi Olafsson 24 Critical Path Subgraph (Gcp) C1=7 C6=3 6 1 3 C3=4 12 11 C14=8 14 13 C11=2 Cut sets: {1},{3},{6},{9}, {11},{12,13},{14}. June 28, 2016 C12=2 C9=4 9 C13=4 Minimum cut set with lowest cost Lecture Notes for Planning and Scheduling Prepared by Siggi Olafsson 25 Critical Path Subgraph (Gcp) C1=7 C6=3 6 1 3 C3=4 12 11 C14=8 14 13 C11=2 Reduce processing time next on job 6 June 28, 2016 C12=2 C9=4 9 C13=14 Reduce processing time until = 4 Lecture Notes for Planning and Scheduling Prepared by Siggi Olafsson 26 Critical Path Subgraph (Gcp) C2=2 2 C4=3 4 C7=4 7 C1=7 C6=3 6 1 3 C3=4 June 28, 2016 C9=4 9 C10=5 10 C12=2 12 11 C11=2 Lecture Notes for Planning and Scheduling Prepared by Siggi Olafsson C14=8 14 13 C13=4 27 Linear Programming Formulation The heuristic does not guaranteed optimum Here total cost is linear n c0Cmax c bj c j p max pj j j 1 Want to minimize n c0Cmax c j p j . j 1 June 28, 2016 Lecture Notes for Planning and Scheduling Prepared by Siggi Olafsson 28 Linear Program Minimize subject to n c0Cmax c j p j . j 1 xk p j x j 0, j k A pj p max j , j p j p min j , j x j 0, j Cmax x j p j 0, j June 28, 2016 Lecture Notes for Planning and Scheduling Prepared by Siggi Olafsson 29 Topic 13 PERT Lecture Notes for Planning and Scheduling Prepared by Siggi Olafsson Program Evaluation and Review Technique (PERT) Assumed processing times deterministic Processing time of j random with mean mj and variance sj2. Want to determine the expected makespan Assume we have pja = most optimistic processing time pjm = most likely processing time (mode) pjb = most pessimistic processing time June 28, 2016 Lecture Notes for Planning and Scheduling Prepared by Siggi Olafsson 31 Expected Makespan Estimate expected processing time p aj 4 p mj p bj mj 6 Apply CPM with expected processing times Let Jcp be a critical path Estimate expected makespan Eˆ (Cmax ) June 28, 2016 m jJ cp j Lecture Notes for Planning and Scheduling Prepared by Siggi Olafsson 32 Distribution of Makespan Estimate the variance of processing times b a p p j s 2j j 6 and the variance of the makespan Vˆ (Cmax ) 2 s j jJ cp Assume it is normally distributed June 28, 2016 Lecture Notes for Planning and Scheduling Prepared by Siggi Olafsson 33 Discussion Potential problems with PERT: Always underestimates project duration Non-critical paths ignored critical path probability critical activity probability Activities are not always independent other paths may delay the project same raw material, weather conditions, etc. Estimates by be inaccurate June 28, 2016 Lecture Notes for Planning and Scheduling Prepared by Siggi Olafsson 34 Discussion No resource constraints: Critical Path Method (CPM) Simple deterministic Time/cost trade-offs Linear cost (heuristic or exact) Non-linear cost (heuristic) Accounting for randomness (PERT) June 28, 2016 Lecture Notes for Planning and Scheduling Prepared by Siggi Olafsson 35 Topic 14 Adding Resource Constraints Lecture Notes for Planning and Scheduling Prepared by Siggi Olafsson Resource Constraints Renewable resources Very hard problem No LP Can develop an IP Let job n+1 be dummy job (sink) and 1 if job j is completed at time t x jt 0 otherwise. June 28, 2016 Lecture Notes for Planning and Scheduling Prepared by Siggi Olafsson 37 Makespan Let H bound the makespan, e.g. n H pj j 1 Completion time of job j is and the makespan H t x t 1 jt H t x t 1 June 28, 2016 n 1,t Lecture Notes for Planning and Scheduling Prepared by Siggi Olafsson 38 IP Formulation H t x Minimize Subject to t 1 H t x t 1 n 1,t H jt pk txkt 0 t 1 t p j 1 Rij x ju R j j 1 u t n H x t 1 June 28, 2016 jt 1 Lecture Notes for Planning and Scheduling Prepared by Siggi Olafsson 39 In Practice The IP cannot be solved (Almost) always resource constraints Heuristic: Resource constraint Precedence constraint Example: pouring foundation and sidewalk Both require same cement mixer Delaying foundation delays building Precedence constraint: pour foundation first Not a logical constraint June 28, 2016 Lecture Notes for Planning and Scheduling Prepared by Siggi Olafsson 40 Optimality of Heuristic Say n jobs need the same resource Could otherwise all be done simultaneously Add (artificial) precedence constraints Have n! possibilities 2 3 4 5 6 2 6 24 120 720 Will we select the optimal sequence? June 28, 2016 Lecture Notes for Planning and Scheduling Prepared by Siggi Olafsson 41 Decision Support Resource leveling Solve with no resource constraints Plot the resource use as a function of time If infeasible suggest precedence constraints Longest job Minimum slack User adds constraints Start over June 28, 2016 Lecture Notes for Planning and Scheduling Prepared by Siggi Olafsson 42 Example: One Resource 2 Uses resource 3 9 6 6 6 11 Resource Profile Capacity Time 10 June 28, 2016 20 Lecture Notes for Planning and Scheduling Prepared by Siggi Olafsson 30 43