Integerprog PDF
Integerprog PDF
3 1
IP is the name given to LP problems which have the additional constraint that some or all the variables
have to be integer.
1. CLASSICAL INTEGER PROGRAMMING PROBLEMS
EXAMPLE 1: CAPITAL BUDGETING
A firm has n projects that it would like to undertake but because of budget limitations not all can be
selected. In particular project j is expected to produce a revenue of cj but requires an investment of aij in the time
period i for i 1,...m. The capital available in time period i is bi . The problem of maximising revenue subject to
the budget constraints can be formulated as follows: let xj 0 or 1 correspond to not proceeding or
respectively proceeding with project j then we have to
! cj x j
n
max
j1
! aij xj bi ; i 1, ... , m
n
subject to
j1
0 xj 1 xj integer j 1, ..., n
! ! cij xij ! fi yi
m n m
min
i 1 j1 i 1
! xij 1 ; xij yi
m
subject to i 1, ..., m ; j 1, ..., n (1)
i 1
Note that if yi 0 then fi yi 0 and there is no contribution to the total cost. Also xij yi implies
xij 0 for j 1,...n and so no goods are distributed from site i. This corresponds exactly to no depot at site i.
On the other hand, if yi 1 then fi yi fi which is the cost of constructing depot i. Also xij yi
becomes xij 1 which holds anyway from the constraints (1).
I such that S - Sj . Assume that each subset Sj has a cost cj 0 associated with it. We define the cost
Let S1 , ..., Sn be a family of subsets of a set S 1,2, ..., m. A covering of S is a subfamily Sj for j
jI
of a cover to be the sum of the costs of the subsets included in the cover.
The problem of finding a cover of minimum cost is of particular practical significance. As an integer
program it can be specified as follows: define the m n matrix A aij by
IP #!!3 2
aij 1 if i Sj
0 otherwise
Let xj be 0 1 variables with xj 10 to mean set Sj is included respectively not included in the cover.
The problem is to
! cj xj
n
Minimise
j1
subject to ! aij xj 1
n
i 1,...m (2)
j1
xj 0 or 1
The m inequality constraints have the following significance: since xj 0 or 1 and the coefficients aij
are also 0 or 1 we see that ! aij xj can be zero only if xj 0 for all j such that aij 1. In other words only if
n
j1
no set Sj is chosen such that i Sj . The inequalities are put in to avoid
this.
EXAMPLE 3: SET COVERING - AIRLINE CREW SCHEDULING
Consider the following simplified airline crew scheduling problem. An airline has m scheduled flight-
legs per week in its current service. A flight-leg being a single flight flown by a single crew e.g. London - Paris
leaving Heathrow at 10.30 am. Let Sj , j 1,...n be the collection of all possible weekly sets of flight-legs that
can be flown by a single crew. Such a subset must take account of restrictions like a crew arriving in Paris at
11.30 am. cannot take a flight out of New York at 12.00 pm. and so if cj is the cost of set Sj of flight-legs then
the problem of minimising cost subject to covering all flight-legs is a set covering problem. Note that if crews
are not allowed to be passengers on a flight i.e. so that they can be flown to their next flight, then we have to
make 2 an equality the set partitioning problem.
EXAMPLE 4: SET COVERING - BUILDING FIRE STATIONS
There are six cities in region R. The region must determine where to build fire stations. The region
wants to build the minimum number of fire stations and ensure that at least one fire station is near 15 minutes of
each city. The times (in minutes) required to drive between cities are:
From To
1 2 3 4 5 6
1 0 10 20 30 30 20
2 10 0 25 35 20 10
3 20 25 0 15 30 20
4 30 35 15 0 15 25
5 20 20 30 15 0 14
6 20 10 20 25 14 0
xi =
0 otherwise
x0 = x1 + x2 + x3 + x4 + x5 + x6
IP: min x0 = x1 + x2 + x3 + x4 + x5 + x6
subject to x1 + x2 1 (City 1)
x1 + x2 + x6 1 (City 2)
x3 + x4 1 (City 3)
x3 + x4 + x5 1 (City 4)
x4 + x5 + x6 1 (City 5)
x2 + x5 + x6 1 (City 6)
xi = 1 or 0; i = 1, ..., 6.
Optimal solution: x0 = 2; x2 = x4 = 1, x1 = x3 = x5 = x6 = 0.
In a set covering problem each member of a given set (Set 1) must be covered" by another member of
some set (e.g. Set 2). The objective is to minimize the number of elements in Set 2 that are required to cover Set
1.
2. GENERAL TERMINOLOGY FOR INTEGER PROGRAMMING
The most general problem called the mixed integer programming problem can be specified as
min x 0 cT x
subject to Ax b
xj 0 j 1, ..., n
xj integer for j IN
x0 , x1 , x2 0 and integer
As defined this is not a pure problem. For a start x0 will not necessarily be integer and neither will the
slack variables. If we want to use an algorithm for solving pure problems we must scale the objective and
constraints to give:
min x0 2x1 3x2
subject to 2x1 x2 x3 4
3x1 9x2 x4 4
x1 ,...x4 0 and integer.
p1 w1 ... pm wm
c1 w1 c2 w2 c3 w3
a 0 x M
0 x 1 or x 2
can be expressed
x 1 M 1$
x 2 M$ 1
x 0 $ 0 or 1
b x1 x2 4
x1 1 or x2 1 but not both 1
x1 , x2 0
can be expressed
x1 x2 4
x1 $
x2 1 $
x1 1 $ 4 $
x2 $ 4 1 $
$ 0 or 1
Integer programming problems generally take much longer to solve than the corresponding linear
program obtained by ignoring integrality. It is wise therefore to consider the possibility of solving as a straight
forward LP and then rounding e.g. in the trim loss problem. This is not always possible for example if x1 is a
0 1 variable such that x1 0 means do not build a plant and x1 1 means build a plant rounding x1 1/2
is not very satisfactory.
It is straight forward to show that if at any stage the current L.P. solution x is integer it is the optimal integer
solution. This is because x is optimal over a region containing all feasible integer solutions. The problem is to
define cuts that ensure the convergence of the algorithm in a finite number of steps. The first finite algorithm
was devised by Gomory.
The algorithm is based on the following construction of a 'cutting plane': let
a1 x1 ... an xn b (3)
IP #!!3 5
be an equation which is to be satisfied by non-negative integers x1 , ... xn and let S be the set of possible
solutions.
For a real number 0 we define 0 to be the largest integer 0 . Thus, 0 0 %, 0 % 1.
6 "# 6; 3 3; 4 "# 5
j1
and hence
! fj xj f b ! aj xj
n n
(4)
j1 j1
Now for x S the right hand side of 4 is clearly integer and so 0 D fj xj f is integer for
x S. Since x 0 for x S we also have 0 f 1 and since 0 is integer we deduce that 0 0
and that
! fj x j f
n
for x S
j1
Suppose now that one has solved the continuous problem in step 1 of our cutting plane algorithm and
the solution is not integer. Therefore there is a basic variable xi with
! fj x j f (5)
jI
for all integer solutions to our problem.
Now f 0 since bi0 is not integer and so 5 is not satisfied by the current LP solution since xj 0
for j I and so 5 is a cut.
Step 3 Choose a basic variable xi which is currently non-integer. Construct the corresponding constraint (5)
and add it to the problem. Go to step 1. We note that the tableau obtained after adding the cut is
dual feasible and so the dual simplex algorithm is used to re-optimise. Nevertheless, we shall not
discuss the dual simplex algorithm and confine ourselves to the phase 1 and phase 2 simplex
algorithm.
The basic approach is illustrated in FIGURE 1 below.
IP #!!3 6
EXAMPLE 5:
BV x1 x2 x3 x4 x5 x6 x7 RHS
_____________________________________________________
x0 3 4 0
x3 2 5 1 15
x4 2 -2 1 5
'continuous relaxation'
_____________________________________________________
x0 - 75 4
5 12
2 1
x2 5 1 5 3
14 2
x4 5 5 1 11
'continuous relaxation' & first continuous optimum
_____________________________________________________
1 35
x0 1 2 2
1 1 10
x2 1 7 - 7 7
1 5 55
x1 1 7 14 14
x0 2 1 14
x2 1 -1 1 2
x1 1 2 -1 2
x4 1 -6 4 5
x5 1 -2 1 1
x3 1 1 -3 1
EXAMPLE 6:
10x1 3x2 14
x1 , x2 0
IP #!!3 9
BV x1 x2 x3 x4 x5 x6 RHS
___________________________________________________
x0 1 4 0
x3 2 4 1 7
x4 10 3 1 14
_____________________________________________________
2nd 'continuous' problem solved, but noninteger, add a cut.
" $( &"
x0 "! "! "!
x2 1 1 1
" $ ""
x1 1 "! "! "!
" "( %
x3 1 & & &
0c "
"!
(
"! 1 "
"!
(a) Cut generated is "# x1 "% x3 $% or "# x1 "% x3 x5 $% . Adding artificial 0 to this, in order to get
basic feasible solution to a augmented set of equations, gives "# x1 "% x3 x5 0 $% .
b Choose a pivot that will reduce 0 pivoting in column 1 is allowable, but the arithmetic is worse.
" ( "
c Cut generated is "! x4 "! x5 x6 "! .
It is useful to see what has happened graphically. We first express the cuts in terms of x1 , x2 .
Cut No.1.
" " $
# x1 % x3 %
since
x3 7 2x1 4x2 this becomes x2 1.
Cut No.2.
After re-arranging, this becomes x1 x2 2.
The constraints and cuts are illustrated in FIGURE 2 below where
A is the optimal solution ignoring integrality.
IP #!!3 10
B is the optimal solution after adding cut 1.
C is the optimal integer solution found after adding cut 2.
One can show that the Gomory cuts D fj xj f when expressed in terms of the original non-basic
variables have the form D wj xj W where the wj , W are integers and the value of D wj xj after solving the
current continuous problem is w % where 0 % 1 assuming the current solution non-integer. Thus the
cut is obtained by moving a hyperplane parallel to itself to an extent which cannot exclude an integer solution. It
is worth noting that the plane can usually be moved further without excluding integer points thus generating
deeper cuts. For a discussion on how this can be done refer to specialist books on integer programming.
Further Remarks
1. [As the dual simplex algorithm is not covered in this course, you may choose to ignore this remark.]
After adding a cut and carrying out one iteration of the dual simplex algorithm the slack variable corresponding
to this cut becomes nonbasic. If during a succeeding iteration this slack variable becomes basic then it may be
discarded along with its current row without affecting termination. This means that the tableau never has more
than m 1 rows or m n columns.
2. A valid cut can be generated from any row containing a non-integral variable. One strategy is to choose
the variable with the largest fractional part as this helps to produce a 'large' change in the objective value. It is
interesting that finiteness of the algorithm has not been proved for this strategy although finiteness has been
proved for the strategy of always choosing the 'topmost' row of the tableau with a non-integer variable.
3. The behaviour of this algorithm has been erratic. For example, it has worked well on set covering
problems but in other cases the algorithm has to be terminated because of excessive use of computer time. This
raises an important point; if the algorithm is stopped prematurely then one does not have a good sub-optimal
solution to use. Thus in some sense the algorithm is unreliable.
Step 0: Initially the list consists of the initial problem P0 . Put MIN equal to either the value of some known
integer solution, or if one is not given equal to some upper bound calculable from initial data, if
neither possibility is possible put MIN _.
Solve the L.P. problem associated with P0 . If the solution has integer values for all integer variables
terminate, otherwise
Step 1: Remove a problem P from the list whose optimal continuous objective function value x0 is greater
than MIN. If there are no such problems terminate. The best integer solution found so far is optimal.
If none have been found the problem is infeasible.
Step 2: Amongst the integer variables in problem P with non-integer values in the optimal continuous
solution for P select one for branching. Let this variable be yp and let its value in the continuous
solution be " .
Step 3: Create two new problems P' and P'' by adding the extra restrictions yp " and yp " 1
respectively. Solve the LP problems associated with P' and P'' and add these problems to the list. If a
new and improved integer solution is found store it and update MIN. The new LP problems do not
have to be solved from scratch but can be re-optimised using the dual algorithm (or parametrically
altering the bound on yp . If during the re-optimisation of either LP problem the value of the
objective function exceeds MIN this problem may be abandoned. Go to step 1.
If one assumes that each integer variable in P0 has a finite upper bound equal to some large number for
notionally unbounded variable then the algorithm must terminate eventually, because as one proceeds further
down the tree of problems the bounds on the variables become tighter and tighter, and these would eventually
become exact if the LP solutions were never integer.
EXAMPLE 7:
As an example we show a possible tree for solving
Minimise 20 3x1 4x2
Subject to
#
& x1 x2 3
# #
& x1 & x2 1
x1 , x2 0 and x1 , x2 integer
The application of branch and bound to this problem is described in FIGURE 4 below.