Tutorial: Operations Research in Constraint Programming John Hooker Carnegie Mellon University May 2009 Revised June 2009 May 2009 Slide 1
Motivation Benders decomposition allows us to apply CP and OR to different parts of the problem. It searches over values of certain variables that, when fied, result in a much simpler subproblem. The search learns from past eperience by accumulating Benders cuts (a form of nogood). The technique can be generalized far beyond the original OR conception. Generalized Benders methods have resulted in the greatest speedups achieved by combining CP and OR. May 2009 Slide 313
Benders Decomposition in the Abstract Benders decomposition can be applied to problems of the form min f(, y) Sy (, ) D, y D y When is fied to some value, the resulting subproblem is much easier: min f(, y) Sy (, ) y D y perhaps because it decouples into smaller problems. For eample, suppose assigns jobs to machines, and y schedules the jobs on the machines. When is fied, the problem decouples into a separate scheduling subproblem for each machine. May 2009 Slide 314
Benders Decomposition We will search over assignments to. This is the master problem. In iteration k we assume = k and solve the subproblem k min f(, y) k S (, y) y D y and get optimal value v k We generate a Benders cut (a type of nogood) v B ( ) 1 k + that satisfies B k+1 ( k ) = v k. Cost in the original problem The Benders cut says that if we set = k again, the resulting cost v will be at least v k. To do better than v k, we must try something else. It also says that any other will result in a cost of at least B k+1 (), perhaps due to some similarity between and k. May 2009 Slide 315
Benders Decomposition We will search over assignments to. This is the master problem. In iteration k we assume = k and solve the subproblem k min f(, y) k S (, y) y D y and get optimal value v k We generate a Benders cut (a type of nogood) v B ( ) 1 k + that satisfies B k+1 () = v k. Cost in the original problem We add the Benders cut to the master problem, which becomes min May 2009 Slide 316 v v B( ), i = 1,, k + 1 i D Benders cuts generated so far
Benders Decomposition We now solve the master problem min v v B( ), i = 1,, k + 1 i D to get the net trial value k+1. The master problem is a relaation of the original problem, and its optimal value is a lower bound on the optimal value of the original problem. The subproblem is a restriction, and its optimal value is an upper bound. The process continues until the bounds meet. The Benders cuts partially define the projection of the feasible set onto. We hope not too many cuts are needed to find the optimum. May 2009 Slide 317
Classical Benders Decomposition The classical method applies to problems of the form min f( ) + cy g ( ) + Ay b D, 0 y Let λ k solve the dual. and the subproblem is an LP k min f ( ) + cy k Ay b g( ) y 0 ( λ) whose dual is k ( ) k ma f( ) + λ b g( ) λa c λ 0 By strong duality, B k+1 () = f() + λ k (b g()) is the tightest lower bound on the optimal value v of the original problem when = k. Even for other values of, λ k remains feasible in the dual. So by weak duality, B k+1 () remains a lower bound on v. May 2009 Slide 318
Classical Benders So the master problem min v v B( ), i = 1,, k + 1 i D becomes min v i v f( ) + λ ( b g( )), i = 1,, k + 1 D In most applications the master problem is an MILP a nonlinear programming problem (NLP), or a mied integer/nonlinear programming problem (MINLP). May 2009 Slide 319
Eample: Machine Scheduling Assign 5 jobs to 2 machines (A and B), and schedule the machines assigned to each machine within time windows. The objective is to minimize makespan. Time lapse between start of first job and end of last job. Assign the jobs in the master problem, to be solved by MILP. Schedule the jobs in the subproblem, to be solved by CP. May 2009 Slide 320
Machine Scheduling Job Data Once jobs are assigned, we can minimize overall makespan by minimizing makespan on each machine individually. So the subproblem decouples. Machine A Machine B May 2009 Slide 321
Machine Scheduling Job Data Once jobs are assigned, we can minimize overall makespan by minimizing makespan on each machine individually. So the subproblem decouples. Minimum makespan schedule for jobs 1, 2, 3, 5 on machine A May 2009 Slide 322
Machine Scheduling The problem is min M M s + p, all j j j r s d p, all j j j j j j Start time of job j j ( j j = ij j = ) disjunctive ( s i),( p i), all i Time windows Jobs cannot overlap May 2009 Slide 323
Machine Scheduling The problem is min M M s + p, all j j j r s d p, all j j j j j j Start time of job j j ( j j = ij j = ) disjunctive ( s i),( p i), all i Time windows Jobs cannot overlap For a fied assignment the subproblem on each machine i is May 2009 Slide 324 min M M s + p, all j with = i j j j j r s d p, all j with = i j j j j j j ( sj j = i pij j = i ) disjunctive ( ),( )
Benders cuts Suppose we assign jobs 1,2,3,5 to machine A in iteration k. We can prove that 10 is the optimal makespan by proving that the schedule is infeasible with makespan 9. Edge finding derives infeasibility by reasoning only with jobs 2,3,5. So these jobs alone create a minimum makespan of 10. So we have a Benders cut May 2009 Slide 325 10 if 2 = 3 = 4 = A v Bk + 1( ) = 0 otherwise
Benders cuts We want the master problem to be an MILP, which is good for assignment problems. So we write the Benders cut v B ( ) k + 1 10 if 2 = 3 = 4 = A = 0 otherwise Using 0-1 variables: v 10( + + 2) v 0 A2 A3 A5 = 1 if job 5 is assigned to machine A May 2009 Slide 326
Master problem The master problem is an MILP: min v 5 j = 1 5 j = 1 Aj Bj 5 5 ij ij ij ij j= 1 j= 3 B4 { 0,1} Constraints derived from time windows 10, etc. Constraints derived from release times 10, etc. v p, v 2 + p, etc., i = A, B v 10( + + 2) v ij p p 8 Aj Bj A2 A3 A5 Benders cut from machine A Benders cut from machine B May 2009 Slide 327
Stronger Benders cuts If all release times are the same, we can strengthen the Benders cuts. We are now using the cut May 2009 Slide 328 Min makespan on machine i in iteration k v Mik ij Jik + 1 j Jik Set of jobs assigned to machine i in iteration k A stronger cut provides a useful bound even if only some of the jobs in J ik are assigned to machine i: v M (1 ) p ik ij ij j J These results can be generalized to cumulative scheduling. ik
May 2009 Slide 329