Chapter13BinaryandMixed IntegerProgramming
Chapter13BinaryandMixed IntegerProgramming
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).
The m constraints are all inequalities of the form ax ij j bi for i 1,2,...m
All of the xj where j=1,2,…n are binary variables (can only have a value of 0 or 1).
All objective function coefficients are non-negative.
The variables are ordered according to their objective function coefficients so that
0 ≤ c1 ≤ c2 ≤…≤ cn.
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.
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
cheapest one available is xN+1, so the bounding function value is j 1 c j x j cN 1 . As before, the
N
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.
Note that the variables are already ordered as required by Balas’ algorithm. There are 2 6 = 64
possible solutions if they are all enumerated, but we expect that Balas’ algorithm will generate
far fewer full and partial solutions. The branch and bound tree develops as shown in the
following diagrams. Figure 13.1 shows the root node, which has an objective function value of 0
and is infeasible by constraints 1 and 3, hence it must be
0 expanded. From here on, each node is labelled with the
All solns inf: 1,3 bounding function value, and an indication of status for the
current solution that the node represents (note that this is not
the same as the bounding function solution for zero nodes). Inf
Figure 13.1: Root node.
indicates that the node is currently infeasible and Imp indicates
that the node has been found to be impossible to satisfy; each of these notations is followed by an
indication of which constraints are causing infeasibility or impossibility.
Now we select the next node for expansion. Since we are using depth-first node selection, we
are left only a single bud node to choose: (1,0,?,?,?,?), with a bounding function value of 9.
Best-first node selection would have chosen node (0,?,?,?,?,?) because it has a lower bounding
function value of 5.
Mixed-integer programs often arise in the context of what would otherwise seem to be a linear
program. However, as we saw in the previous chapter, it simply doesn’t work to treat the integer
variable as real, solve the LP, then round the integer variable to the nearest integer value. Let’s
take a look at how integer variables arise in an LP context.
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
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:
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.
N
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 don’t 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.
This assures that exactly one of the right hand side values is chosen. In the metal finishing
machine example, the model would be:
x1 + x2 = 4y1 + 6y2 + 8y3
y1 + y2 + y3 =1
and y1, y2, y3 binary.
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
The second aspect of Dakin’s algorithm is the branching. As a node is expanded, two child
nodes are created in which new variable bounds are added to the problem. We first identify the
candidate variables: those integer variables that did not get integer values in the LP-relaxation
solution associated with the node. One of these candidate variables is chosen for branching.
Let’s consider candidate variable xj that has a non-integer value that is between the next smaller
integer k and the next larger integer k+1. The branching then creates two child nodes:
the parent node LP plus the new variable bound xj k
the parent node LP plus the new variable bound xj k+1
For example, consider some candidate variable xj that has the value 5.761. One child node will
consist of the parent LP plus the new variable bound xj 5 and the other child node will consist
of the parent LP plus the new variable bound xj 6. These new nodes force xj away from its
current non-integer value. There is no guarantee that it will get an integer value in the next LP-
relaxation, however (though this often happens).
Fathoming is simple. If the LP-relaxation at a node assigns integer values to all integer
variables, then the solution is integer-feasible, and is the best that can be attained by further
expansion of that node. The solution value is then compared to the incumbent and replaces the
incumbent if it is better. If the LP-relaxation is LP-infeasible, then the node and all of its
descendents are infeasible, and it can be pruned.
Node selection is normally depth-first. This is because a child node is exactly the same as the
parent node, except for one changed variable bound. This means that the LP basis from the
parent node LP-relaxation solution can be used as a hot start for the child node LP-relaxation. Of
course the parent node solution will definitely be infeasible in the child node, but a dual simplex
restart can be used and will very quickly iterate to a new optimum solution. This is much more
This branch and bound tree develops as shown in Figure 13.10. Small sketches of the feasible
region for some of the LP-relaxations are also shown on the diagram. Note how the new variable
bounds gradually “square off” the LP-relaxation feasible regions until solutions are found in
which both of the integer variables indeed have integer values.
Each node in Figure 13.10 represents the solution of an LP-relaxation. Numbers indicate the
order of the solutions. An incumbent solution of (3,3) with Z = 39 is obtained early, at the
second LP solution. However there are other promising nodes with better bounding function
values, so tree development continues. A better incumbent is eventually found: node 7 with a
solution of (5,0) and Z = 40. At this point, all other nodes are pruned and the solution process
halts. Note how far the final solution of (5,0) is from the initial LP-relaxation solution of
(3.75,2.25): you can’t get to the final solution by rounding!
You will not need to set up the MILP branch and bound tree manually in practice. Most
commercial LP solvers will accept integer or binary restrictions on variables as part of their
input. They then take care of setting up the branch and bound tree automatically. As you can
imagine though, MILP solutions generally take a lot longer than identical LP solutions!
A number of further improvements on the basic algorithm are used in commercial MILP solvers:
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.