Presentation is loading. Please wait.

Presentation is loading. Please wait.

EE 553 Integer Programming J. McCalley 1. Solving IPs Minimize f(x 1, x 2, x 3 ) Subject to h(x 1, x 2, x 3 )=c g(x 1, x 2, x 3 )≤b x 1, x 2, x 3 are.

Similar presentations


Presentation on theme: "EE 553 Integer Programming J. McCalley 1. Solving IPs Minimize f(x 1, x 2, x 3 ) Subject to h(x 1, x 2, x 3 )=c g(x 1, x 2, x 3 )≤b x 1, x 2, x 3 are."— Presentation transcript:

1 EE 553 Integer Programming J. McCalley 1

2 Solving IPs Minimize f(x 1, x 2, x 3 ) Subject to h(x 1, x 2, x 3 )=c g(x 1, x 2, x 3 )≤b x 1, x 2, x 3 are binary (1 or 0) 2 How to solve it? 1.Check every possible solution (exhaustive enumeration),  A huge computational burden. 2. Solve it as an LP and then round to closest binary value.  Under such an approximation, optimality cannot guaranteed. Two immediate ideas:

3 Solving IPs: Tree search methods 3 Tree-search methods conceptualize the problem as a huge tree of solutions, and then they try to do some smart things to avoid searching the entire tree. Most popular IP (and MIP) solver today is a tree-search method called branch and bound. CPLEX uses this method, in combination with cutting planes. We will study the branch and bound method.

4 Solving IPs: Branch & Bound 4

5 5 Definitions Predecessor problem Successor problem Problem P j is predecessor to Problem P k and Problem P k is successor to Problem P j if: they are identical with the exception that one continuous-valued variable in P j is constrained to be integer in P k. PjPj PkPk

6 Example 6 Solution (as an LP) using CPLEX yields “Zeta” Pose a problem P 1 to be exactly like P 0 except that we will constrain x 1 ≤1. What do you expect the value of x 1 to be in the optimal solution?  Because the solution without the constraint x 1 ≤1 wanted of x 1, we can be sure that the solution with the constraint x 1 ≤1 will want as much of x 1 as it can get, i.e., it will want x 1 =1. Solution (as an LP) using CPLEX yields It worked: x 1 did in fact become integer. In fact, x 2 became integer as well, but this is by coincidence.

7 Example 7 Is the P1 solution we obtained, which by chance is a feasible solution to IP1, also optimal to IP1? Let’s consider the same problem but with (x 1,x 2 ) constrained to be integers. x1<1x1<1 P 1 has to be as good as or better than its successors because these will be more heavily constrained, so we need not look at P 1 successors. But what about P 2 ? What is P 2 ?

8 Example 8 x1<1x1<1 P 2 is the P 0 problem with x 1 >2. It is the remaining part of the space we need to search. x1>2x1>2 Use CPLEX to solve P 2. (see solution on the tree). Observe P 2 is infeasible! (infeasible to the IP, that is, because x 2 is non-integer). So can we draw any useful conclusion from this observation? YES! But why? 1. The P 2 solution, , is better than our best feasible solution so far, 65.0 (65.0 establishes a lower bound  solution is no less than 65). 2. Although P 2 is infeasible, we can add constraints and find feasible solutions in successor problems. 3. We are not sure any of those successor problems will be “better than our best” (of 65), but because >65, we know it is worth trying.

9 Example 9 x1<1x1<1 x1>2x1>2 Yes, Why? (In more detail…) Compare the objective function value of P 2, , with the objective function value of P 1, 65. Since we are maximizing, the objective function of P 2 is better. But the P 2 solution is not feasible. But we can constrain x 2 so that we get a feasible solution. Whether that feasible solution will have better objective function value we do not know. What we do know is, because the objective function value of P 2 ( ) is better than the objective function value of P 1 (65), it is worthwhile to check it. Although the objective function value of successor problems to P 2 can only get worse (lower), they might be better than P 1, and if we can find a successor (or a successor’s successor,…) that is feasible, it might be better than our best current feasible solution, which is P 1.

