8 Branch and Bound 8.1 Divide and Conquer Suppose that we would like to solve the problem ! " z = max cT x : x ∈ S . If the above problem is hard to solve, we might try to break it into smaller problems which are easier to solve. # $ Observation 8.1 If S = S1 ∪ · · · ∪ Sk and zi = max cT x : x ∈ Si for i = 1, . . . , k then # i $ z = max z : i = 1, . . . , k . Although Observation 8.1 is (almost) trivial, it is the key to branch and bound methods which turn out to be effective for many integer programming problems. The recursive decomposition of S into smaller problems can be represented by an enumeration tree. Suppose that S ⊆ B3 . We first divide S into S0 and S1 , where S0 = {x ∈ S : x1 = 0} S1 = {x ∈ S : x1 = 1} The sets S0 and S1 will be recursively divided into smaller sets as shown in the enumeration tree in Figure 8.1. As a second example consider the tours of a TSP on four cities. Let S denote the set of all tours. We first divide S into three pieces, S12 , S13 and S14 , where S1i ⊂ S is the set of all tours which from city 1 go directly to city i. Set S1i in turn is divided into two pieces S1i,ij , j %= 1, i, where S1i,ij is the set of all tours in Si1 which leave city i for city j. The recursive division is depicted in the enumeration tree in Figure 8.2. The leaves of the tree correspond to the (4 − 1)! = 3! = 6 possible permutations of {1, . . . , 4} which have 1 at the first place. 8.2 Pruning Enumeration Trees It is clear that a complete enumeration soon becomes hopeless even for problems of medium size. For instance, in the TSP the complete enumeration tree would have (n − 1)! 100 Branch and Bound S x1 = 0 x1 = 1 S0 x3 = 0 S000 S1 x2 = 0 x2 = 1 x2 = 0 x2 = 1 S00 S01 S10 S11 x3 = 1 x3 = 0 S001 S010 x3 = 1 x3 = 0 S011 S100 x3 = 1 x3 = 0 S101 S110 x3 = 1 S111 Figure 8.1: Enumeration tree for a set S ⊆ B3 . S S12 S12,23 S13 S12,24 S13,32 S14 S13,34 S14,42 S14,43 Figure 8.2: Enumeration tree for the TSP on four cities. File: –sourcefile– Revision: –revision– Date: 2013/12/11 –time–GMT 8.2 Pruning Enumeration Trees 101 leaves and thus for n = 60 would be larger than the estimated number of atoms in the universe1 . The key to efficient algorithms is to “cut off useless parts” of an enumeration tree. This is where bounds (cf. Chapter 6) come in. The overall scheme obtained is also referred to as implicit enumeration, since most of the time not all of the enumeration tree is completely unfolded. ! " Observation 8.2 Let S = S1 ∪ · · · ∪ Sk and zi = max cT x : x ∈ Si for i = 1, . . . , k then ! i " z = max z : i = 1, . . . , k . Suppose that we are given zi and z̄i for i = 1, . . . , k with zi ! zi ! z̄i for i = 1, . . . , k. ! " Then for z = max cT x : x ∈ S it is true that: $ # $ # max zi : i = 1, . . . , k ! z ! max z̄i : i = 1, . . . , k The above observation enables us to deduce rules how to prune the enumeration tree. i i Observation 8.3 (Pruning by optimality) ! TIf z = z̄ for " some i, then the optimal solution i value for the ith subproblem z = max c x : x ∈ Si is known and there is no need to subdivide Si into smaller pieces. As an example consider the situation depicted in Figure 8.3. The set S is divided into S1 and S2 with the upper and lower bounds as shown. S z̄1 = 20 z1 = 20 S1 → z̄ = 30 z = 10 S2 z̄2 = 25 z2 = 15 Figure 8.3: Pruning by optimality. S S1 z̄ = 25 z = 20 S2 z̄2 = 25 z2 = 15 Since z1 = z̄1 , there is no need to further explore the branch rooted at S1 . So, this branch can be pruned by optimality. Moreover, Observation 8.2 allows us to get new lower and upper bounds for z as shown in the figure. i j Observation 8.4 (Pruning by bound) ! T If z̄ < z" for some i $= j, then the optimal solution i for the ith subproblem z = max c x : x ∈ Si can never be an optimal solution of the whole problem. Thus, there is no need to subdivide Si into smaller pieces. Consider the example in Figure 8.4. Since z̄1 = 20 < 21 = z2 , we can conclude that the branch rooted at S1 does not contain an optimal solution: any solution in this branch has objective function value at most 20, whereas the branch rooted at S2 contains solutions of value at least 21. Again, we can stop to explore the branch rooted at S1 . We list one more generic reason which makes the exploration of a branch unnecessary. Observation 8.5 (Pruning by infeasibility) If Si = ∅, then there is no need to subdivide Si into smaller pieces, either. The next section will make clear how the case of infeasibility can occur in a branch and bound system. We close this section by showing an example where no pruning is possible. File: –sourcefile– Revision: –revision– Date: 2013/12/11 –time–GMT 102 Branch and Bound S z̄1 = 20 z1 = 15 S1 z̄1 = 20 z1 = 15 S1 z = 10 S2 S → z̄ = 30 z̄2 = 25 z2 = 21 Figure 8.4: Pruning by bound. z = 10 z̄1 = 20 z1 = 15 z2 = 17 Figure 8.5: No pruning possible. z = 21 S2 S z̄2 = 25 z̄ = 25 S1 → z̄ = 30 S2 S z̄2 = 25 z2 = 21 z̄ = 25 z = 17 S1 S2 z̄2 = 25 z2 = 17 Consider the partial enumeration tree in Figure 8.5, where again we have divided the set S into the sets S1 and S2 with the bounds as shown. Although the lower and upper bounds for the subproblems allow us to get better bounds for the whole problem, we still have to explore both subtrees. 8.3 LP-Based Branch and Bound: An Example The most common way to solve integer programs is to use an implicit enumeration scheme based on Linear Programming. Upper bounds are provided by LP-relaxations and branching is done by adding new constraints. We illustrate this procedure for a small example. Figure 8.6 shows the evolution of the corresponding branch-and-bound-tree. Consider the integer program z = max 4x1 − x2 (8.1a) 3x1 − 2x2 + x3 = 14 x2 + x4 = 3 (8.1b) (8.1c) 2x1 − 2x2 + x5 = 3 (8.1d) x∈ Z5+ (8.1e) Bounding The first step is to get upper and lower bounds for the optimal value z. An upper bound is obtained by solving the LP-relaxation of (8.1). This LP has the optimal solution x̃ = (4.5, 3, 6.5, 0, 0). Hence, we get the upper bound z̄ = 15. Since we do not have any feasible solution yet, by convention we use z = −∞ as a lower bound. Branching In the current situation (see Figure 8.6(a)) we have z < z̄, so we have to branch, that is, we have to split the feasible region S. A common way to achieve this is to take an integer variable xj that is basic but not integral and set: 1 The " # S1 = S ∩ x : xj ! $x̃j % " # S2 = S ∩ x : xj " &x̃j ' estimated number of atoms in the universe is 1080 . File: –sourcefile– Revision: –revision– Date: 2013/12/11 –time–GMT 8.3 LP-Based Branch and Bound: An Example 103 z̄ = 15 S S z = −∞ z̄ = 15 z = −∞ x1 ! 4 x1 " 5 S1 (a) Initial tree S2 (b) Node S2 is pruned by infeasibility. S S z̄ = 13.5 z̄1 = 13.5 z1 = −∞ x1 ! 4 z = −∞ x1 ! 4 z̄1 = 13.5 x1 " 5 S1 S2 Pruned by infeasibility z1 = −∞ Pruned by infeasibility (c) After the LP-relaxation of S2 is solved, we get a new upper bound. z = −∞ x1 " 5 S1 x2 ! 2 z̄ = 13.5 S2 Pruned by infeasibility x2 " 3 S11 S12 (d) Branching on variable x2 leads to two new subproblems. S x1 ! 4 z̄1 = 13.5 z1 = 13 x2 ! 2 S11 z̄ = 13.5 S z = 13 x1 " 5 S1 S2 Pruned by infeasibility x2 " 3 S12 z̄12 = 13 Pruned by optimality z12 = 13 (e) Problem S12 has an integral optimal solution, so we can prune it by optimality. This also gives the first finite lower bound. x1 ! 4 z̄1 = 13.5 z1 = 13 x2 ! 2 z̄11 = 12 Pruned by bound z11 = −∞ S11 z̄ = 13.5 z = 13 x1 " 5 S1 S2 Pruned by infeasibility x2 " 3 S12 z̄12 = 13 Pruned by optimality z12 = 13 (f) Problem S11 can be pruned by bound, since z̄11 = 12 < 13 = z. Figure 8.6: Evolution of the branch-and-bound-tree for the example. The active nodes are shown in white. File: –sourcefile– Revision: –revision– Date: 2013/12/11 –time–GMT 104 Branch and Bound Clearly, S = S1 ∪ S2 and S1 ∩ S2 = ∅. Observe that due to the above choice of branching, the current optimal basic solution x̃ is not feasible for either subproblem. ! " If there is no degeneracy (i.e., multiple optimal LP solutions), then we get max z̄1 , z̄2 < z̄, which means that our upper bound decreases (improves). In the concrete example we choose variable x1 where x̃1 = 4.5 and set S1 = S ∩ {x : x1 ! 4} and S2 = S ∩ {x : x1 " 5}. Choosing an active node The list of active problems (nodes) to be examined is now S1 , S2 . Suppose we choose S2 to be explored. Again, the first step is to obtain an upper bound by solving the LP-relaxation: z̄2 = max 4x1 − x2 (8.2a) 3x1 − 2x2 + x3 = 14 x2 + x4 = 3 (8.2b) (8.2c) 2x1 − 2x2 + x5 = 3 x1 " 5 (8.2d) (8.2e) x"0 (8.2f) It turns out that (8.2) is infeasible, so S2 can be pruned by infeasibility (see Figure 8.6(b)). Choosing an active node The only active node at the moment is S1 . So, we choose S1 to be explored. We obtain an upper bound z̄1 by solving the LP-relaxation z̄1 = max 4x1 − x2 3x1 − 2x2 + x3 = 14 x2 + x4 = 3 2x1 − 2x2 + x5 = 3 x1 ! 4 x " 0. (8.3a) (8.3b) (8.3c) (8.3d) (8.3e) (8.3f) An optimal solution for (8.3) is x̃2 = (4, 2.5, 7, 4, 0) with objective function value 13.5. This allows us to update our bounds as shown in Figure 8.6(c). This time we choose to branch on variable x2 , since x̃22 = 2.5. The two subproblems are defined on the sets S11 = S1 ∩ {x : x2 ! 2} and S12 = S1 ∩ {x : x2 " 3}, see Figure 8.6(d). Choosing an active node The list of active nodes is S11 and S12 . We choose S12 and solve the LP-relaxation z̄12 = max 4x1 − x2 (8.4a) 3x1 − 2x2 + x3 = 14 x2 + x4 = 3 (8.4b) (8.4c) 2x1 − 2x2 + x5 = 3 x1 ! 4 x2 " 3 (8.4d) (8.4e) (8.4f) x " 0. (8.4g) An optimal solution of (8.4) is x̃12 = (4, 3, 8, 1, 0) with objective function value 13. As the solution is integer, we can prune S12 by optimality. Moreover, we can also update our bounds as shown in Figure 8.6(e). File: –sourcefile– Revision: –revision– Date: 2013/12/11 –time–GMT 8.4 Techniques for LP-based Branch and Bound 105 Choosing an active node At the moment we only have one active node: S11 . The corresponding LP-relaxation is z̄11 = max 4x1 − x2 (8.5a) 3x1 − 2x2 + x3 = 14 x2 + x4 = 3 (8.5b) (8.5c) 2x1 − 2x2 + x5 = 3 x1 ! 4 x2 ! 2 (8.5d) (8.5e) (8.5f) x " 0, (8.5g) which has x̃11 = (3.5, 2, 7.5, 1, 0) as an optimal solution. Hence, z̄11 = 12 which is strictly smaller than z = 13. This means that S11 can be pruned by bound. 8.4 Techniques for LP-based Branch and Bound The previous section contained an example for an execution of an LP-based branch and bound algorithm. While the basic outline of such an algorithm should be clear, there are a few issues that need to be taken into account in order to obtain the best possible efficiency. 8.4.1 Reoptimization Consider the situation in the example from the previous section when we wanted to explore node S1 . We had already solved the initial LP for S. The only difference between LP(S) and LP(S1 ) is the presence of the constraint x1 ! 4 in LP(S1 ). How can we solve LP(S1 ) without starting from scratch? ! " The problem LP(S) is of the form max cT x : Ax = b, x " 0 . An optimal basis for this LP is B = {x1 , x2 , x3 } with solution x∗B = (4.5, 3, 6.5) and x∗N = (0, 0). We can parametrize any solution x = (xB , xN ) for LP(S) by the nonbasic variables: −1 ∗ −1 xB := A−1 B b − AB AN xN = xB − AB AN xN −1 T T −1 T Let ĀN := A−1 B AN , c̄N := cB AB AN − cN and b̄ := AB b. Multiplying the constraints −1 Ax = b by AB gives the optimal basis representation of the LP: max cTB x∗B − c̄TN xN xB + ĀN xN = b̄ x"0 (8.6a) (8.6b) (8.6c) Recall that a basis B is called dual feasible, if c̄N " 0. The optimal primal basis is also dual feasible. We refer to [?, ?] for details on Linear Programming. In the branch and bound scheme, we add a new constraint xi ! t (or xi " t) for some basic variable xi ∈ B. Let us make this constraint an equality constraint by adding a slack variable s " 0. The new constraints are xi + s = t, s " 0. By (8.6) we can express xi in terms of the nonbasic variables: xi = (b̄ − ĀN xN )i . Hence xi + s = t becomes (−ĀN xN )i + s = t − b̄i . File: –sourcefile– Revision: –revision– Date: 2013/12/11 –time–GMT 106 Branch and Bound Adding this constraint to (8.6) gives us the following new LP that we must solve: max cTB x∗B − c̄TN xN (8.7a) xB + ĀN xN = b̄ (8.7b) (−ĀN xN )i + s = t − b̄i x ! 0, s ! 0 (8.7c) (8.7d) The set B ∪ {s} forms a dual feasible basis for (8.7), so we can start to solve (8.7) by the dual Simplex method starting with the situation as given. Let us illustrate the method for the concrete sitation of our example. We have 3 −2 1 1 0 AB = 0 2 −2 0 0 1 1/2 0 1 0 A−1 B = 1 −1 −3/2 and thus (8.6) amounts to max 15 − 3x4 − 2x5 x1 x2 x3 +x4 +x4 −x4 + 12 x5 − 23 x5 = = = 9 2 3 13 2 x1 , x2 , x3 , x4 , x5 ! 0 If we add a slack variable s, then the new constraint x1 " 4 becomes x1 + s = 4, s ! 0. Since x1 = 92 − x4 − 12 x5 , we can rewrite this constraint in terms of the nonbasic variables as: 1 1 −x4 − x5 + s = − . (8.8) 2 2 This gives us the dual feasible representation of LP(S1 ): max 15 − 3x4 − 2x5 x1 x2 x3 +x4 +x4 −x4 −x4 + 12 x5 − 32 x5 − 12 x5 = = = +s = 9 2 3 13 2 − 21 x1 , x2 , x3 , x4 , x5 , s ! 0 We can now do dual Simplex pivots to find the optimal solution of LP(S1 ). 8.4.2 Other Issues Storing the tree In practice we do not need to store the whole branch and bound tree. It suffices to store the active nodes. Bounding Upper bounds are obtained by means of the LP-relaxations. Cutting-planes (see the following chapter) can be used to strengthen bounds. Lower bounds can be obtained by means of heuristics and approximation algorithms. File: –sourcefile– Revision: –revision– Date: 2013/12/11 –time–GMT 8.4 Techniques for LP-based Branch and Bound Branching In our example we branched on a variable that was fractional in the optimal solution for the LP-relaxation. In general, there will be more than one such variable. A choice that has proved to be efficient in practice is to branch on !the most fractional " variable, that is, to choose a variable which maximizes maxj min fj , 1 − fj , where fj = xj − !xj ". There are other rules based on estimating the cost of a variable to become integer. We refer to [?] for more details. Choosing an active node In our example we just chose an arbitrary active node to be explored. In practice there are two antagonistic arguments how to choose an active node: • The tree can only be pruned significantly if there is a good primal feasible solution available which gives a good lower bound. This suggests to apply a depth-first search strategy. Doing so, in each step a single new constraint is added and we can reoptimize easily as shown in Section 8.4.1. • On the other hand, one would like to minimize the total number of nodes evaluated in the tree. This suggests to choose an active node with the best upper bound. Such a strategy is known as best-first search. In practice, one usually employs a mixture of depth-first search and best-first search. After an initial depth-first search which leads to a feasible solution one switches to a combined best-first and depth-first strategy. Preprocessing An important technique for obtaining efficient algorithms is to use preprocessing which includes • tightening of bounds (e.g. by cutting-planes, see the following chapter) • removing of redundant variables • variable fixing We demonstrate preprocessing techniques for a small example. Consider the LP max 2x1 + x2 − x3 5x1 − 2x2 + 8x3 ! 15 8x1 + 3x2 − x3 " 9 x1 + x2 + x3 ! 6 0 ! x1 ! 3 0 ! x2 ! 1 1 ! x3 Tightening of constraints Suppose we take the first constraint and isolate variable x1 . Then we get 5x1 ! 15 + 2x2 − 8x3 ! 15 + 2 · 1 − 8 · 1 = 9, where we have used the bounds on the variables x2 and x3 . This gives us the bound 9 x1 ! . 5 File: –sourcefile– Revision: –revision– Date: 2013/12/11 –time–GMT 107 108 Branch and Bound Similarly, taking the first constraint and isolating variable x3 results in: 8x3 ! 15 + 2x2 − 5x1 ! 15 + 2 · 1 − 5 · 0 = 17. Our new bound for x3 is: x3 ! 17 . 8 By similar operations we get the new bound x1 " 7 8 and now using all the new bounds for x3 in the first inequality gives: x3 ! 101 . 64 Plugging the new bounds into the third constraint gives: x1 + x2 + x3 ! 101 9 +1+ < 6. 5 64 So, the third constraint is superfluous and can be dropped. Our LP has reduced to the following problem: max 2x1 + x2 − x3 5x1 − 2x2 + 8x3 ! 15 8x1 + 3x2 − x3 " 9 7 9 ! x1 ! 8 5 0 ! x2 ! 1 101 1 ! x3 ! 64 Variable Fixing Consider variable x2 . Increasing variable x2 makes all constraints less tight. Since x2 has a positive coefficient in the objective function it will be as large as possible in an optimal solution, that is, it will be equal to its upper bound of 1: x2 = 1. The same conclusion could be obtained by considering the LP dual. One can see that the dual variable corresponding to the constraint x2 ! 1 must be positive in order to achieve feasibility. By complementary slackness this means that x2 = 1 in any optimal solution. Decreasing the value of x3 makes all constraints less tight, too. The coefficient of x3 in the objective is negative, so x3 can be set to its lower bound. After all the preprocessing, our initial problem has reduced to the following simple LP: max 2x1 7 9 ! x1 ! 8 5 We formalize the ideas from our example above: File: –sourcefile– Revision: –revision– Date: 2013/12/11 –time–GMT 8.4 Techniques for LP-based Branch and Bound 109 Observation 8.6 Consider the set n $ aj xj ! b, lj ! xj ! uj , for j = 1, . . . , n . S = x : a0 x0 + j=1 The following statements hold: Bounds on variables If a0 > 0, then and, if a0 < 0, then x0 ! b − x0 " b − Redundancy The constraint a0 x0 + $ $ aj lj − j:aj >0 j:aj <0 $ $ aj lj − j:aj <0 j:aj >0 (n $ j=1 aj xj aj uj + j:aj >0 aj uj /a0 . aj uj /a0 . ! b is redundant, if $ aj lj ! b. $ aj uj > b. j:aj <0 Infeasibility The set S is empty, if $ aj lj + j:aj >0 j:aj <0 ) * Variable Fixing For a maximization problem of the form max cT x : Ax ! b, l ! x ! u , if aij " 0 for all i = 1, . . . , m and cj < 0, then xj = lj in an optimal solution. Conversely, if aij ! 0 for all i = 1, . . . , m and cj > 0, then xj = uj in an optimal solution. For integer programming problems, the preprocessing can go further. If xj ∈ Z and the bounds lj ! xj ! uj are not integer, then we can tighten them to "lj # ! xj ! $uj %. We will explore this fact in greater depth in the following chapter on cutting-planes. File: –sourcefile– Revision: –revision– Date: 2013/12/11 –time–GMT
© Copyright 2025 Paperzz