Integer Programming PPT Final

You might also like

Download as pdf or txt
Download as pdf or txt
You are on page 1of 22

Integer Programming

➢ Integer linear programs (ILPs) are linear programs with some or all the variables
restricted to integer (or discrete) values.

➢ A pure integer problem is defined to have “all” integer variables. When all the
variables are allowed to take on values either zero or one, it is called a zero-one
programming problem. Otherwise, a problem is a mixed integer program if it deals
with both continuous and integer variables.

➢ The two prominent algorithms of ILP: branch and bound (B&B) and cutting plane.
Of the two algorithms, B&B is decidedly more efficient computationally. Indeed,
practically all commercial codes are rooted in B&B.
Example: Capital Budgeting

Ex.1: Five projects are being evaluated over a 3-year planning horizon. The following table gives the expected returns for
each project and the associated yearly expenditures. Which projects should be selected over the 3-year horizon?

Sol: The problem reduces to a "yes-no" decision for each project. Define the binary variable as

The ILP model is


Maximize Z = 20x1+ 40x2+ 20x3+ 15x4+ 30x5
subject to
5x1+ 4x2+ 3x3+ 7x4+ 8x5 ≤ 25

x1+ 7x2+ 9x3+ 4x4+6x5 ≤ 25


8x1+ 10x2+ 2x3+ x4+ 10x5 ≤ 25
x1, x2, x3, x4, x5 = (0,1)

The optimum integer solution (obtained by AMPL, Solver, or TORA) is xl =x2 =x3 = x4 = 1, x5 = 0, with z =
95 (million $). The solution shows that all except project 5 must be selected.

Remarks: It is interesting to compare the continuous LP solution with the ILP solution. The LP optimum,
obtained by replacing xj = (0,1) with 0≤ xj≤ 1 for all j, yields x1 = .5789, x2 = x3 = x4 = 1, x5 = .7368, and z =
108.68 (million $). The solution is meaningless because two of the variables assume fractional values. We may
round the solution to the closest integer values, which yields xl = x5 = 1. However, the resulting solution is
infeasible because the constraints are violated. More important, the concept of rounding is meaningless here
because xi represents a "yes-no" decision.
Integer Programming Algorithm
The ILP algorithms are based on exploiting the tremendous computational success of LP. The strategy
of these algorithms involves three steps.

Step 1. Relax the solution space of the ILP by deleting the integer restriction on all integer variables. The
result of the relaxation is a regular LP.

Step2. Solve the LP, and identify its continuous optimum.

Step3. Starting from the continuous optimum point, add special constraints that iteratively modify the LP
solution space in a manner that will eventually render an optimum extreme point satisfying the integer
requirements.

Two general methods have been developed for generating the special constraints
1. Branch-and-bound (B&B) method
2. Cutting-plane method
Branch and Bound Algorithm (B&B)
Brief Background:-The first B&B algorithm was developed in 1960 by A. Land and G. Doig for
the general mixed and pure ILP problem. Later, in 1965, E. Balas developed the algorithm for
solving ILP problems with pure binary (zero or one) variable.

Ex.2: Maxmize Z = 5x1 + 4x2

subject to

x1 + x2 ≤ 5

l0x1 + 6x2 ≤ 45

x1, x2 non-negative integer


The lattice points (dots) in graph define the ILP solution space. The
associated continuous LPI problem at node 1 (shaded area) is defined from
ILP by removing the integer restrictions. The optimum solution of LPI is xl =
3.75, x2 = 1.25, and z = 23.75. Because the optimum LPI solution does not
satisfy the integer requirements, the B&B algorithm modifies the solution
space in a manner that eventually identifies the ILP optimum.

First, we select one of the integer variables whose optimum value at LPI is
not integer. Selecting xl (= 3.75) arbitrarily, the region 3 < x1 < 4 of the LPI
solution space contains no integer values of x1, and thus can be eliminated as
nonpromising. This is equivalent to replacing the original LPI with two new
LPs:

LP2 space = LPI space + (xl ≤ 3)


LP3 space = LPI space + (xl ≥ 4)

If we intelligently continue to remove the regions that do not include integer


solutions (e.g., 3 < xl < 4 at LPl) by imposing the appropriate constraints, we
will eventually produce LPs whose optimum extreme points satisfy the
integer restrictions. In effect, we will be solving the ILP by dealing with a
sequence of (continuous) LPs.