10 Example 10 x1<1x1<1 x1>2x1>2 Question: What if the P 2 solution would have been 64? Would you have searched its successor nodes? NO! Why not? Because successor nodes, even if feasible, would necessarily be more constrained than P 2 and therefore no better than its solution. Since we already have a feasible solution of 65, and P 2 successors could be no better than 64, there is no use searching them. Again, the value of 65 establishes a lower bound on the problem solution.

11 Example 11 x1<1x1<1 x1>2x1>2 But because P 2 solution is better than our current best feasible solution, we should pursue P 2 successor problems. Our choices are x 2 3. Let’s try x 2 <2, using P 3. So what constraint should we add to P 2 ? x2<2x2<2x2>3x2>3 The P 3 solution is not feasible. Should we branch further? YES! 1. The P 3 solution, 68.2, is better than our best feasible solution so far, Although P 2 is infeasible, we can add constraints and find feasible solutions in successor problems. 3. We are not sure any of those successor problems will be “better than our best” (of 65), but because 68.2>65, we know it is worth trying.

12 Example 12 x1<1x1<1 x1>2x1>2 Our choices are x 1 3. Let’s try x 1 <2, using P 4. So what constraint should we add to P 3 ? x2<2x2<2 x2>3x2>3 Should we branch further? No! Why? The P 4 solution is feasible! And so we will not find another better feasible solution that is successor to P 4. The P 4 objective is 58, worse than our best (65). So P 4 and any further successor nodes are of no interest. x1<2x1<2 x1>3x1>3 Two reasons, either one of which is enough:

13 Example 13 x1<1x1<1 x1>2x1>2 We impose x 1 >3, using P 5. Now what? We have to decide on going back to P 3 or P 2. Choose P 3. x2<2x2<2 x2>3x2>3 Should we branch further? Yes! Why? x1<2x1<2 x1>3x1>3 1. The P 5 solution, , is better than our best feasible solution so far, Although P 5 is infeasible, we can add constraints and find feasible solutions in successor problems. 3. We are not sure any of those successor problems will be “better than our best” (of 65), but because >65, we know it is worth trying.

14 Example 14 x1<1x1<1 x1>2x1>2 x2<2x2<2 x2>3x2>3 Should we branch further? Yes! Why? x1<2x1<2 x1>3x1>3 1. The P 6 solution, 68.1, is better than our best feasible solution so far, Although P 6 is infeasible, we can add constraints and find feasible solutions in successor problems. 3. We are not sure any of those successor problems will be “better than our best” (of 65), but because 68.1>65, we know it is worth trying. Our choices are x 2 2. Let’s try x 2 <1, using P 6. So what constraint should we add to P 5 ? x2<1x2<1 x2>2x2>2

15 Example 15 x1<1x1<1 x1>2x1>2 x2<2x2<2 x2>3x2>3 Should we branch further? No! Why? x1<2x1<2 x1>3x1>3 Our choices are x 1 4. Let’s try x 1 <3, using P 7. So what constraint should we add to P 6 ? x2<1x2<1 x2>2x2>2 x1<3x1<3 x1>4x1>4 The P 7 solution is feasible! We will not find another better successor to P 7 P 7 objective is 63, worse than our best (65), so P 7 ’s successor nodes are of no interest. Two reasons, either one of which is enough: Now let’s try here.

16 Example 16 x1<1x1<1 x1>2x1>2 x2<2x2<2 x2>3x2>3 Should we branch further? No! Why? x1<2x1<2 x1>3x1>3 So now add the x 1 >4 constraint to P 6, to obtain P 8. x2<1x2<1 x2>2x2>2 x1<3x1<3 x1>4x1>4 The P 8 solution is feasible! We will not find another better successor to P 8 Note the P 8 objective is 68, which is better than our best (65)! So P 8 solution becomes our new best, i.e., it becomes our new lower bound on the solution. That is, the objective at the solution must be at least 68.

17 Example 17 x1<1x1<1 x1>2x1>2 x2<2x2<2 x2>3x2>3 x1<2x1<2 x1>3x1>3 x2<1x2<1 x2>2x2>2 x1<3x1<3 x1>4x1>4 Question: Do we need to check the other branch to P 5 and P 2 ? Answer: Yes! Why? Because the objective value for P 5 and P 2 at greater than our bound of 68, so a successor node could be better than 68 as well.

