Mixed-Integer Linear Programming (MILP): Branch-And-Bound Search
Total Page:16
File Type:pdf, Size:1020Kb
Solving Discrete Optimization Problems Standard Mixed-Integer Linear Programming (MILP) Formulation: ∆ min z = cTx + dTy Mixed-Integer Linear Programming (MILP): x,y Branch-and-Bound Search ≤ s.t. Ax + Ey = b ≥ <[email protected]> Benoˆıt Chachuat n xmin ≤ x≤ xmax, y ∈ {0, 1} y McMaster University Department of Chemical Engineering We seek a rigorous solution ChE 4G03: Optimization in Chemical Engineering The concept of local derivative information (or gradient) does not exist for discrete variables! The basic numerical optimization paradigm (improving search) applies only when we know/assume the values of all integer variables We need a new approach for problems with integer variables! Benoˆıt Chachuat (McMaster University) MILP: Branch-and-Bound Search 4G03 1 / 23 Benoˆıt Chachuat (McMaster University) MILP: Branch-and-Bound Search 4G03 2 / 23 Solving Discrete Optimization Problems Solving Discrete Optimization Problems That discrete optimization models are more difficult to solve than Exponential Growth with Total Enumeration: continuous models may appear counter-intuitive For n binary variables, After all, a discrete model only has a finite number of choices for ◮ n = 10: decision variables! ◮ n = 20: Total Enumeration: ◮ n = 30: Solve a discrete optimization by trying all possible combinations and keep whichever is best 1 With no more than a few discrete variables, total enumeration is often the most effective solution method Class Exercise: Solve the following discrete optimization model by total enumeration: 2 But, exponential growth makes total enumeration impractical with Case Objective Case Objective max 7y1 +4y2 + 19y3 models having more than a handful of discrete decision variables y s.t. y1 + y2 ≤ 2 y2 + y3 ≤ 1 Back to the Drawing Board! y1, y2, y3 ∈{0, 1} Benoˆıt Chachuat (McMaster University) MILP: Branch-and-Bound Search 4G03 3 / 23 Benoˆıt Chachuat (McMaster University) MILP: Branch-and-Bound Search 4G03 4 / 23 Solving Discrete Optimization Problems Outline New Paradigm for Discrete Optimization Search Construct a sequence of related, simpler subproblems, the solutions of 1 Introduction which converges (finitely) to the original solution 2 Relaxations of Discrete Optimization Models LP Relaxations Use relaxations to define the subproblems ◮ E.g., relax the feasible region (LP relaxations) and/or the objective 3 Branch-and-Bound Search function (Lagrangian relaxations) Root Node The subproblems should be easier to solve than the original (since Terminating Partial Solutions many may have to be solved) Heuristics Each subproblem should yield a bound on the original optimal 4 Final Words solution value: ◮ Lower bound for a minimize problem ◮ Upper bound for a maximize problem For additional details, see Rardin (1998), Chapter 12 The number of subproblems solved should be much smaller than with the complete enumeration method Benoˆıt Chachuat (McMaster University) MILP: Branch-and-Bound Search 4G03 5 / 23 Benoˆıt Chachuat (McMaster University) MILP: Branch-and-Bound Search 4G03 6 / 23 Relaxations of Discrete Optimization Models Linear Programming Relaxations Constraint Relaxation LP Relaxations Model (R) is said to be a constraint relaxation of model (P) if: LP relaxations of a MILP model are formed by treating any discrete every feasible solution to (P) is also feasible in (R) variables as continuous, while retaining all other constraints: (P) and (R) have the same objective function yi ∈ {0, 1} =⇒ 0 ≤ yi ≤ 1 Original MILP Model: Relax. #1: Drop constraint Motivations: min 7x1 + x2 + 3y1 + 6y2 min 7x1 + x2 + 3y1 + 6y2 x,y x,y Bring all the power of LP to bear on analysis of discrete models s.t. + 10 + 2 + 100 s.t. + 10 + 2 + 100 x1 x2 y1 y2 ≥ x1 x2 y1 y2 ≥ By far the most used relaxation forms y1 + y2 ≤ 1 x1, x2 ≥ 0, y1, y2 ∈ {0, 1} feasible solutions x1, x2 ≥ 0, y1, y2 ∈ {0, 1} in relaxed model Properties: Relax. #2: Relax constraint RHS Relax. #3: Remove integrality feasible solutions in original model min 7x1 + x2 + 3y1 + 6y2 min 7x1 + x2 + 3y1 + 6y2 x,y x,y Are LP relaxations guaranteed optimum point to yield valid relaxations? s.t. x1 + 10x2 + 2y1 + y2 ≥ 50 s.t. x1 + 10x2 + 2y1 + y2 ≥ 100 y1 + y2 ≤ 1 y1 + y2 ≤ 1 ◮ x1, x2 ≥ 0, y1, y2 ∈ {0, 1} x1, x2 ≥ 0, 0 ≤ y1, y2 ≤ 1 Benoˆıt Chachuat (McMaster University) MILP: Branch-and-Bound Search 4G03 7 / 23 Benoˆıt Chachuat (McMaster University) MILP: Branch-and-Bound Search 4G03 8 / 23 Properties of LP Relaxations (cont’d) Properties of LP Relaxations (cont’d) Solution Bounds from LP Relaxations Proving Infeasibility with Relaxations The optimal value of an LP relaxation of a maximize MILP model If an LP relaxation is infeasible, so is the MILP model it relaxes yields an upper bound on the optimal value of that model The optimal value of an LP relaxation of a minimize MILP model Question: Can we conclude anything regarding the feasibility of the ILP yields a lower bound model if the LP relaxation has a feasible solution? Class Exercise: Consider the following ILP model: max y1 + y2 + y3 Class Exercise: Use LP relaxations to help establish infeasibility of the y following ILP models: s.t. y1 + y2 ≤ 1 y1 + y3 ≤ 1 min 8y1 +2y2 min y1 +2y2 y y y2 + y3 ≤ 1 y y y y s.t. 1 − 2 ≥ 2 s.t. 4 1 +2 2 ≥ 1 y1, y2, y3 ∈{0, 1} − y1 + y2 ≥−1 4y1 +4y2 ≤ 3 1 Formulate and solve an LP relaxation of the ILP model (by inspection) y1, y2, ∈{0, 1, 2,...} y1, y2, ∈{0, 1} 2 Solve the ILP model (by inspection) and compare the optimal values Benoˆıt Chachuat (McMaster University) MILP: Branch-and-Bound Search 4G03 9 / 23 Benoˆıt Chachuat (McMaster University) MILP: Branch-and-Bound Search 4G03 10 / 23 Properties of LP Relaxations (cont’d) Branch-and-Bound Search Branch-and-Bound algorithms combine partial enumeration strategy Optimal Solutions from Relaxations with relaxation techniques: If an optimal solution to an LP relaxation is feasible in the MILP model it Classes of solutions are formed and investigated to determine whether relaxes, the solution is optimal in that model too they can or cannot contain optimal solutions This search is conducted by analyzing associated relaxations Class Exercise: Solve LP relaxations for the following ILP models: Only promising classes are searched in further details max y1 + y2 + y3 y min 20y1 +8y2 +3y3 Partial Solutions and Completions s.t. y1 + y2 ≤ 1 y A partial solution has some discrete decision variables fixed, while y + y ≤ 1 s.t. y + y + y ≤ 1 1 3 1 2 3 other left free (denoted by #) y2 + y3 ≤ 1 y1, y2, y3 ∈{0, 1} The completions of a partial solution are the possible full solutions y , y , y ∈{0, 1} 1 2 3 agreeing with the partial solution on all fixed variables Is the relaxation optimum also optimal in the MILP model? Example: y = (1, #, 0, #) is a partial solution with y = 1 and y = 0, Heuristics: LP relaxations may produce optimal solutions that are easily 1 3 while y and y are free; its completions are (1, 0, 0, 0), (1, 1, 0, 0), “rounded” to good feasible solution for the corresponding MILP model 2 4 (1, 0, 0, 1), and (1, 1, 0, 1) Benoˆıt Chachuat (McMaster University) MILP: Branch-and-Bound Search 4G03 11 / 23 Benoˆıt Chachuat (McMaster University) MILP: Branch-and-Bound Search 4G03 12 / 23 Branch-and-Bound Tree Getting Started: The Root Node Partial solution with y = (#, #, ...) 0 all discrete variables free Root Node y = (#, #, ...) 0 y1 = 0 y1 = 1 B&B search begins at initial or root partial solution ∆ Partial solution with (0) , ,... y = (0, #, ...) 1 2 y = (1, #, ...) y = (# # ) with all discrete variables free 1 discrete variable fixed y y 2 = 0 2 = 1 min z =∆ cTx + dTy min z =∆ cTx + dTy Partial solution with x,y x,y y = (0, 0, #, ...) 3 4 y = (0, 1, #, ...) 2 discrete variables fixed ≤ LP ≤ s.t. Ax + Ey = b s.t. Ax + Ey = b yny = 0 ⇒ = Partial solution with ≥ ≥ y = (0, 0, ...) k relaxation all discrete variables fixed xmin ≤ x≤ xmax xmin ≤ x≤ xmax y ∈{0, 1}ny 0 ≤ y ≤ 1 Nodes of the B&B tree represent partial solution ◮ Numbers indicate the sequence in which nodes are investigated Solution of the LP relaxation at the root node provides: n ◮ 2 ny y i ny Total number of nodes is: 1+2+2 + · · · +2 = i=0 2 > 2 ! • A lower bound on the MILP (global) optimum for a minimize problem Edges of the B&B tree specify how variables are fixed:P branch part • An upper bound for a maximize problem Benoˆıt Chachuat (McMaster University) MILP: Branch-and-Bound Search 4G03 13 / 23 Benoˆıt Chachuat (McMaster University) MILP: Branch-and-Bound Search 4G03 14 / 23 Outcomes from LP Relaxation Solution at the Root Node Intermediate Nodes 1 No feasible solution Candidate Problems Action: Terminate by Infeasibility — The MILP problem is itself The candidate problem associated with a fixed, ∀i ∈ F (k) yi k infeasible partial solution to an MILP model is the free, otherwise restricted model obtained by fixing the 2 All relaxed binary variables are either 0 or 1 at the optimum discrete variables as in the partial solution Action: Terminate by Completion — We have found an optimum for the MILP problem (We are very lucky!) ∆ T T ∆ min z = c x + d y min z = cTx + dTy x,y 3 Some relaxed binary variables have fractional value at the optimum x,y ≤ Action: Branch — Choose one of the relaxed variables, e.g., y , and ≤ 1 Partial solution s.t. Ax + Ey = b create two new nodes: s.t. Ax + Ey = b =⇒ ≥ Partial solution with ≥ (k) ∆ y = (#, #, ...) 0 F = fixed set xmin ≤ x≤ xmax all discrete variables free xmin ≤ x≤ xmax F (k) ny fixed, ∀i ∈ y1 = 0 y1 = 1 y ∈{0, 1} yi ∈{0, 1}, otherwise Partial solution with y = (0, #, ...) 1 2 y = (1, #, ...) 1 discrete variable