Transcription of MixedIntegerLinearProgramming
1 Mixed Integer Linear ProgrammingCombinatorial Problem Solving (CPS)Javier Larrosa Albert Oliveras Enric Rodr guez-CarbonellMay 3, 2021 Mixed Integer Linear Programs2 / 61 Amixed integer linear program(MILP, MIP) is of the formmincTxAx=bx 0xi Z i I If all variables need to be integer,it is called a(pure) integer linear program(ILP, IP) If all variables need to be0or1(binary, boolean),it is called a0 1linear programComplexity: LP vs. IP3 / 61 Including integer variables increases enourmously the modeling power,at the expense of more complexity LP s can be solved inpolynomial timewith interior-point methods(ellipsoid method, Karmarkar s algorithm) Integer Programming is anNP-hardproblem. So: There isno known polynomial-time algorithm There arelittle chancesthat one will ever be found Even small problems may be hard to solve What follows is one of the many approaches(and one of the most successful) for attacking IP sLP Relaxation of a MIP4 / 61 Given a MIP(IP)mincTxAx=bx 0xi Z i Iitslinear relaxationis the LP obtained by dropping integrality constraints:(LP)mincTxAx=bx 0 Can we solveIPby solvingLP?
2 By rounding?Branch & Bound5 / 61 The optimal solution ofmaxx+y 2x+ 2y 1 8x+ 10y 13x, y 0x, y Zis(x, y) = (1,2), with objective3 The optimal solution of its LP relaxationis(x, y) = (4, ), with No direct way of getting from(4, )to(1,2)by rounding! Something more elaborate is needed:branch & boundBranch & Bound6 / 61yxy 0maxx+y(0,1)(1,2)x 0(4, ) 8x+ 10y 13 2x+ 2y 1 Branch & Bound7 / 61 Assumevariables are bounded , , have lower and upper bounds LetP0be the initial problem,LP(P0)be the LP relaxation ofP0 If in optimal solution ofLP(P0)all integer variables take integer valuesthen it is also an optimal solution toP0 Else Letxjbe integer variablewhose value jat optimal solution ofLP(P0)is such that j6 :=P0 xj j P2:=P0 xj j feasibleSols(P0) = feasibleSols(P1) feasibleSols(P2) Idea: solveP1, solveP2and then take the bestBranch & Bound8 / 61 Letxjbe integer variablewhose value jat optimal solution ofLP(P0)is such that j6 of the problemsP1.
3 =P0 xj j P2:=P0 xj j can besolved recursively We can build abinary tree of subproblemswhose leaves correspond topendingproblems still to be solved This procedure terminates as integer vars have finite bounds and,at each split, the domain ofxjbecomes strictly smaller IfLP(Pi)has optimal solution where integer variables take integer valuesthen solution is stored IfLP(Pi)is infeasible thenPican be discarded(pruned, fathomed)Example9 / 61min x y 2x+ 2y 1 8x+ 10y 13x, y 0x, y ZExample9 / 61min x y 2x+ 2y 1 8x+ 10y 13x, y 0x, y ZExample10 / 61 Min - x - ySubject To-2 x + 2 y >= 1-8 x + 10 y <= 13 End====================================================================CPLEX> optimizePrimal simplex - Optimal: Objective = - +00 Solution time = sec.
4 Iterations = 0 (0)Deterministic time = ticks ( ticks/sec)CPLEX> display solution variables xVariable Name Solution Valuex > display solution variables yVariable Name Solution Valuey / 61min x y 2x+ 2y 1 8x+ 10y 13x, y 0x, y Zy 4y 5 Example11 / 61min x y 2x+ 2y 1 8x+ 10y 13x, y 0x, y Zy 4y 5 Example12 / 61 Min - x - ySubject To-2 x + 2 y >= 1-8 x + 10 y <= 13 Boundsy >= 5 End===================================== ===============================CPLEX> optimizeBound infeasibility column x .Presolve time = sec. ( ticks)Presolve - time = time = ticks ( ticks/sec)Example13 / 61min x y 2x+ 2y 1 8x+ 10y 13x, y 0x, y Zy 4y 5 Example13 / 61min x y 2x+ 2y 1 8x+ 10y 13x, y 0x, y Zy 4y 5 Example14 / 61 Min - x - ySubject To-2 x + 2 y >= 1-8 x + 10 y <= 13 Boundsy <= 4 End====================================================================CPLEX> optimizeDual simplex - Optimal: Objective = - +00 Solution time = sec.
5 Iterations = 0 (0)Deterministic time = ticks ( ticks/sec)CPLEX> display solution variables xVariable Name Solution Valuex > display solution variables yVariable Name Solution Valuey / 61min x y 2x+ 2y 1 8x+ 10y 13x, y 0x, y Zy 4y 5x 4x 3 Example15 / 61min x y 2x+ 2y 1 8x+ 10y 13x, y 0x, y Zy 4y 5x 4x 3 Example16 / 61 Min - x - ySubject To-2 x + 2 y >= 1-8 x + 10 y <= 13 Boundsx >= 4y <= 4 End====================================================================CPLEX> optimizeRow c1 infeasible, all entries at implied time = sec. ( ticks)Presolve - time = time = ticks ( ticks/sec)Example17 / 61min x y 2x+ 2y 1 8x+ 10y 13x, y 0x, y Zy 4y 5x 4x 3 Example17 / 61min x y 2x+ 2y 1 8x+ 10y 13x, y 0x, y Zy 4y 5x 4x 3 Example18 / 61 Min - x - ySubject To-2 x + 2 y >= 1-8 x + 10 y <= 13 Boundsx <= 3y <= 4 End====================================================================CPLEX> optimizeDual simplex - Optimal: Objective = - +00 Solution time = sec.
6 Iterations = 0 (0)Deterministic time = ticks ( ticks/sec)CPLEX> display solution variables xVariable Name Solution Valuex > display solution variables yVariable Name Solution Valuey / 61min x y 2x+ 2y 1 8x+ 10y 13x, y 0x, y Zy 4y 5x 4x 3y 3y 4 Example19 / 61min x y 2x+ 2y 1 8x+ 10y 13x, y 0x, y Zy 4y 5x 4x 3y 3y 4 Example20 / 61 Min - x - ySubject To-2 x + 2 y >= 1-8 x + 10 y <= 13 Boundsx <= 3y = 4 End====================================================================CPLEX> optimizeBound infeasibility column x .Presolve time = sec. ( ticks)Presolve - time = time = ticks ( ticks/sec)Example21 / 61min x y 2x+ 2y 1 8x+ 10y 13x, y 0x, y Zy 4y 5x 4x 3y 3y 4 Example21 / 61min x y 2x+ 2y 1 8x+ 10y 13x, y 0x, y Zy 4y 5x 4x 3y 3y 4 Example22 / 61 Min - x - ySubject To-2 x + 2 y >= 1-8 x + 10 y <= 13 Boundsx <= 3y <= 3 End====================================================================CPLEX> optimizeDual simplex - Optimal: Objective = - +00 Solution time = sec.
7 Iterations = 0 (0)Deterministic time = ticks ( ticks/sec)CPLEX> display solution variables xVariable Name Solution Valuex > display solution variables yVariable Name Solution Valuey / 61min x y 2x+ 2y 1 8x+ 10y 13x, y 0x, y Zy 4y 5x 4x 3y 3y 4x 3x 2 Example23 / 61min x y 2x+ 2y 1 8x+ 10y 13x, y 0x, y Zy 4y 5x 4x 3y 3y 4x 3x 2 Example24 / 61 Min - x - ySubject To-2 x + 2 y >= 1-8 x + 10 y <= 13 Boundsx = 3y <= 3 End====================================================================CPLEX> optimizeBound infeasibility column y .Presolve time = sec. ( ticks)Presolve - time = time = ticks ( ticks/sec)Example25 / 61min x y 2x+ 2y 1 8x+ 10y 13x, y 0x, y Zy 4y 5x 4x 3y 3y 4x 3x 2 Example25 / 61min x y 2x+ 2y 1 8x+ 10y 13x, y 0x, y Zy 4y 5x 4x 3y 3y 4x 3x 2 Example26 / 61 Min - x - ySubject To-2 x + 2 y >= 1-8 x + 10 y <= 13 Boundsx <= 2y <= 3 End====================================================================CPLEX> optimizeDual simplex - Optimal: Objective = - +00 Solution time = sec.
8 Iterations = 0 (0)Deterministic time = ticks ( ticks/sec)CPLEX> display solution variables xVariable Name Solution Valuex > display solution variables yVariable Name Solution Valuey / 61min x y 2x+ 2y 1 8x+ 10y 13x, y 0x, y Zy 4y 5x 4x 3y 3y 4x 3x 2y 2y 3 Example27 / 61min x y 2x+ 2y 1 8x+ 10y 13x, y 0x, y Zy 4y 5x 4x 3y 3y 4x 3x 2y 2y 3 Example28 / 61 Min - x - ySubject To-2 x + 2 y >= 1-8 x + 10 y <= 13 Boundsx <= 2y = 3 End====================================================================CPLEX> optimizeBound infeasibility column x .Presolve time = sec. ( ticks)Presolve - time = time = ticks ( ticks/sec)Example29 / 61min x y 2x+ 2y 1 8x+ 10y 13x, y 0x, y Zy 4y 5x 4x 3y 3y 4x 3x 2y 2y 3 Example29 / 61min x y 2x+ 2y 1 8x+ 10y 13x, y 0x, y Zy 4y 5x 4x 3y 3y 4x 3x 2y 2y 3 Example30 / 61 Min - x - ySubject To-2 x + 2 y >= 1-8 x + 10 y <= 13 Boundsx <= 2y <= 2 End====================================================================CPLEX> optimizeDual simplex - Optimal: Objective = - +00 Solution time = sec.
9 Iterations = 0 (0)Deterministic time = ticks ( ticks/sec)CPLEX> display solution variables xVariable Name Solution Valuex > display solution variables yVariable Name Solution Valuey / 61min x y 2x+ 2y 1 8x+ 10y 13x, y 0x, y Zy 4y 5x 4x 3y 3y 4x 3x 2y 2y 3x 2x 1 Example31 / 61min x y 2x+ 2y 1 8x+ 10y 13x, y 0x, y Zy 4y 5x 4x 3y 3y 4x 3x 2y 2y 3x 2x 1 Example32 / 61 Min - x - ySubject To-2 x + 2 y >= 1-8 x + 10 y <= 13 Boundsx = 2y <= 2 End====================================================================CPLEX> optimizeBound infeasibility column y .Presolve time = sec. ( ticks)Presolve - time = time = ticks ( ticks/sec)Example33 / 61min x y 2x+ 2y 1 8x+ 10y 13x, y 0x, y Zy 4y 5x 4x 3y 3y 4x 3x 2y 2y 3x 2x 1 Example33 / 61min x y 2x+ 2y 1 8x+ 10y 13x, y 0x, y Zy 4y 5x 4x 3y 3y 4x 3x 2y 2y 3x 2x 1 Example34 / 61 Min - x - ySubject To-2 x + 2 y >= 1-8 x + 10 y <= 13 Boundsx <= 1y <= 2 End====================================================================CPLEX> optimizeDual simplex - Optimal: Objective = - +00 Solution time = sec.
10 Iterations = 0 (0)Deterministic time = ticks ( ticks/sec)CPLEX> display solution variables xVariable Name Solution Valuex > display solution variables yVariable Name Solution Valuey / 61min x y 2x+ 2y 1 8x+ 10y 13x, y 0x, y Zy 4y 5x 4x 3y 3y 4x 3x 2y 2y 3x 2x 1 Pruning in Branch & Bound36 / 61 We have already seen that if relaxation is infeasible,the problem can be pruned Now assume an (integral) solution has been previously found If solution has costZthen any pending problemPjwhose relaxation hasoptimal value Zcan be ignored, sincecost(Pj) cost(LP(Pj)) ZThe optimum will not be in any descendant ofPj! Thiscost-based pruningof the search tree has a huge impacton the efficiency of Branch & BoundBranch & Bound: Algorithm37 / 61S:={P0}/* set of pending problems */Z:= + /* best cost found so far */whileS6= doremovePfromSsolveLP(P)ifLP(P)is feasiblethen/* if unfeasiblePcan be pruned */let be optimal basic solution ofLP(P)if satisfies integrality constraintsthenifcost( )< Zthenstore ; updateZelseifcost(LP(P)) Zthen continue/*Pcan be pruned */letxjbe integer variable such that j6 ZS:=S {P xj j , P xj j }returnZHeuristics in Branch & Bound38 / 61 Possible choices in Branch & Bound Choice of thepending problem Depth-firstsearch Breadth-firstsearc