18 Example 18 x1<1x1<1 x1>2x1>2 x2<2x2<2 x2>3x2>3 x1<2x1<2 x1>3x1>3 x2<1x2<1 x2>2x2>2 x1<3x1<3 x1>4x1>4 P 9 : infeasible to the LP P 10 : infeasible to the LP

19 Central ideas to branch & bound 19 Branch, force integrality on one variable by adding a constraint to an LP-relaxation: Use LP-relaxation to decide how to branch. Each branch adds a constraint to previous LP-relaxation to enforce integrality on one variable that was not integer in the predecessor solution. Bound, continue branching only if the objective function value of the current solution is better than the objective function value of the best feasible solution obtained so far: Maintain the best feasible solution obtained so far as a bound on tree-paths that should still be searched. If any tree node has an objective value less optimal than the identified bound, no further searching from that node is necessary, since adding constraints can never improve an objective. If any tree node has an objective value more optimal than the identified bound, then additional searching from that node is necessary.

20 Using CPLEX to solve MIPS directly 20 maximize 17 x x2 subject to 10 x1 + 7 x2 <= 40 x1 + x2 <= 5 Bounds 0<= x1 <= <= x2 <= 1000 Integer x1 x2 end 1. Created CPLEX source within a text file called mip.lp as follows: 2. Used WinSCP to port the file to server (linux-7.ece.iastate.edu). 4. Called cplex. 5. Typed read mip.lp to read in problem statement. 6. Typed mipopt to call the MIP- solver. The result was as follows…

21 Using CPLEX to solve MIPS directly 21 maximize 17 x x2 subject to 10 x1 + 7 x2 <= 40 x1 + x2 <= 5 Bounds 0<= x1 <= <= x2 <= 1000 Integer x1 x2 end 1. Created CPLEX source within a text file called mip.lp as follows: 7. Typed display solution variables - The result was: Variable Name Solution Value x All other variables in the range 1-2 are 0.

22 Depth vs breadth 22 x1<1x1<1 x1>2x1>2 Recall this point in our procedure: The question can be posed like this: Depth: Do we continue from P 3, requiring x 1 ≤2, for example? or Breadth: Do we go back to P 2 to examine its other branch, x 2 ≥3? x2<2x2<2x2>3x2>3 For high-dimensional IPs, it is usually the case that feasible solutions are more likely to occur deep in a tree than at nodes near the root. Finding multiple feasible solutions early in B&B is important because it tightens the bound (in the above example, it increases the bound), and therefore enables termination of branching at more nodes (and therefore decreases computation). One can see that this will be the case if we consider the bound before we find a feasible solution: the bound is infinite! (-∞ for maximization problems and +∞ for minimization problems).

23 Branching variable selection 23 For high-dimensional IPs, is there any benefit for selecting one non-integer variable over another when branching? In our problem, except initially, there was never a decision to make in this way because there was never more than one non- integer variable. x1<1x1<1 x1>2x1>2 x2<2x2<2 x2>3x2>3 x1<2x1<2 x1>3x1>3 x2<1x2<1 x2>2x2>2 x1<3x1<3 x1>4x1>4 P 9 : infeasible P 10 : infeasible A rich research question. For specific problems, you can pre-specify an ordering of the variables required to be integer. Good orderings become apparent based on experience with running the algorithm or based on physical understanding, e.g., largest unit.

24 Mixed integer problems 24 Our example was a pure integer problem. What about a MIP? x1<1x1<1 x1>2x1>2 x2<2x2<2 x2>3x2>3 x1<2x1<2 x1>3x1>3 x2<1x2<1 x2>2x2>2 x1<3x1<3 x1>4x1>4 P 9 : infeasible P 10 : infeasible The solution to IP 2 is obtained as soon as we solve P1 and P2. Conclusion: We can easily solve MIP within our LP-relaxation branch and bound scheme by simply allowing the non-integer variables to remain relaxed.


Download ppt "EE 553 Integer Programming J. McCalley 1. Solving IPs Minimize f(x 1, x 2, x 3 ) Subject to h(x 1, x 2, x 3 )=c g(x 1, x 2, x 3 )≤b x 1, x 2, x 3 are."

Similar presentations


Ads by Google