Chapter13 PDF
Chapter13 PDF
The general branch and bound approach described in the previous chapter can be customized for
special situations. This chapter addresses two special situations:
when all of the variables are binary (known as Binary Integer Programming or BIP),
when some or all of the variables are integer-valued and the objective function and all of
the constraints are linear (known as Mixed Integer Programming, MIP, or Mixed
Integer Linear Programming, MILP).
All of the xj where j=1,2,n are binary variables (can only have a value of 0 or 1).
The variables are ordered according to their objective function coefficients so that
0 c1 c2 cn.
ax
ij
bi for i = 1,2,...m
This may seem like a restrictive set of conditions, but many problems are easy to convert to this
form. For example, negative objective function coefficients are handled by a change of variables
in which xj is replaced by (1-xj). It is also easy to reorder the variables. Constraint right hand
sides can be negative, so constraints are easily converted to form by multiplying through by
-1. The biggest restriction is that Balas Additive Algorithm does not handle equality constraints.
The keys to how Balas Algorithm works lies in its special structure:
The objective function sense is minimization, and all of the coefficients are nonnegative,
so we would prefer to set all of the variables to zero to give the smallest value of Z.
If we cannot set all of the variables to 0 without violating one or more constraints, then
we prefer to set the variable that has the smallest index to 1. This is because the variables
are ordered so that those earlier in the list increase Z by the smallest amount.
These features also affect the rest of the branch and bound procedures. Branching is simple:
each variable can only take on one of two values: 0 or 1. Bounding is the interesting part. Balas
algorithm does not perform any kind of look-ahead to try to complete the solution or a simplified
version of it. Instead the bounding function just looks at the cost of the next cheapest solution
that might provide a feasible solution. There are two cases, as described next.
http://www.sce.carleton.ca/faculty/chinneck/po.html
If the current variable is set to 1, i.e. xN = 1, then the algorithm assumes that this might provide a
N
feasible solution, so the value of the bound is j =1 c j x j . Because of the variable ordering, this is
the cheapest thing that can happen. Note that xN (x now) is not the same as xn (the last x in the
list).
If the current variable is set to 0, i.e. xN = 0, then things are a little different. Recall that we need
to calculate a bounding function value only for nodes that are currently infeasible. In this case,
one of the constraints is not yet satisfied, i.e. the left hand side is less than the right hand
constant. But if we set the current variable to zero, the left hand side value of the violated
constraint(s) will not change. Therefore we must set at least one more variable to 1, and the
N
cheapest one available is xN+1, so the bounding function value is j =1 c j x j + cN +1 . As before, the
algorithm assumes that this cheapest setting might provide a feasible solution, so it proceeds.
It is easy to determine whether the solution proposed by the bounding function is feasible: just
assume that all of the variables past xN (when xN = 1) or past xN+1 (when xN = 0) take on the value
of zero and check all of the constraints. If all of the constraints are satisfied at the solution
proposed by the bounding function, then the node is fathomed, since it is not possible to get a
lower value of the objective function at any node that descends from this one (the bounding
function has made sure of that). All that remains is to compare the solution value at the node to
the value of the incumbent, and to replace the incumbent if the current node has a lower value.
Infeasibility pruning is also worthwhile in this algorithm since it is easy to determine when a bud
node can never develop into a feasible solution, no matter how the remaining variables are set.
This is done by examining each constraint one by one. For each constraint, calculate the largest
possible left hand side value, given the decisions made so far, as follows: (left hand side value
for variables set so far) + (maximum left hand side value for variables not yet set). The second
term is obtained by assuming that a variable will be set to 0 if its coefficient is negative and 1 if
its coefficient is positive. If the largest possible left hand side value is still less than the right
hand side constant, then the constraint can never be satisfied, no matter how the remaining
variables are set, so this node can be eliminated as impossible. For example, consider the
constraint 4x1 5x2 + 2x3 + 2x4 3x5 1. Suppose that both x1 and x2 have already been set to
1, while the remaining variables have not yet been set. The largest possible left hand side results
if x3 and x4 are set to 1 while x5 is set to 0, giving a left hand side value of (9) + (4) = 5, which
is not 1, hence the partial solution (1,1,?,?,?) cannot ever yield a feasible solution, so the node
is fathomed as impossible.
Balas Additive Algorithm uses depth-first node selection. It is of course possible to replace this
by another node selection strategy, such as best-first, but if you do so then you are no longer
following Balas algorithm, strictly speaking. If your problem formulation states that you are
using the Balas algorithm, then you must use depth-first node selection.
Consider the following example:
Minimize Z = 3x1 + 5x2 + 6x3 + 9x4 + 10x5 + 10x6
Subject to:
(1)
http://www.sce.carleton.ca/faculty/chinneck/po.html
(2)
(3)
http://www.sce.carleton.ca/faculty/chinneck/po.html
function value of 9. Best-first node selection would have chosen node (0,?,?,?,?,?) because it has
a lower bounding function value of 5.
The expansion of node (1,0,?,?,?,?) is shown in Figure 13.4. Node (1,0,0,?,?,?) is fathomed and
found to be feasible when using the bounding function solution (1,0,0,1,0,0), with an objective
function value of 12. This is our first incumbent solution. Node (1,0,1,?,?,?) is found to be
impossible by constraint 1.
At this point, both of the nodes just created are not eligible for further expansion, so we back up
the tree, looking for a level
at which one of the nodes is
5
x1
0
unexplored. Figure 13.5
inf: 1,3
shows that the next
all solns
branching occurs at the
x2
x3
node (0,?,?,?,?,?).
0
12
1
0
0
inf: 1,3
feasible
Both child nodes are
infeasible,
but
not
1
1 9
impossible.
The node
imp: 1
having the lowest bounding
function value is chosen for
further branching, as shown
Figure 13.4: Third branching.
in Figure 13.6.
The new zero node
created
has
a
6
bounding
function
x2
0
inf: 1
value of 14, worse
than the incumbent,
x1
0
so it is pruned
5
1
immediately,
inf:
2,3
without
bothering to
all solns
check feasibility or
impossibility. The
12
1
0
0
new one node is
feasible
feasible, and the
associated solution
(0,1,1,0,0,0) has an
1
1
objective function
value of 11. This is
Figure 13.5: Fourth branching.
lower than the
previous incumbent,
so it becomes the new incumbent, and the node associated with the previous incumbent is
pruned. There is still a live node that has a promising value of the bounding function:
(0,0,?,?,?,?), so this node is expanded next, as shown in Figure 13.7.
http://www.sce.carleton.ca/faculty/chinneck/po.html
0
x1
6
inf: 1,3
14
11
feasible
1
all solns
x2
0
inf: 1,3
x3
0
There is again just one node to expand: (0,0,1,?,?,?), as shown in Figure 13.8. Both child nodes
have bounding function values that are worse than the objective function value of the incumbent,
and so are pruned.
There are no more bud nodes, so the branch and bound solution is complete and the incumbent
solution
is
the
9
optimum:
(0,1,1,0,0,0)
0
with
an
objective
imp: 3
x3
function value of 11.
x2
x1
6
inf: 1
0
1
all solns
1
1
11
http://www.sce.carleton.ca/faculty/chinneck/po.html
0
x3
0
x2
x1
16
15
0
1
all solns
1
1
11
Balas' algorithm is just one way of dealing with binary problems. More general methods can
also be used, such as the techniques for mixed-integer programming that we will explore next.
Either/Or Constraints
Either/or constraints arise when we have a choice between two constraints, only one of which
has to hold. For example, the metal finishing machine production limit in the Acme Bicycle
Company linear programming model is x1 + x2 4. Suppose we have a choice between using
that original metal finishing machine, or a second one that has the associated constraint x1 + 1.5x2
6. We can use either the original machine or the second one, but not both. How do we model
this situation?
An important clue lies in observing what happens if you add a large positive number (call it M)
to the right hand side of a constraint, e.g. x1 + x2 4 + M. This now says x1 + x2 very big
http://www.sce.carleton.ca/faculty/chinneck/po.html
number, so any values of x1 and x2 will satisfy this constraint. In other words, the constraint is
eliminated. So what we want in our either/or example is the following:
either
or
x1 + x2 4
x1 + 1.5x2 6 + M
x1 + x2 4 + M
x1 + 1.5x2 6
We can achieve an equivalent effect by introducing a single binary variable (call it y), and using
it in two constraints, both of which are included in the model, as follows:
(1)
x1 + x2 4 + My
(2)
x1 + 1.5x2 6 + M(1-y)
Now if y = 0 then only constraint (1) holds, and if y = 1 then only constraint (2) holds, exactly
the kind of either/or behaviour we wanted. The downside, of course, is that a linear program has
been converted to a mixed-integer program that is harder to solve.
fN(x) bN + MyN
and including the following additional constraint:
i =1
yi = N k
This final constraint works as follows: since we want k constraints to hold, there must be N-k
constraints that dont hold, so this constraint insures that N-k of the binary variables take the
value 1 so that associated M values are turned on, thereby eliminating the constraint.
f ( x) = i =1 bi yi and
N
i =1
yi = 1
This assures that exactly one of the right hand side values is chosen. In the metal finishing
machine example, the model would be:
http://www.sce.carleton.ca/faculty/chinneck/po.html
0
if xj = 0
K + cjxj if xj > 0
where K is the fixed charge. This says that there are no charges at all if the resource represented
by xj is not used, but if it is used, then we incur both the fixed charge K and the usual charges
associated with the use of xj, represented by cjxj.
The objective function must also be modified. It becomes:
minimize Z = f(xj) + (rest of objective function)
Note the minimization: set-up costs are only interesting in the cost-minimization context. If it is
cost-maximization (a strange concept) then we would of course always incur the set-up cost by
insuring that every resource was always used.
The final model introduces a binary variable y that determines whether or not the set-up charge is
incurred:
Minimize Z = [Ky + cjxj] + (rest of objective function)
subject to:
xj My 0
other constraints
y binary
This behaves as follows. If xj > 0, then the first constraint insures that y = 1, so that the fixed
charge in the objective function is properly applied. However, if xj = 0, then y could be 0 or 1:
the first constraint is not restrictive enough in this sense. We want y to be zero in this case so
that the set-up cost is not unfairly applied, and something in the model actually does influence y
to be zero. Can you see what it is? It is the minimization objective. Given the free choice in this
case between incurring a set-up cost or not, the minimization objective will obviously choose not
to. Hence we have exactly the behaviour that we wish to model. Once again, though, we have
converted a linear program to a mixed-integer linear program.
http://www.sce.carleton.ca/faculty/chinneck/po.html
http://www.sce.carleton.ca/faculty/chinneck/po.html
x2
9
optimum of
initial LP
relaxation
feasible
region
x1
5 6
Which candidate variable is selected for branching can have a big impact, so there are
more advanced algorithms for making this decision.
You don't normally solve the LP relaxation for both child nodes after branching. You
normally just solve the up-branch (in which the lower bound was increased), or just the
down-branch, or you use a more sophisticated algorithm for choosing the branching
direction. Depth-first search then continues without solving the LP-relaxation for the
sibling node. If needed, the search will backtrack to the sibling node eventually.
A variety of sophisticated algorithms are available for choosing the next node to expand
when the depth-first search must backtrack.
The root node is subjected to intensive analysis before branch and bound begins in the
hopes of greatly reducing the subsequent amount of work.
Many other advanced techniques are also available, like probing algorithms that explore
the region around promising solutions. MILP is an active area of research!
http://www.sce.carleton.ca/faculty/chinneck/po.html
10
http://www.sce.carleton.ca/faculty/chinneck/po.html
11