Topic 15 Job Shop Scheduling Lecture Notes for Planning and Scheduling Prepared by Siggi Olafsson Job Shop Scheduling Have m machines and n jobs Each job visits some or all of the machines Customer order of small batches Wafer fabrication in semiconductor industry Hospital Very difficult to solve June 28, 2016 Lecture Notes for Planning and Scheduling Prepared by Siggi Olafsson 2 Job Shop Example Constraints Job follows a specific route One job at a time on each machine Machine 1 Machine 2 Machine 3 Machine 4 June 28, 2016 (1,1) (2,3) (1,2) (1,3) (2,1) (2,2) (3,1) (4,3) Lecture Notes for Planning and Scheduling Prepared by Siggi Olafsson (3,3) (4,2) 3 Graph Representation Each job follows a specific route through the job shop ... (1,1) (2,1) (3,1) Sink Source (1,2) (2,2) (2,3) (1,3) (4,2) (4,3) (3,3) (Conjuctive arcs) June 28, 2016 Lecture Notes for Planning and Scheduling Prepared by Siggi Olafsson 4 Graph Representation Machine constraints must also be satisfied ... (1,1) (2,1) (3,1) Sink Source (1,2) (2,2) (2,3) (1,3) (4,2) (4,3) (3,3) (Disjunctive arcs) June 28, 2016 Lecture Notes for Planning and Scheduling Prepared by Siggi Olafsson 5 Solving the Problem Select one of each pair of disjunctive arcs (1,1) (2,1) (3,1) Sink Source (1,2) (2,2) (2,3) (1,3) (4,2) (4,3) (3,3) The longest path in this graph G(D) determines the makespan June 28, 2016 Lecture Notes for Planning and Scheduling Prepared by Siggi Olafsson 6 Feasibility of the Schedule Are all selections feasible? (1,1) (2,1) (3,1) Sink Source June 28, 2016 (1,2) (2,2) (2,3) (1,3) (4,2) (4,3) Lecture Notes for Planning and Scheduling Prepared by Siggi Olafsson (3,3) 7 Disjunctive Programming Minimize Cmax Subject to ykj yij pij for all (i, j ) (k , j ) Cmax yij pij for all (i, j ) yij yil pil or yil yij pij for all (i, j ) (k , j ) yij 0 June 28, 2016 for all (i, j ) Lecture Notes for Planning and Scheduling Prepared by Siggi Olafsson 8 Solution Methods Exact solution Dispatching rules (16+) Branch and Bound 20 machines and 20 jobs Shifting Bottleneck Search heuristics Tabu, SA, GA, etc. June 28, 2016 Lecture Notes for Planning and Scheduling Prepared by Siggi Olafsson 9 Topic 16 Types of Schedules Lecture Notes for Planning and Scheduling Prepared by Siggi Olafsson Definitions A schedule is nondelay if no machine is idled when there is an operation available A schedule is called active if no operation can be completed earlier by altering the sequence on machines and not delaying other operations For “regular” objectives the optimal schedule is always active but not necessarily nondelay June 28, 2016 Lecture Notes for Planning and Scheduling Prepared by Siggi Olafsson 11 Schedule Space Semiactive Optimum Nondelay Active All Schedules June 28, 2016 Lecture Notes for Planning and Scheduling Prepared by Siggi Olafsson 12 Nonactive Schedule Machine 1 (1,1) Machine 2 (2,3) Machine 3 (2,2) (2,1) (3,2) 0 June 28, 2016 (2,1) 2 4 Lecture Notes for Planning and Scheduling Prepared by Siggi Olafsson 6 8 13 Active Schedule, not Nondelay Machine 1 Machine 2 (2,3) Machine 3 (2,2) (2,1) (3,2) 0 June 28, 2016 Delay (Operation (2,1) does not fit) (1,1) 2 4 Lecture Notes for Planning and Scheduling Prepared by Siggi Olafsson 6 8 14 Nondelay schedule Machine 1 (1,1) Machine 2 (2,3) Machine 3 (2,2) 4 6 (3,2) 0 June 28, 2016 (2,1) 2 Lecture Notes for Planning and Scheduling Prepared by Siggi Olafsson 8 15 Topic 17 Branch & Bound for Job Shops Lecture Notes for Planning and Scheduling Prepared by Siggi Olafsson Branch and Bound Operation (i,j) with duration pij Minimize makespan Branch by generating all active schedules Notation Let W denote operations whose predecessors have been scheduled Let rij be the earliest possible starting time of (i,j) in W. June 28, 2016 Lecture Notes for Planning and Scheduling Prepared by Siggi Olafsson 17 Generating Active Schedules Step 1. (Initialize) Let W contain the first operation of each job Let rij = 0 for all (i,j)W. Step 2. (Machine selection) Compute the current partial schedule t (W) min rij pij ( i , j )W and let i* denote the machine where minimum achieved June 28, 2016 Lecture Notes for Planning and Scheduling Prepared by Siggi Olafsson 18 Generating Active Schedules Step 3. (Branching) Let W’ denote all operations on machine i such that ri* j t (W) For each operation in W’ consider a partial schedule with that operation next on i* For each partial schedule, delete operation from W and include immediate follower in W. Go back to Step 2. June 28, 2016 Lecture Notes for Planning and Scheduling Prepared by Siggi Olafsson 19 Branching Tree Selection of (i*,j) Selection of (i*,l) W {( i , j ), (i , l )} ' June 28, 2016 * * Lecture Notes for Planning and Scheduling Prepared by Siggi Olafsson 20 Example (1,1) 10 (2,1) 8 (3,1) 4 0 Source 0 (2,2) 8 (1,2) 3 (4,2) 5 0 (1,3) 4 (2,3) 7 (3,2) 6 Sink 3 (4,3) Cmax 22 June 28, 2016 Lecture Notes for Planning and Scheduling Prepared by Siggi Olafsson 21 Partitioning Tree Level 1 W {(1,1), (2,2), (1,3)} t (W) min{ 0 10,0 8,0 4} 4 i 1 * W {(1,1), (1,3)} ' June 28, 2016 Lecture Notes for Planning and Scheduling Prepared by Siggi Olafsson 22 Level 1: select (1,1) (1,1) 0 Source 0 (2,2) 8 10 8 (2,1) 10 10 (1,2) 3 (4,2) (3,1) 5 (3,2) 0 (1,3) 4 Cmax 24 June 28, 2016 (2,3) 7 4 6 Sink 3 (4,3) Disjunctive Arcs Lecture Notes for Planning and Scheduling Prepared by Siggi Olafsson 23 Level 1: Select (1,3) (1,1) 10 (2,1) 8 (3,1) 4 0 Source 0 (2,2) 0 8 4 (1,2) 4 (1,3) 4 Cmax 26 June 28, 2016 3 (2,3) (4,2) 7 5 (3,2) 6 Sink 3 (4,3) Disjunctive Arcs Lecture Notes for Planning and Scheduling Prepared by Siggi Olafsson 24 Branching Tree No disjunctive arcs (1,1) scheduled first on machine 1 (1,3) scheduled first on machine 1 LB = 24 LB = 26 June 28, 2016 Lecture Notes for Planning and Scheduling Prepared by Siggi Olafsson 25 Branching Tree Level 2: W {( 2,2), (2,1), (1,3)} t (W) min{ 0 8,10 8,10 4} 8 i 2 * W {( 2,2)} ' June 28, 2016 Lecture Notes for Planning and Scheduling Prepared by Siggi Olafsson 26 Level 2: Select (2,2) (1,1) 0 Source 0 (2,2) 8 10 8 (2,1) 10 10 (1,2) 3 (4,2) (3,1) 5 (3,2) 0 (1,3) 4 (2,3) 7 4 6 Sink 3 (4,3) Disjunctive Arcs June 28, 2016 Lecture Notes for Planning and Scheduling Prepared by Siggi Olafsson 27 Branching Tree No disjunctive arcs (1,1) scheduled first on machine 1 LB = 24 (1,3) scheduled first on machine 1 (1,1) first on M1 and (2,2) first on M2 June 28, 2016 LB = 26 Lecture Notes for Planning and Scheduling Prepared by Siggi Olafsson 28 Lower Bounds Lower bounds The length of the critical path in G(D’) Quick but not very tight Linear programming relaxation A maximum lateness problem (see book) June 28, 2016 Lecture Notes for Planning and Scheduling Prepared by Siggi Olafsson 29 Topic 18 The Shifting Bottleneck Heuristic Lecture Notes for Planning and Scheduling Prepared by Siggi Olafsson Shifting Bottleneck Minimize makespan in a job shop Let M denote the set of machines Let M0 M be machines for which disjunctive arcs have been selected Basic idea: Select a machine in M - M0 to be included in M0 Sequence the operations on this machine June 28, 2016 Lecture Notes for Planning and Scheduling Prepared by Siggi Olafsson 31 Example Jobs Sequence Processing Times 1 1,2,3 P11=10, P21=8, P31=4 2 2,1,4,3 P22=8, P12=3, P42=5, P32=6 3 1,2,4 P13=4, P23=7, P43=3 June 28, 2016 Lecture Notes for Planning and Scheduling Prepared by Siggi Olafsson 32 Iteration 1 M0 (1,1) 10 (2,1) 8 (3,1) 4 0 Source 0 (2,2) 8 (1,2) 3 (4,2) 5 0 (1,3) 4 (2,3) 7 (3,2) 6 Sink 3 (4,3) Cmax ( M 0 ) 22 June 28, 2016 Lecture Notes for Planning and Scheduling Prepared by Siggi Olafsson 33 Selecting a Machine Set up a nonpreemptive single machine maximum lateness problem for Machine 1: Jobs 1 2 3 p1j 10 3 4 r1j 0 8 0 d1j 10 11 12 Optimum sequence is 1,2,3 Lmax Lecture Notes forwith Planning and (1)=5 Scheduling June 28, 2016 Prepared by Siggi Olafsson 34 Selecting a Machine Set up a nonpreemptive single machine maximum lateness problem for Machine 2: Jobs 1 2 3 p1j 10 3 4 r1j 0 8 0 d1j 10 11 12 Optimum sequence is 2,3,1 with L and (2)=5 Lecture Notes for Planning max Scheduling June 28, 2016 Prepared by Siggi Olafsson 35 Selecting a Machine Similarly, Lmax (3) 4 Lmax (4) 0 June 28, 2016 Either Machine 1 or Machine 2 is the bottleneck Lecture Notes for Planning and Scheduling Prepared by Siggi Olafsson 36 Iteration 2 M 0 {1} (1,1) 0 Source 0 10 (2,1) 8 (3,1) 4 10 (2,2) 0 8 (1,2) 3 (1,3) 4 3 (2,3) (4,2) 7 5 (3,2) 6 Sink 3 (4,3) Cmax ({1}) Cmax () Lmax (1) 22 5 27 June 28, 2016 Lecture Notes for Planning and Scheduling Prepared by Siggi Olafsson 37 Selecting a Machine Set up a nonpreemptive single machine maximum lateness problem for Machine 2: Jobs 1 2 3 p2j 8 8 7 r2j 10 0 17 d2j 23 10 24 Optimum sequence 2,1,3 with Land (2)=1 LectureisNotes for Planning Scheduling max June 28, 2016 Prepared by Siggi Olafsson 38 Selecting a Machine Similarly, Lmax (3) 1 Lmax (4) 0 Either Machine 2 or Machine 3 is the bottleneck June 28, 2016 Lecture Notes for Planning and Scheduling Prepared by Siggi Olafsson 39 Iteration 3 M 0 {1,2} (1,1) 0 Source 0 8 (2,2) 0 8 10 8 (2,1) (3,1) 4 10 8 3 5 6 (1,2) (4,2) (3,2) 3 (1,3) 4 (2,3) 7 Sink 3 (4,3) Cmax ({1,2}) Cmax ({1}) Lmax (2) 27 1 28 June 28, 2016 Lecture Notes for Planning and Scheduling Prepared by Siggi Olafsson 40 Discussion Procedure continues until all the disjunctive arcs have been added Extremely effective Fast Good solutions ‘Just a heuristic’ No guarantee of optimum June 28, 2016 Lecture Notes for Planning and Scheduling Prepared by Siggi Olafsson 41 Solving the Maximum Lateness Problem (•,•,•) (1,•,•) (2,•,•) (3,•,•) (1,2,3) (1,3,2) (3,1,2) (3,2,1) Lmax 5 Lmax 6 Lmax 6 Lmax 7 June 28, 2016 Lecture Notes for Planning and Scheduling Prepared by Siggi Olafsson 42 Discussion The solution is actually a little bit more complicated than before Precedence constraints because of other (already scheduled) machines Delay precedence constraints (see example in book) June 28, 2016 Lecture Notes for Planning and Scheduling Prepared by Siggi Olafsson 43 Discussion Shifting bottleneck can be applied generally Basic idea Solve problem “one variable at a time” Determine the “most important” variable Find the best value of that variable Move on to the “second most important” …. Here we treat each machine as a variable June 28, 2016 Lecture Notes for Planning and Scheduling Prepared by Siggi Olafsson 44 Topic 19 Shifted Bottleneck for Total Weighted Tardiness Objective Lecture Notes for Planning and Scheduling Prepared by Siggi Olafsson Total Weighted Tardiness We now apply a shifted bottleneck procedure to a job shop with total weighted tardiness objective Need n sinks in disjunctive graph Machines scheduled one at a time Given current graph calculate completion time of each job Some n due dates for each operation Piecewise linear penalty function June 28, 2016 Lecture Notes for Planning and Scheduling Prepared by Siggi Olafsson 46 Cost Function for Operation (i,j) hij cost function Cij d ijk June 28, 2016 d ijl Lecture Notes for Planning and Scheduling Prepared by Siggi Olafsson 47 Machine Selection Machine criticality Solve a single machine problem Piecewise linear cost function May have delayed precedence constraints Generalizes single-machine with n jobs, precedence constraints, and total weighted tardiness objective ATC rule June 28, 2016 Lecture Notes for Planning and Scheduling Prepared by Siggi Olafsson 48 Generalized ATC Rule Earliest time machine can be used n I j (t ) k 1 Ranks jobs good schedule June 28, 2016 d p (r t ) ij ij exp pj Kp wj k ij Scaling constant Lecture Notes for Planning and Scheduling Prepared by Siggi Olafsson 49 Criticality of Machines Criticality = subproblem objective function Simple More effective ways, e.g. Add disjunctive arcs for each machine '' C Calculate new completion times ij and '' d k Ck '' ' wk Ck Ck exp K k 1 n June 28, 2016 Lecture Notes for Planning and Scheduling Prepared by Siggi Olafsson 50 Example (1,1) 5 0 Source 0 June 28, 2016 (3,2) 5 4 (3,3) 5 (2,1) (1,2) (2,3) 10 5 3 (3,1) (2,2) (1,3) 4 6 7 Lecture Notes for Planning and Scheduling Prepared by Siggi Olafsson Sink d1 24 Sink d 2 18 Sink d 3 16 51 Subproblem: Machine 1 Jobs 1 2 3 p1j 5 5 7 r1j 5 4 8 d11j , d12j , d13j 10,-,- -,12,- -,-,16 June 28, 2016 Lecture Notes for Planning and Scheduling Prepared by Siggi Olafsson 52 Subproblem: Machine 2 Jobs 1 2 3 p2j 10 6 3 r2j 10 9 5 d 21 j , d 22 j , d 23 j 20,-,- -,18,- -,-,9 June 28, 2016 Lecture Notes for Planning and Scheduling Prepared by Siggi Olafsson 53 Subproblem: Machine 3 Jobs 1 2 3 p3j 4 4 5 r3j 20 0 0 d31 j , d32j , d33 j 24,-,- -,7,- -,-,6 June 28, 2016 Lecture Notes for Planning and Scheduling Prepared by Siggi Olafsson 54 Subproblem Solutions Solve using dispatching rule Use K=0.1 p5 Have t = 4, For machine 1 this results in I11 (4) 1.2 10 6 I12 (4) 3.3 10 7 Schedule first I13 (4) 1.5 10 12 June 28, 2016 Lecture Notes for Planning and Scheduling Prepared by Siggi Olafsson 55 Solution to Subproblems Schedule first Machine Sequence Value 1 (1,1),(1,2),(1,3) 18 2 (2,3),(2,1),(2,2) 16 3 (3,3),(3,2),(3,1) 4 June 28, 2016 Lecture Notes for Planning and Scheduling Prepared by Siggi Olafsson 56 First Iteration (1,1) 5 0 Source (3,2) 5 5 4 (2,1) (1,2) 10 5 (3,1) (2,2) 4 6 Sink d1 24 Sink d 2 18 Sink d 3 16 5 0 June 28, 2016 (3,3) 5 (2,3) 3 (1,3) 7 Lecture Notes for Planning and Scheduling Prepared by Siggi Olafsson 57 Subproblem: Machine 2 Jobs 1 2 3 p2j 10 6 3 r2j 10 15 5 d 21 j , d 22 j , d 23 j 20,-,- -,21,- -,-,15 June 28, 2016 Lecture Notes for Planning and Scheduling Prepared by Siggi Olafsson 58 Subproblem: Machine 3 Jobs 1 2 3 p3j 4 4 5 r3j 20 0 0 d31 j , d32j , d33 j 24,-,- -,10,10 -,-,12 June 28, 2016 Lecture Notes for Planning and Scheduling Prepared by Siggi Olafsson 59 Solution to Subproblems Schedule first June 28, 2016 Machine Sequence Value 2 (2,3),(2,1),(2,2) 10 3 (3,2),(3,3),(3,1) 0 Lecture Notes for Planning and Scheduling Prepared by Siggi Olafsson 60 Second Iteration (1,1) 5 0 Source (3,2) 5 5 4 (2,1) (1,2) 10 4 (3,1) 10 5 June 28, 2016 (3,3) 5 d1 24 Sink d 2 18 Sink d 3 16 5 3 0 (2,2) 6 Sink (2,3) 3 (1,3) 7 Lecture Notes for Planning and Scheduling Prepared by Siggi Olafsson 61 Subproblem: Machine 3 Jobs 1 2 3 p3j 4 4 5 r3j 20 0 0 d31 j , d32j , d33 j 24,-,- -,15,10 7,7,12 June 28, 2016 Lecture Notes for Planning and Scheduling Prepared by Siggi Olafsson 62 Third Iteration (1,1) 5 0 Source (3,2) 5 5 4 4 (1,2) 5 0 June 28, 2016 (2,1) 10 4 (3,1) 10 5 d1 24 Sink d 2 18 Sink d 3 16 5 3 (3,3) 5 (2,2) 6 Sink (2,3) 3 (1,3) 7 Lecture Notes for Planning and Scheduling Prepared by Siggi Olafsson 63 Final Schedule 1,1 Machine 1 Machine 2 2,3 Machine 3 3,3 3,2 0 5 1,2 1,3 2,1 2,2 3,1 10 15 20 d3 25 30 d1 d2 June 28, 2016 Lecture Notes for Planning and Scheduling Prepared by Siggi Olafsson 64 Performance Objective function 3 w T 1 (24 24) 2 (26 18) 2 (22 16) jj j 1 28 Try finding a better schedule using LEKIN (optimal value = 18) June 28, 2016 Lecture Notes for Planning and Scheduling Prepared by Siggi Olafsson 65 Topic 20 Random Search for Job Shop Scheduling Lecture Notes for Planning and Scheduling Prepared by Siggi Olafsson Random Search Methods Popular to use genetic algorithms, simulated annealing, tabu search, etc. Do not work too well Problems defining the neighborhood Do not exploit special structure June 28, 2016 Lecture Notes for Planning and Scheduling Prepared by Siggi Olafsson 67 Defining the Neighborhood (1,1) 5 0 Source (3,2) 5 0 (3,3) 5 10 4 (2,1) (3,1) 5 10 4 4 3 5 (1,2) 5 6 (2,2) Sink Sink 5 (2,3) 3 (1,3) 7 Sink Approximately nm neighbors! Simply too inefficient June 28, 2016 Lecture Notes for Planning and Scheduling Prepared by Siggi Olafsson 68 Job Shop with Makespan Random search methods can be applied Use ‘critical path’ neighborhood Can eliminate many neighbors immediately Specialized methods usually better Random search = ‘giving up’ ! Traveling Salesman Problem (TSP) Very well studied Lin-Kernighan type heuristics (1970) Order of 1000 times faster than random search June 28, 2016 Lecture Notes for Planning and Scheduling Prepared by Siggi Olafsson 69 Comparison of Methods Percentage over known optimum: Method Average Maximum Simulated Annealing 0.42 2.0 Tabu Search 0.18 0.8 Genetic Algorithm 1.37 4.7 June 28, 2016 Winner Lecture Notes for Planning and Scheduling Prepared by Siggi Olafsson 70 The Nested Partitions Method Partitioning Random sampling using randomized dispatching rules Calculating the promising index by scheduling the bottleneck machine first incorporating local improvement heuristic Can incorporate any special structure! June 28, 2016 Lecture Notes for Planning and Scheduling Prepared by Siggi Olafsson 71 Topic 21 Special Case: Flow Shops Lecture Notes for Planning and Scheduling Prepared by Siggi Olafsson A Flexible Flow Shop with Setups Stage 1 June 28, 2016 Stage 2 Stage 3 Stage 4 Lecture Notes for Planning and Scheduling Prepared by Siggi Olafsson 73 Applications Very common in applications: Paper mills Steel lines Bottling lines Food processing lines June 28, 2016 Lecture Notes for Planning and Scheduling Prepared by Siggi Olafsson 74 Classical Literature Exact solutions Simple flow shop with makespan criterion Two machine case (Johnson’s rule) Realistic problems require heuristic approaches June 28, 2016 Lecture Notes for Planning and Scheduling Prepared by Siggi Olafsson 75 Objectives Multiple objectives usual Meet due dates w jT j Maximize throughput s ijk Setting for job j on Machine i hi aik , aij Minimize work-in-process (WIP) June 28, 2016 Lecture Notes for Planning and Scheduling Prepared by Siggi Olafsson 76 Generating Schedules Identify bottlenecks Compute time windows at bottleneck stage Compute machine capacity at bottleneck Schedule bottleneck stage Schedule non-bottlenecks June 28, 2016 Lecture Notes for Planning and Scheduling Prepared by Siggi Olafsson 77 Identifying Bottlenecks In practice usually known Schedule downstream bottleneck first Determining the bottleneck loading number of shifts downtime due to setups Bottleneck assumed fixed June 28, 2016 Lecture Notes for Planning and Scheduling Prepared by Siggi Olafsson 78 Identifying Time Window Due date Shipping day Multiply remaining processing times with a safety factor Release date Status sj of job j Release date if sj = l rbj f (l ) June 28, 2016 Lecture Notes for Planning and Scheduling Prepared by Siggi Olafsson Decreasing function determined empirically 79 Computing Capacity Capacity of each machine at bottleneck Speed Number of shifts Setups Two cases: Identical machines Non-identical machines June 28, 2016 Lecture Notes for Planning and Scheduling Prepared by Siggi Olafsson 80 Scheduling Bottleneck Jobs selected one at a time Setup time Due date Capacity For example ATCS rule June 28, 2016 Lecture Notes for Planning and Scheduling Prepared by Siggi Olafsson 81 Schedule Remaining Jobs Determined by sequence at bottleneck stage Minor adjustments Adjacent pairwise interchanges to reduce setup June 28, 2016 Lecture Notes for Planning and Scheduling Prepared by Siggi Olafsson 82 Summary: Job Shops Representation: graph w/disjoint arcs Solution methods Branch-and-bound Shifted bottleneck heuristic Beam search Can incorporate bottleneck idea & dispatching rules Random search methods Special case: flow shops June 28, 2016 Lecture Notes for Planning and Scheduling Prepared by Siggi Olafsson 83