The new restrictions, xl ≤ 3 and x1≥ 4, are mutually exclusive, so that LP2
Fig.1 :-Solution spaces for ILP (lattice points) and LP1 (shaded area) and LP3 at nodes 2 and 3 must be dealt with as separate LPs. This
dichotomization gives rise to the concept of branching in the B&B algorithm.
In this case, xl is called the branching variable.
Fig. 2: Solution spaces of LP2 and LP3 Fig. 3: Using branching variable x1 to create LP2 and LP3
The optimum ILP lies in either LP2 or LP3. Hence, both subproblems must be examined. We arbitrarily examine
LP2 (associated with x1 ≤ 3) first:

Maxmize Z = 5x1 + 4x2

subject to

x1 + x2 ≤ 5

l0x1 + 6x2 ≤ 45

x1 ≤3

x1, x2 ≥0

The solution of LP2 yields the solution x1=3, x2 = 2, and z = 23.


LP4 space = LP3 space + (x2 ≤ 0)
= LP1 space + (x1 ≥ 4) + ( x2 ≤ 0)

LP5 space = LP3 space + (x2 ≥ 1)


= LP1 space + (x1 ≥ 4) + (x2 ≥1)

LP6 space = LP1 space + (x1 ≥ 4) + (x2 ≤ 0) + (x1 ≤ 4)

LP7 space = LP1 space + (x1 ≥ 4) + (x2 ≤ 0) + (xl ≥ 5)


Fig.3: Alternative to B&B algorithm
Ex.3: Maxmize Z = -x1 + 4x2

subject to

-10x1 + 20x2 ≤ 22
5x1 + 10x2 ≤ 49
x1 ≤ 5

x1, x2 non-negative integer


LP1
X1=3.8, X2=3,Z1=8.2 Upper bound: z=8.2
X1≤3 X1≥4

LP2 LP3
X1=3, X2=2.6,Z2=7.4 X1=4, X2=2.9,Z3=7.6

X2≤2 X2≥3 X2≤2 X2≥3

LP6 LP7 LP4 LP5


X1=1.8, X2=2,Z6=6.2 NO FEASIBLE SOLUTION X1=4, X2=2,Z4=4 NO FEASIBLE SOLUTION
LOWER BOUND

X1≤1 X1≥2

LP8 LP9
X1=1, X2=1.6,Z8=5.4 X1=2, X2=2,Z9=6
LOWER BOUND(OPTIMUM)

X2≤1 X2≥2
LP10 LP11 Not required
X1=1, X2=1,Z10=3 NO FEASIBLE SOLUTION
Ex.3/LP1: Maxmize Z = -x1 + 4x2

subject to
-10x1 + 20x2 ≤ 22
5x1 + 10x2 ≤ 49
x1 ≤ 5
x1, x2 non-negative integer
Solution with integer relaxation:
x1=3.8, x2=3,z1=8.2
X1≤3 X1≥4

LP2: LP2 space = LPI space + (xl ≤ 3) LP3: LP3 space = LPI space + (xl ≥4)
Maxmize Z = -x1 + 4x2 Maxmize Z = -x1 + 4x2
subject to subject to
-10x1 + 20x2 ≤ 22 -10x1 + 20x2 ≤ 22
5x1 + 10x2 ≤ 49 5x1 + 10x2 ≤ 49
x1 ≤ 5 x1 ≤ 5
x1 ≤ 3 x1 ≥ 4
x1, x2 non-negative integer x1, x2 non-negative integer
Solution with integer relaxation: Solution with integer relaxation:
x1=3, x2=2.6,z2=7.4 x1=4, x2=2.9,z3=7.6
LP1
X1≤3 X1≥4

LP2 LP3

X2≤2 X2≥3

LP4: LP4 space = LP3 space + (x2≤2) LP5: LP5 space = LP3 space + (x2≥3)
Maxmize Z = -x1 + 4x2 Maxmize Z = -x1 + 4x2
subject to subject to
-10x1 + 20x2 ≤ 22 -10x1 + 20x2 ≤ 22
5x1 + 10x2 ≤ 49 5x1 + 10x2 ≤ 49
x1 ≤ 5 x1 ≤ 5
x1 ≥ 4 x1 ≥ 4
x2 ≤ 2 x2 ≥ 3
x1, x2 non-negative integer x1, x2 non-negative integer
Solution with integer relaxation: Solution with integer relaxation:
x1=4, x2=2,z4=4 NO FEASIBLE SOLUTION
LP1
X1≤3 X1≥4

LP2 LP3

X2≤2 X2≥3

LP4 LP5

X2≤2
X2≥3

