Sei sulla pagina 1di 15

Method Branch and bound

TABLE OF CONTENTS
1. Introduction.....................................................................3
2. Method.............................................................................3
3. Exercises..........................................................................7

1. Introduction
Branch and bound is an algorithm to find optimal solutions to various
optimization problems, especially in combinatorial optimization. It has two
strategies, branch, enumeration of solutions and bound, "prune, probing.
A. H. Land and A. G. Doig proposed the method in 1960 for discrete
programming. It is used for various NP-complete problems such as traveling
salesman problem and the knapsack problem.

2. Method
Method strategy may be defined by:

Partition the problem into sub problems;

Represent the sub problems as nodes of a tree enumeration;

Iterate through nodes of the tree, but if a branch is not promising,


prune it without skimming through it.

Thus, it is necessary to generate all solutions (easier to obtain) and test,


which has the optimal value for objective function, in other words,
minimizing or maximizing the objective function.
To exemplify: the traveling salesman problem

The circuits are represented by n vertices


3

The nodes of the tree represent the vertices

The branches from a node to another the rough edges

However, enumerate the complete problem becomes impractical depending


on its size. The objective is to reduce the search space, simplifying the
problem and its resolution. For this it is necessary to use information
generated by nodes to decide the viability of branch it (continue the
calculations) or prune it (removes them from the calculations) and thus
facilitate the problem.
Tests for elimination of nodes:

Elimination by infeasibility

If a node has infeasibility, their "children" will also present;

The node should be pruned by infeasibility.

The tree of the traveling salesman problem would be

Elimination by quality
-

One can compare the cost of the solutions of the sub problems;

If the solution of a given node is a solution worse than the original


problem previously obtained, your branch need not be extended: it is
discarded (pruned) by quality.

When coupling elimination by quality in the traveling salesman example we


have:

Suppose a greedy algorithm that chooses the path A, B, C, D and E, with


solution value 8;

If the sum of a route is greater than or equal to 8, we prune the branch.


Elimination by optimality

Analogous to quality;

Occurs when the solution of the sub problem is also the solution of the
original problem;

Since no "child" solution surpasses its "father" solution if in a given


branch of the tree a solution of the original problem was found, the node
does not need to be extended: it is pruned by optimality.

After presenting the three criteria of elimination, the problem is solved:

For every interaction, solve one problem relaxed (providing limits) and
generate "children" sub problems;

Examine the solutions of the nodes (sub-problems), testing the criteria


for elimination.

Given an integer maximization problem:


i) You can get an upper bound of problem solving the relaxed problem;
ii) You can get a lower bound of problem through heuristics.

iii) From the relaxed solution, you choose a variables that do not satisfy
the conditions of integrality for the branch;
iv) Branch: Generate two sub-problems adding limits (restrictions) to the
variable chosen;

v) Bound: known the limits of the problem, one can apply the criteria of
elimination.
S1 is fathomed by infeasibility

S1 is fathomed by quality
7

S1 is fathomed by optimality

3. Exercises
a) Branch and bound
The method can also be solved graphically as the example below:
Find the optimal solution of the following ILP problem
maxX1 + 4X2
X1 + X2 1/2
X1 X2 5/2
2X1 + x2 7
X2 7/2
X1, X2 0, Z
Applying the branch and bound method, and describing each node of the
branch and bound tree.
i)

All inequations are represented in a graph


8

ii)

The yellow area is the intersection of all the restrictions and the
blue dots are its extreme that through them the optimal value will
be calculated using the objective function.

iii)

After calculating the z value of the objective function for each point,
the optimum value is z = 14 for (0, 7/2), where x1 = 0 and x2 = 7/2.
Thus, this will be the initial value of the tree.

iv)

However, the optimal value of x2 is not an integer value. Therefore,


to continue the calculations I assign two values to x2, x2 less or
equal 3 and x2 higher or equal 4.

v)

The value 4 is eliminated by infeasibility, since, as can be seen in


