General Scheduling Model and Algorithm Andrew Kusiak 2139 Seamans Center Iowa City, Iowa 52242-1527 Tel: 319-335 5934 Fax: 319-335 5669 andrew-kusiak@uiowa.edu http://www.icaen.uiowa.edu/~ankusiak MANUFACTURING SCHEDULING n Jobs (Operations) m Machines + other resources MPS MRP Balancing Scheduling Scheduling Data No of operations Processing time Precedence constraints Due time Scheduling Algorithm Schedule
Example M 1 2 4 5 1 3 6 6 11 18 22 25 29 1 3 6 M 2 2 4 5 M 3 6 8 11 14 18 22 25 30 2 4 5 1 3 8 18 24 30 35 6 Time What type of schedule is it - jobshop or flowshop? Scheduling Model: m Machines and n Operations n = of parts m = of machines Ri = set of pairs of operations [k, l] for part Pi, where operation k precedes operation l, i = 1,..., n Qi = set of pairs of operations [k, l] for part Pi, where k and l can be performed in any order, i = 1,..., n Ii = set of operations without precedence constraints, i = 1,..., n. Np = set of operations to be performed on machine p, p = 1,..., m ni = of operations in part Pi, i = 1,..., n til = processing time of operation l of part Pi, l = 1,..., n, i = 1,..., n M = an arbitrary large positive
xik = completion time of operation k of part Pi, k = 1,..., n, i = 1,..., n x[i] = completion time of the final operation of part Pi, i = 1,..., n ykl = { 1 if operation k precedes operation l 0 otherwise for all [k, l] Qi, i = 1,..., n. zkl = { 1 if operation k precedes operation l 0, otherwise for all [k, l] Np, p = 1,..., m Basic Notation Part ti: Operations k, l,... Precedence constraints Completion time k xik l xil Part j
The Model n Min x[i] Min the total completion time i =1 subject to: xil - xik til for all [k, l] Ri, for all i Operations k and l of part i are processed according to the precedence required Schedule Part ti k k xik l til l xil Time xil - xik + M(1- ykl ) xik - xil + Mykl tik til for all [k, l] Qi for all i Two operations of part i can not be processed at the same time TWO POSSIBILITIES (Same part) Part i k l OR l k k til l xik xil xil l tik k xik Time
xjl - xik + M(1- zkl ) tjl for all [k, l] Np for all p xik - xjl + Mzkl tik i j where Np = Set of operations to be performed on machine p A machine can not process more than one part at the same time TWO POSSIBILITIES (Different parts) Part i Part j Part j Part i OR k til l xik xjl xjl l tik k xik Time tik xik { for [i, k ] Ii, i =1,..., n 0 for all other i, k Part i tik k xik Time For operations without precedence constraints ykl = 0, 1 for all [k, l] Qi, for all i zkl = 0, 1 for all [k, l] Np, for all p
!!!! Go over this model at least twice! Example Structure of Three Parts Part P 1 1, 1 1, 2 1, 3 Part P 2 2, 1 2, 2 Part P 3 31 3, 3, 3 3, 2
Scheduling Data Part 1 2 3 Operation 1 2 3 1 2 1 2 3 Machine 1 1 2 1 2 2 1 2 Processing time 3 5 6 8 4 9 2 7 LINDO Input File MIN Part P 1 1, 1 Part P 2 1, 2 1, 3 X13+X21+X22+X33 SUBJECT TO X12-X11 >= 5 X13-X12 >= 6 X33-X31 X31 >= 7 2, 1 2, 2 X33-X32 >= 7 Part P 3 Operations of part i are processed according to the precedence required xil - xik til 3, 1 3, 2 3, 3 Derived from X22-X21 + 999(1-Y1) >= 4 X21-X22+999Y1 >= 8 X22-X21-999Y1 >= -995 X31-X32+999Y2 >= 9 X32-X31-999Y2 >= -997 Two operations of the same part i can not be processed at the same time xik - xil + Mykl tik xil - xik + M(1- ykl) til
Part 1 2 3 Operation 1 2 3 1 2 1 2 3 Machine 1 1 2 1 2 2 1 2 Processing time 3 5 6 8 4 9 2 7 X11-X21+999Z1 >= 3 X21-X11-999Z1 >=-991 X11-X32+999Z2 >= 3 X32-X11-999Z2 >= -997 X12-X21+999Z3 >= 5 X21-X12-999Z3 >= -991 X12-X32+999Z4 >= 5 X32-X12-999Z4 >= -997 A machine can not process more than one part at the same time xik - xjl+ Mzkl tik xjl - xik + M(1- zkl) tjl X21 - X32 + 999Z5 >= 8 X32 - X21-999Z5 >= -997 Part 1 2 3 Operation 1 2 3 1 2 1 2 3 Machine 1 1 2 1 2 2 1 2 Processing time 3 5 6 8 4 9 2 7 X13-X22+999Z6 >= 6 X22-X13-999Z6 >= -995 X13-X31+999Z7 >= 6 X31-X13-999Z7 >= -990 X13-X33+999Z8 >= 6 X33-X13-999Z8 >= -992 X22-X31+999Z9 X31+999Z9 >= 4 X31-X22-999Z9 >= -990 X22-X33+999Z10 >= 4 X33-X22-999Z10 >= -992 A machine can not process more than one part at the same time xjl - xik + M(1- zkl) xik - xjl+ Mzkl tik tjl
X11 >= 3 X21 >= 8 X22 >= 4 X31 >= 9 X32 >= 2 END Operation finish time not smaller than its processing time INTEGER Y1 INTEGER Y2 INTEGER Z1 INTEGER Z2 INTEGER Z3 INTEGER Z4 INTEGER Z5 INTEGER Z6 INTEGER Z7 INTEGER Z8 INTEGER Z9 INTEGER Z10
The Optimal Schedule x32 = 2, x21 = 12, x11 = 15, x12 = 20, x22 = 4, x31 = 13, x33 = 20, and x13 = 26 M 1 3,2 2,1 1,1 1,2 2 4 12 15 20 M 2 0 2,2 3,1 3,3 1,3 4 13 20 26 Time Scheduling Model with Multiple Resources m = of resource types rs = of resources of type s, s = 1,..., m d[i] = due date of part i Nq = set of operations using resource q, q = 1,..., rs, s = 1,..., m n min x[i] i=1 subject to: xil - xik til for all [k, l] Ri, for all i xil - xik + M(1- ykl ) til for all [k, l] Qi xik - xil + Mykl tik for all i
xjl - xik + M(1- zkl ) tjl for all [k, l] Nq, for all q, xik - xjl + Mzkl x[i] tjl i j d[i] for all i tik for [i, k] Ii, i = 1,..., n xik { 0 for all other i, k ykl = 0, 1 for all [k, l] Qi, for all I zkl = 0, 1 for all [k, l] Nq, for all q Example Structure of Three Parts Part P 1 1, 1 1, 2 Part P 2 2, 1 2, 2 Part P 3 3, 1 3, 2 3, 3
Scheduling Data Part 1 2 3 Operation 1 2 1 2 1 2 3 Machine 1 2 2 1 1 2 1 Processing time 2 3 1 2 3 2 1 Tool 1 1 2 2 2 1 2 The Optimal Schedule with Limited Number of Tools M 1 (1) (2) (2) (2) 1, 1 2, 2 3, 1 3, 3 M 2 0 (2) (1) (1) 2, 1 1, 2 3, 2 1 2 5 7 9 C 3= 10 10 Time (k) i, j Operation j of uses tools k
The Optimal Schedule with Unlimited Number of Tools M 1 (1) (2) (2) (1) (2) 1, 1 2, 1 2, 2 3, 2 3, 3 M 2 0 (2) (1) 3, 1 1, 2 3 6 C' = 8 3 8 Time Two copies of tool 1 and 2 are needed. Definition General Scheduling Heuristic 3 5 1 2 6 4 Part P with 6 operations An operation is schedulable at time t if the following three conditions are satisfied: No other operation that belongs to the same part is being processed at the time t. All operations preceding the operation considered have been completed before the time t. All resources (for example, machines, tools, fixtures) required for performing the operation are available at the time t.
Two Scheduling Scenarios No single operation is schedulable (a deadlock) Many operations are schedulable hdlbl How to select the most promising operations? PRIORITY RULES
Definitions Part P with 6 operations 3 5 1 2 6 4 Operations 3, 4, 5, and 6 are successive operations of operation 2 Operations 3 and 4 are immediate successive operations of operation 2 General Heuristic Step 1. Initialize: Current time Set of schedulable operations Set of completed operations Step 2. From the set of schedulable operations, select an operation using the following priority rules: P1: with the largest of successive operations P2: belonging to a part with the minimum of schedulable operations P3: with the largest of immediate successive operations P4: belonging to a part with the largest of unprocessed operations P5: with the shortest processing time P6: belonging to a part with the shortest slack time.
P7: arbitrary choice Step 3. Schedule the operation selected in step 2. Update: The resource status The set of schedulable operations If the set of schedulable operations is empty, go to step 4; otherwise, go to step 2. Step 4. Calculate the completion time of each operation scheduled but not completed at the current time. Set the current time equal to the completion time of the operation with the least remaining processing time. Add this operation (or operations in case of a tie) to the set of completed operations. Update: The resource status The set of schedulable operations If there is no unprocessed operations, stop; otherwise, go to step 5. Step 5. If the set of schedulable operations is empty, go to step 4; otherwise go to step 2.
Heuristic Structure Determine Schedulable Set Operation with no precedences Operation belongs to a part being not-processed Manufacturing resources available Use Priority Rules: P1 - P7 Schedule an operation no Update Current time, machine status, part status All operations are scheduled yes End Priority Rules: P1 - P7 Schedulable Set >1 operations P1 >1 operations P2 >1 operations P3 >1 operations P4 >1 operations P5 >1 operations P6 >1 operations P7 One Operation Selected Arbitrary select 1 operation
Part P 1 Priority Rule P6: Min slack time 1 2 Part P 2 3 5 4 M 1 1 7 4 5 tp2 sp2 dp2 M 2 3 6 2 8 0 3 6 8 9 tp3 sp3 dp3 12 Time Part P 3 6 7 8 Slack = Due time - Current time Example Part P 1 1 2 Part P 2 3 4 5 Three Parts Part P 3 6 7 8
Scheduling Data Part P 1 1 2 Part P 2 3 5 4 Part P 3 Part 1 2 3 Operation 1 2 3 4 5 6 7 8 Machine 1 2 2 1 1 2 1 2 Machining time 4 2 3 2 2 3 2 1 6 7 8 Iterations of the Heuristic Step 1. Initialize: Current time t = 0 The set of schedulable operations S1 = {13467} {1, 3, 4, 6, The set of completed operations F = Ø P1: with the largest of successive operations P2: belonging to a part with the minimum of schedulable operations P3: with the largest of immediate successive operations P4: belonging to a part with the largest of unprocessed operations P5: with the shortest processing time P6: belonging to a part with the corresponding shortest slack time. Step 2. Using rule P1, operations 1, 3, 4, 7 have been selected. Priority rule P2 selects operation 1. Step 3. Operation 1 is scheduled on machine 1. Part P 1 1 2 Part P 2 3 5 M1 1 4 0 Time Part P 3 6 7 8
Step 4. Operations status update Scheduled operation 1 2 3 4 6 5 7 Same machine as operation 1 8 P1: with the largest of successive operations P2: belonging to a part with the minimum of schedulable operations P3: with the largest of immediate successive operations P4: belonging to a part with the largest of unprocessed operations P5: with the shortest processing time P6: belonging to a part with the corresponding shortest slack time. Part Operation Machine Machining time 1 1 2 2 3 3 1 2 3 4 35 6 7 8 1 2 2 1 1 2 1 2 4 2 3 2 2 3 2 1 The set of schedulable operations is updated to S1 = {3, 6}. Go to step 2. Step 2. Rule P1 selects operation 3 from S1 = {3, 6}. Step 3. Operation 3 is scheduled on machine 2. M1 1 M2 3 1 3 4 6 2 5 7 8 P1: with the largest of successive operations P2: belonging to a part with the minimum of schedulable operations P3: with the largest of immediate successive operations P4: belonging g to a part with the largest of unprocessed operations P5: with the shortest processing time P6: belonging to a part with the corresponding shortest slack time. Part 11 2 2 3 3 Operation 1 2 23 4 3 5 6 7 8 Machine 1 2 2 1 1 2 1 2 Machining 4 2 3 2 2 3 2 1 time The set of schedulable operations is updated to S1= Ø. Go to step 4.
Step 4. The completion time of operations 1 and 3 is 4 and 3, respectively, and current time is set to 3. Operation 3 is added to the set of completed operations F, F = {3}. Machine 2 becomes available and its status has been updated. The set of schedulable operations is updated to S1= {6}. Go to step 5. M1 M2 1 3 Time t=3 Part 11 2 2 3 3 Part Operation 1 2 23 4 53 6 7 8 Machine 1 2 211212 Machining 4 2322321 time Step 5. Since the set of schedulable operations S1={6} Ø, go to Step 2. Step 2. Operation 6 is selected. Step 3. Operation 6 is scheduled on machine 2. 1 3 4 6 2 5 7 8 M1 1 Time t=4 M2 3 6 M1 1 M2 3 6 Time t=4 1 3 4 6 2 5 7 8 Part Operation Machine Machining time 11 2 2 3 3 1 2 23 4 35 6 7 8 1 2 2 1 1 2 1 2 4 2 3 2 2 3 2 1 The set of schedulable operations S1={4} Ø. Step 2. Operation 4 is selected. Step 3. Operation 4 is scheduled on machine 1. M1 1 4 M2 3 6 Time t=6
The Final Schedule Part Part Operation Machine Machining time 11 2 2 3 3 1 2 23 4 35 6 7 8 1 2 2 1 1 2 1 2 4 2 3 2 2 3 2 1 M1 1 4 7 5 M 2 3 6 2 8 0 3 6 8 9 10 The makespan = 10 Time