LP6: LP6 space = LP2 space + (x2≤2) LP7: LP7 space = LP2 space + (x2≥3)
Maxmize Z = -x1 + 4x2 Maxmize Z = -x1 + 4x2
subject to subject to
-10x1 + 20x2 ≤ 22 -10x1 + 20x2 ≤ 22
5x1 + 10x2 ≤ 49 5x1 + 10x2 ≤ 49
x1 ≤ 5 x1 ≤ 5
x1 ≤ 3 x1 ≤ 3
x2 ≤ 2 x2 ≥ 3
x1, x2 non-negative integer x1, x2 non-negative integer
Solution with integer relaxation: Solution with integer relaxation:
x1=1.8, x2=2,z6=6.2 NO FEASIBLE SOLUTION
LP1
X1≤3 X1≥4

LP2 LP3
X2≤2 X2≥3 X2≤2 X2≥3

LP6 LP7 LP4 LP5

X1≤1 X1≥2

LP8: LP8 space = LP6 space + (X1≤1) LP9: LP9 space = LP6 space + (X1≥2)
Maxmize Z = -x1 + 4x2 Maxmize Z = -x1 + 4x2
subject to subject to
-10x1 + 20x2 ≤ 22 -10x1 + 20x2 ≤ 22
5x1 + 10x2 ≤ 49 5x1 + 10x2 ≤ 49
x1 ≤ 5 x1 ≤ 5
x1 ≤ 3 x1 ≤ 3
x2 ≤ 2 x2 ≤ 2
x1 ≤ 1 x1 ≥ 2
x1, x2 non-negative integer x1, x2 non-negative integer
Solution with integer relaxation: Solution with integer relaxation:
x1=1, x2=1.6,z8=5.4 x1=2, x2=2,z9=6
LP1
X1≤3 X1≥4

LP2 LP3
X2≤2 X2≥3 X2≤2 X2≥3

LP6 LP7 LP4 LP5


X1≤1 X1≥2

LP8 LP9

X2≤1 X2≥2

LP10: LP10 space = LP8 space + (X2≤1) LP11: LP11 space = LP8 space + (X2≥2)
Maxmize Z = -x1 + 4x2 Maxmize Z = -x1 + 4x2
subject to subject to
-10x1 + 20x2 ≤ 22 -10x1 + 20x2 ≤ 22
5x1 + 10x2 ≤ 49
x1 ≤ 3
Not Required5x1 + 10x2 ≤ 49
x1 ≤ 3
x2 ≤ 2 x2 ≤ 2
x1 ≤ 1 x1 ≤ 1
x2 ≤ 1 x2 ≥ 2
x1, x2 non-negative integer x1, x2 non-negative integer
Final branch and bound solution tree:

LP1
X1=3.8, X2=3,Z1=8.2 Upper bound: z=8.2
X1≥4
X1≤3

LP2 LP3
X1=3, X2=2.6,Z2=7.4 X1=4, X2=2.9,Z3=7.6

X2≤2 X2≥3 X2≤2 X2≥3

LP6 LP7 LP4 LP5


X1=1.8, X2=2,Z6=6.2 NO FEASIBLE SOLUTION X1=4, X2=2,Z4=4 NO FEASIBLE SOLUTION
LOWER BOUND

X1≤1 X1≥2

LP8 LP9
X1=1, X2=1.6,Z8=5.4 X1=2, X2=2,Z9=6
LOWER BOUND(OPTIMUM)
Ex.4: Maxmize Z = 3x1 + 5x2

subject to

2x1 + 4x2 ≤ 25
x1 ≤ 8
2x2 ≤ 10

x1, x2 non-negative integer


Final branch and bound solution tree:

LP1
X1=8, X2=2.25,Z1=35.25 Upper bound: z=35.25
X2≤2 X2≥3

LP2 LP3
X1=8, X2=2,Z2=34 X1=6.5, X2=3,Z3=34.5
Lower bound
(Optimum)
X1≤6 X1≥7

LP4 LP5
X1=1.6, X2=3.25,Z4=34.25 NO FEASIBLE SOLUTION

X2≤3 X2≥4

LP6 LP7
X1=6, X2=3,Z6=33 X1=4.5, X2=4,Z6=33.5
Lower bound
Branching was stopped as z6 < z2 (current best solution
Ex.4: Maxmize Z = 7x1 + 6x2

subject to

2x1 + 3x2 ≤ 12
6x1 + 5x2 ≤ 30

x1, x2 non-negative integer


Final branch and bound solution tree:

LP1
X1=3.75, Upper bound: z=35.25
X2=1.5,Z1=35.25
X1≤3 X1≥4

LP2 LP3
X1=3, X2=2,Z2=33 X1=4, X2=1.2,Z3=35.2
Lower bound
X2≤1 X2≥2

LP4 LP5
X1=4.17, X2=1,Z4=35.16 NO FEASIBLE SOLUTION

X1≤4 X1≥5

LP6 LP7
X1=4, X2=1,Z6=34 X1=5, X2=0,Z6=35
Lower bound Lower bound (optimal)

You might also like