the chart, it does not obey the restrictions. However, the value 3 is
in the yellow area, forming two points able to be calculated in the
objective function.

vi)

To calculate the new points P1, we find the values z = 11.5 for the
point (1/2, 3) and z= 12 for the point (0, 3). The two values are
smaller than the value of P0, and therefore they are eliminated by
quality.

10

vii)

Therefore, it is not possible to continue the calculations and the


optimal value is 14.

b) Branch and bound


Consider the branch and bound tree in Figure 1, related to a minimization
problem, where, for each node i, the upper and the lower bound ([UBi,LBi])
are given.

In which range is the optimum of the problem?

11

The optimum of the problem is in the range P2, because it is a minimization


problem and it presents the smallest value for the LB as the P0, but its UB
value is smaller than P0s UB.
Is it possible that UB6 = 23? And UB6 = 25?
Yes, it is possible to be 23, because its father node has a value bigger (24),
in other words, the value 23 is in the range of its father node (P2).
However, it is not possible to be 25, because the value 25 is not in the range
of its father node (P2).
Is it possible that LB6 = 16? And LB6 = 14? And LB6 = 15?
As in the previous question, the values must be within the range of its
father node, thus the values 15 and 16 are possible, but the value 14 is not
possible because the LB2 is bigger (15).
Suppose that P4 is not feasible. For which values of LB6 and UB6 it
is possible to fathom all the nodes and nd the optimal solution?
It is possible to fathom all the nodes en find the optimal solution if the values
of LB6 and UB6 are 15 and 23, respectively ([23, 15]). This because the
values belong to the range of its father node and it represents the lowest
values of UB and LB possible.
c) Knapsack problem
The knapsack problem is a problem of combinatorial optimization. The name
is given due to a situation model in which you need to fill a knapsack with
objects of different weights and values. The purpose is that they fill the
backpack with the greatest possible value, not exceeding the maximum
weight.
Imagine that I have n objects that I would like to put in a knapsack capacity
c. Each object i has value vi and weight pi. I cannot pick a fraction of each
object to put in the knapsack, because it is not possible to divide it. I want to
do this in order to respect the capacity of the knapsack and maximize its
value.
12

Below the problem will be exemplified for better understanding.


Solve the following knapsack problem. Apply a branch and bound algorithm
that evaluates the upper bound with the LP relaxation. Illustrate the
intermediate steps and the evolution of the enumeration tree.
max11x1 + 19x2 + 5x3 + 6x4
5x1 + 2x2 + 3x3 + 4x4 <= 6
x1,x2,x3,x4 {0,1}
i)

Firstly it is necessary to define the bounds

The optimal solution for the upper bound is easy to calculate: simply
take the items with the highest density first; when coming across with
the first item that does not fit, use the largest possible fraction of it.
-

Calculate the density for each item:


X1:

11/5= 2.2

X2:

19/2= 9.5

X3:

5/3= 1.67

X4:

6/4= 1.5

Thus, the order of importance is X2, X1, X3 e X4. So, it is possible take X2
and 4/5X1, which define the upper bound as 27.8
For the lower bound we use a greedy heuristic, in which is placed in the
knapsack items with higher profit and lower weight.

Using the calculated density, the lower bound is 19.


ii)

Now, one begin to assemble the tree enumeration

13

The order of items follows the order of importance X2, X1, X3, X4.
Therefore, the first item is X2.

The bounds are calculated the same way, but in P1 is not allowed to use
the X2.

The values of the bounds of P1 are outside the range of its father node,
so it was eliminated by infeasibility and therefore continue to calculate
only the branch P2.

14

The P4 node exceeds the capacity of the knapsack, it has a higher weight
and therefore it was eliminated by infeasibility and therefore continue
only calculate the branch of P3.

- As there is no possibility to find a better solution, it is not necessary to


continue the calculations and thus we obtain 25 as optimal solution.

15

Potrebbero piacerti anche