Plannng and Schedulng to Mnmze Makespan & ardness John Hooker Carnege Mellon Unversty September 2006
he Problem Gven a set of tasks, each wth a deadlne 2
he Problem Gven a set of tasks, each wth a deadlne and processng facltes that run at dfferent speeds. 3
he Problem Allocate tasks to facltes. 4
he Problem Allocate tasks to facltes. Schedule tasks on each faclty cumulatve schedulng 5
he Problem Allocate tasks to facltes. Schedule tasks on each faclty cumulatve schedulng Each task has a gven processng tme on each faclty. 6
he Problem Allocate tasks to facltes. Schedule tasks on each faclty cumulatve schedulng Each task has a gven processng tme on each faclty. Each task consumes resources at a gven rate on each faclty. 7
he Problem Allocate tasks to facltes. Schedule tasks on each faclty cumulatve schedulng Each task has a gven processng tme on each faclty. Each task consumes resources at a gven rate on each faclty. Each faclty has a resource lmt. 8
he Problem Allocate tasks to facltes. Schedule tasks on each faclty cumulatve schedulng Obectves: Mnmze makespan Mnmze number of late tasks. Mnmze total tardness 9
Approach In practce, problem s often solved by gve-andtake. Planner allocates tasks to facltes Planner Schedulers 0
Approach In practce, problem s often solved by gve-andtake. Planner Schedulers If there are problems, schedulers telephone planners and ask for a dfferent allocaton.
Approach In practce, problem s often solved by gve-andtake. Planner allocates tasks dfferently Planner Schedulers 2
Approach In practce, problem s often solved by gve-andtake. Planner Schedulers And so forth untl agreement s reached. 3
Approach In practce, problem s often solved by gve-andtake. Planner Schedulers And so forth untl agreement s reached. Benders decomposton s a mathematcal formulaton of ts process. Plannng s the master problem. Schedulng s the subproblem. elephone calls are Benders cuts. 4
Approach Use logc-based Benders. Snce classcal Benders requres that the subproblem be a lnear or nonlnear programmng problem. Decomposton permts hybrd soluton: Apply MIP to plannng master problem. MIP s generally better at resource allocaton. Apply CP to schedulng subproblem. CP s generally better at schedulng. 5
Related Work 995 JH & Yan ogc-based Benders. Appled to logc crcut verfcaton. Faster than BDDs when crcut contans error 2000 JH heory of logc-based Benders. Branch-and-check proposed. 2000 JH Applcaton to plannng & schedulng proposed. Combne CP & MIP. Applcaton to nteger programmng, SA. 200 Jan & Grossmann Applcaton to macne assgnment and dsunctve schedulng. Smple Benders cuts, snce subproblem s a feasblty problem. 20 to 000 tmes faster than CP, MIP 6
Related Work 200 horstensson Branch and check appled to Jan & Grossmann problems. Update soluton of master problem, factor of 0 further speedup 2002 Harunkowsk & Grossmann Generalzaton of Jan & Grossmann to multstage. 2002 mpe Polypropylene batch schedulng at BASF. Solved prevously nsoluble problem n 0 mns. Smlar approach appled to automoble assembly Peugeot/Ctroën, pant mng Barbot. 2003 JH, Ottosson Integer programmng. Benders cuts less obvous, snce subproblem s an optmzaton problem. Sutable for stochastc nteger programmng breakpont at 20-30 scenaros 7
Related Work 2004 JH Mn-cost and mn-makespan plannng & cumulatve schedulng. Benders cuts less obvous n mn makespan, snce subproblem s optmzaton problem. 00 to 000 tmes faster than CP, MIP. 2004 Cambazard, Jussen et al. Real-tme schedulng of computer processes. CP master problem. 2004 Cu & Xa Integer programmng. Used mn-conflct classcal Benders cuts. 8
Related Work 2004 Maravelas and Grossmann Batch schedulng n chemcal plants. 2004 Correa, angevn & Rousseau Automated guded vecles. 2005 Rasmussen & rck Sports schedulng mn # consecutve home and away games Orders of magntude speedup over state of the art. 2005 JH Mn-tardness plannng and cumulatve schedulng. 0 - >000 tmes faster than CP, MIP when mnmzng # late obs. ~0 tmes faster when mnmzng total tardness, much better suboptmal solutons. 9
ogc-based Benders Decomposton mn subect to f, C, y y D, y D y Basc dea: Search over values of n master problem. Master Problem mn, z subect to = z For each eamned, solve subproblem for y. D y y f, y D y z B, all h subect to C, y h, y D Subproblem mn Benders cuts for all teratons h y Soluton of master problem 20
ogc-based Benders Decomposton Subproblem mn f, subect to C, y y y D y After solvng the subproblem, generate a Benders cut where s the optmal value of the subproblem. B z B he Benders cut s based on a logcal analyss of subproblem soluton. Re-solve the master problem and contnue untl t has the same optmal value as the subproblem. 2
Applyng Benders to Plannng & Schedulng Decompose problem nto assgnment resource-constraned assgn tasks schedulng to facltes schedule tasks on each faclty Use logc-based Benders to lnk these. Solve: master problem wth MIP -- good at resource allocaton subproblem wth Constrant Programmng -- good at schedulng We wll use Benders cuts that requre no nternal nformaton from the CP solver. 22
Notaton p = processng tme of task on faclty c = resource consumpton of task on faclty C = resources avalable on faclty Faclty Faclty 2 C task c task 4 task 5 C 2 c 22 task 3 task 2 p p 22 otal resource consumpton C at all tmes. 23
Obectve functons Mnmze makespan = { 0 } α = ma,α ma t p d y faclty assgned to task start tme of task Mnmze # late tasks = δ t p d { f α > 0 δ α = 0 f α = 0 Mnmze tardness = t p y d y due date for task 24
Mnmze Makespan Master Problem: Assgn tasks to facltes Formulate as MIP problem mn subect to M =, all M p C Benders cuts c makespan, all C act vty actvty 4 actvty 5 Relaaton of subproblem: Energy of tasks provdes lower bound on makespan. 25
Subproblem: Schedule tasks assgned to each faclty Separates nto an ndependent schedulng problem on each faclty. Solve by constrant programmng. mn M subect to M t d, all t p cumulatve c C 0 t d, all = = =, all et J h = set of tasks assgned to macne n teraton h. et M be mn makespan. We get a Benders cut statng that any future assgnment that puts obs n J h on ts macne must have makespan of at least M 26
he Benders cut s based on: emma. If we remove tasks, s from a faclty, the mnmum makespan on that faclty s reduced by at most s = p ma s { d } mn{ d } s Assumng all deadlnes d are the same, we get the Benders cut M M J p Mn makespan on faclty n last teraton 27
Why does ts work? Assume all deadlnes are the same. Add tasks,,s sequentally at end of optmal schedule for other tasks Case I: resultng schedule meets deadlne Optmal makespan for tasks s,,m Mˆ Optmal makespan for all tasks M Mˆ s = p Feasble makespan for all tasks tasks s,, m task task s M s Mˆ p ˆ = M M s = p d Deadlne for all tasks 28
Case II: resultng schedule eceeds deadlne Optmal makespan for tasks s,,m Mˆ Optmal makespan for all tasks M Mˆ s = p Makespan no longer feasble tasks s,, m task task s d Deadlne for all tasks M d s and Mˆ p > d ˆ = M M s = p 29
Master Problem: Assgn tasks to facltes Assume all deadlnes are the same Solve by MIP mn M subect to M M =, C M {0,} all p J c k, all p, all, h Relaaton Benders cuts Makespan on faclty n teraton h 30
Mnmze # ate asks Master Problem: Assgn tasks to facltes Iteraton h mn subect to =, all Benders cuts generated n teratons, K, h relaaton of subproblem {0,} = f task s assgned to faclty 3
Subproblem: Schedule tasks assgned to each faclty Separates nto an ndependent schedulng problem on each faclty. Solve by constrant programmng. mn subect to J t p > d =, all t J p J cumulatve c J C Set of tasks assgned to faclty by soluton of master problem. J 32
ˆ ˆ ˆ 0, ˆ all J 0 J Benders Cuts ower bound on # late tasks on faclty Mn # late tasks on faclty soluton of subproblem, all, all 33
ˆ ˆ ˆ 0, ˆ all J 0 J Benders Cuts ower bound on # late tasks on faclty Mn # late tasks on faclty soluton of subproblem, all, all subset of J for wch mn # late tasks s stll found by heurstc that repeatedly solves subproblem on faclty 34
Benders Cuts ˆ ˆ ˆ ˆ 0, all J 0 J, Mn # late tasks on faclty soluton of subproblem all, all o reduce # late tasks, must remove one of the 0 tasks n from faclty. J 35
Benders Cuts ˆ ˆ ˆ ˆ 0, all J 0 J, Mn # late tasks on faclty soluton of subproblem all, all subset of J for wch mn # late tasks s stll found by heurstc that repeatedly solves subproblem on faclty Smaller subset of J for wch mn # late tasks s found wle runnng same heurstc 36
Benders Cuts ˆ ˆ ˆ ˆ 0, all J 0 J, Mn # late tasks on faclty soluton of subproblem all, all o reduce # late tasks by more than, must remove one of the tasks n J from faclty. 37
Benders Cuts ˆ ˆ ˆ ˆ 0, all J 0 J, all, all hese Benders cuts are added to the master problem n each teraton h. 38
Relaaton of Subproblem ower bound on # late tasks on faclty C k J d c k p ma { p k J d k k k } d, all 39
Relaaton of Subproblem C ower bound on # late tasks on faclty k J d c k p ma { p k J d k k k } d, Set of tasks assgned to faclty wth deadlne at or before d all C task task 2 task 3 d 40
Relaaton of Subproblem C ower bound on # late tasks on faclty k J d c k p ma { p k J d k k k } d, Set of tasks assgned to faclty wth deadlne at or before d all C task task 2 task 3 Energy = p c d 4
C k J d c k p ma { p k J d Relaaton of Subproblem ower bound on # late tasks on faclty Area of tasks assgned to faclty wth deadlne at or before d k k k } d, all C task task 2 task 3 Energy = p c d 42
Relaaton of Subproblem C k J d c k p ma { p k J d k k k } ower bound on makespan latest deadlne d, all C task task 2 task 3 d 43
Relaaton of Subproblem C k J d c k p ma { p k J d k k k } ower bound on makespan latest deadlne d, all C task task 2 task 3 Ma processng tme d 44
45 p d p c C k d J k d J k k k k all, } ma { Mn # of late obs on faclty Relaaton of Subproblem
Relaaton of Subproblem C k J d c k p ma { p k J d k k k } d, all Mn # of late obs on faclty s relaaton s added to the master problem at the outset. 46
Mnmze otal ardness Master Problem: Assgn tasks to facltes Iteraton h mn subect to =, all Benders cuts generated n teratons, K, h relaaton I of subproblem relaaton II of subproblem {0,} = f task s assgned to faclty 47
Subproblem: Schedule tasks assgned to each faclty Separates nto an ndependent schedulng problem on each faclty. Solve by constrant programmng. mn subect to J t p d t p cumulatve c Set of tasks assgned to faclty by soluton of master problem., all J J J J C 48
Benders Cuts ower bound on tardness for faclty ˆ ˆ ˆ ˆ 0 0 0, all J J \ Z,, Mn tardness on faclty soluton of subproblem all all 49
Benders Cuts ower bound on tardness for faclty ˆ ˆ ˆ ˆ 0 0 0, all J J \ Z,, Mn tardness on faclty soluton of subproblem all all o reduce tardness on faclty, must remove one of the tasks assgned to t. 50
Benders Cuts ˆ ˆ ˆ ˆ 0 0 0, all J J \ Z,, Mn tardness on faclty soluton of subproblem all all Set of tasks that can be removed, one at a tme from faclty wthout reducng mn tardness. 5
Benders Cuts ˆ ˆ ˆ ˆ 0 0 0, all J J \ Z,, all all Set of tasks that can be removed, one at a tme from faclty wthout reducng mn tardness. Mn tardness on faclty when all tasks n Z are removed smultaneously. 52
Benders Cuts ˆ ˆ ˆ ˆ 0 0 0, all J J \ Z,, all all o reduce tardness below on faclty, must remove one of the tasks n J \ Z Set of tasks that can be removed, one at a tme from faclty wthout reducng mn tardness. 0 Mn tardness on faclty when all tasks n Z are removed smultaneously. 53
Benders Cuts ˆ ˆ ˆ ˆ 0 0 0, all J J \ Z, all, all hese Benders cuts are added to the master problem n each teraton h. 54
Subproblem Relaaton I ower bound on total tardness for faclty C J d k c p d k, all k 55
Subproblem Relaaton I C ower bound on total tardness for faclty J d k c p d k, all k Set of tasks assgned to faclty wth deadlne at or before d k task task 2 task 3 d k 56
Subproblem Relaaton I C ower bound on total tardness for faclty J d k c p d k, Area of tasks assgned to faclty wth deadlne at or before d k all k task task 2 task 3 d k 57
Subproblem Relaaton I ower bound on total tardness for faclty C J d k c p d k, ower bound on total tardness all k task task 2 task 3 d k 58
59 emma. Consder a mn tardness problem that schedules tasks,, n on faclty, where d d n. he mn tardness s bounded below by = = n k k where = = k k k d c p C π π and π s a permutaton of,, n such that n n c p c p π π π π Subproblem Relaaton II
60 Eample of emma d p c p c 3 2 3 6 2 4 4 2 8 3 5 5 5 C task task 2 task 3 d d 2 d 3 Mn tardness = 4 3 4 / 5 8 6 5 3 0 4 6 5 3 0 3 5 3 3 2 2 3 3 3 2 3 3 2 3 3 = = = = = = = = = d c p c p c p C d c p c p C d c p C 2 3 4 / bound on tardness ower 3 2 = = =
For a permutaton σ of,,n let where = k Idea of proof σ = σ n k = k σ pπ c d π σ k C = k et σ 0,, σ 0 n be order of obs n any optmal soluton, so that tσ tσ and mn tardness s 0 0 n Consder bubble sort on σ 0,, σ 0 n to obtan,,n. et σ 0,, σ S be resultng sequence of permutatons, so that σ s, σ s dffer by a swap and σ s =. 6
62 Now we have S s s = 0 σ σ σ σ snce 0 0 0 0 0 0 0 0 σ σ π π σ σ σ σ σ σ d c p C d c p C d p t n k n k n = = = = = = = = = = = = = n k s s k s k k s s n k s s k s k k s s 2 2 σ σ σ σ σ σ σ σ σ σ swap k and k So 0 = = B A b a b A A a s k s k s k s k s s σ σ σ σ σ σ snce A a, B b areas def. of π
63 From the lemma, we can wrte the relaaton = n k k k where = k k k d c p C π π π o lnearze ts, we wrte = n k k and k k k k k M d c p C = π π π = = k k k d c p C M π π where Wrtng relaaton II
Computatonal Results Random problems on 2, 3, 4 facltes. Facltes run at dfferent speeds. All release tmes = 0. Mn cost and makespan problems: deadlnes same/dfferent. ardness problems: random due date parameters set so that a few tasks tend to be late. No precedence or other sde constrants. Makes problem harder. Implement wth OP Studo CPEX for MIP. IOG Scheduler for CP. Use AssgnAlternatves & Setmes. 64
Mn makespan, 2 facltes Average of 5 nstances shown Jobs MIP CP Benders 0 3.4 0.8 0.24 2 2 4.0 0.3 4 2572 299 5.0 6 5974 3737 36 8 7200 233 20 268 At least one problem n the 5 eceeded 7200 sec 2 hours 65
Mn makespan, 3 facltes Average of 5 nstances shown Jobs MIP CP Benders 0 3.9 0.9 0.23 2 2 7.5 0.38 4 524 98.4 6 76 444 7.6 8 469 7200 30 20 8.7 22 202 At least one problem n the 5 eceeded 7200 sec 2 hours 66
Mn makespan, 4 facltes Average of 5 nstances shown Jobs MIP CP Benders 0.0 0.07 0.9 2 5.0.9 0.43 4 24 524 0.82 6 35 3898.0 8 393 7200 6.4 20 4.4 22 28 24 945 At least one problem n the 5 eceeded 7200 sec 2 hours 67
Mn makespan, 3 facltes Dfferent deadlnes Average of 5 nstances shown Jobs MIP CP Benders 4 223 7. 4.4 6 853 620 5. 8 350 928 2.9 20 7200 7200 449 22 7200 388 24 7200 32 At least one problem n the 5 eceeded 7200 sec 2 hours 68
Mn # late tasks Smaller problems asks 4 6 8 CP me sec MIP Benders Mn # late tasks 092 5.8 0.5 382 8.0 0.7 265 3.2 0.7 2 85 2.6.3 2 5228 35 665 3 304 2.7 0.5 0? 3 0.2 30 22 0.4 4925 29 2.7 2 9 5.7 24 4 >7200 2.0 0. 0? 8.0 0.2 >7200 867 8.5 >7200 6.3.4 2 >7200 577 3.4 2 69
asks me sec MIP Benders Best soluton MIP Benders Mn # late tasks arger problems 20 22 97 0.4 0 0 >7200 2.3 29 5.0 >7200 2 2 843 66 3 3 6.3 0 0 >7200 3.7 = optmalty not proved >7200 49 3 2 >7200 3453 5 2 >7200 >7200 6 6 24 25 0.8 0 0 >7200 8 0 >7200 62 2 0 >7200 24 3 >7200 234 2 70
Effect of subproblem relaaton Mn # late tasks asks 6 8 20 me sec wth rela wthout rela 0.5 2.6 0.4.5 0.2.3 2.7 4.2 24 8 0.. 0.2 0.7 3.4 3.3.4 5 8.5 0.4 88 2.3 9.7 5.0 63 9 66 226 7
Mn total tardness Smaller problems asks 4 6 8 me sec CP MIP Benders Mn tardness 838 7.0 6. 759 34 3.7 2 783 45 9 5 >7200 73 40 9 >7200 >7200 3269 26 >7200 9.4 0 >7200 46 2. 0 >7200 52 4.2 4 >7200 05 56 20 >7200 3424 3.4 3 87 2.8 0 5 5.3 3 46 49 5 256 47 >7200 203 4 72
Mn total tardness arger problems asks 20 22 me sec MIP Benders Best soluton MIP Benders 05 8 0 0 44 23 39 29 4 4 442 332 8 8 >7200 >7200 75 37 6 9 0 0 584 37 2 2 = optmalty not proved >7200 >7200 20 40 >7200 >7200 62 46 >7200 >7200 375 4 24 0 324 0 0 >7200 94 20 0 >7200 0 57 0 >7200 >7200 20 5 >7200 >7200 25 7 73
Effect of subproblem relaaton Mn total tardness asks 6 8 20 me sec wth rela wthout rela.4 4.4 2. 6.5 4.2 30 56 99 765 763 2.8 0 5.3 7 47 20 49 354 203 502 8 5 23 898 29 55 332 764 >7200 >7200 74
Conclusons Benders s sgnfcantly faster than MIP wch s faster than CP. Speedup for mn makespan, # late tasks s often orders of magntude. Smaller speedup for mn total tardness. Problems wth more than a few late tasks are hard for all methods. Benders fnds better suboptmal solutons. Even when Benders fals to prove optmalty, t obtans much better solutons than MIP n the same tme perod. Subproblem relaaton s mportant. near relaaton of cumulatve constrant can be crtcal to performance, especally when mnmzng total tardness. 75
Future Research Implement branch-and-check for Benders problem. Eplot dual nformaton from the subproblem soluton process e.g. edge fndng. Eplore other problem classes. Integrated long- and short-term schedulng Vecle routng SA subproblem s renamable Horn Stochastc IP 76