Chapter 6 - Integer Programming
Chapter 6 - Integer Programming
¨Introduction
¨Classifications of IP Models
¨Methods to Solve IPs
1. Introduction
¨ A problem that is just like an LP except that the
variables are required to be integers, is called an
Integer Program (IP)
¨ If only some of the variables must be integers, it is
called a Mixed Integer Program (MIP)
¨ If it contains only binary (0-1) variables it is called a
Binary Integer Program (BIP)
2
Introduction (cont.)
¨ Integer programs arise whenever the decision variables
cannot be divided up
¨ Assigning people to tasks
¨ Routing trucks through a system
¨ Products that come in whole units
¨ Also in problems that contain a number of yes-or-no or on-
or-off decisions.
¨ Facility location
¨ Capital investments
¨ Design of a production and distribution network
¨ Airline applications
3
Integer Program
3 Z= 3x1 + 2x2
x1
1 2 3
LP Relaxation: x1 = 2.5, x2 = 1.5, Z= 10.5
Graphical representation
x2
3 Z= 3x1 + 2x2
x1
1 2 3
LP Relaxation: x1 = 2.5, x2 = 1.5, Z= 10.5
Graphical representation
x2
3 Z= 3x1 + 2x2
x1
1 2 3
IP Relaxation: x1 = 2.5, x2 = 1.5, Z= 10.5
2. Classifications of IP Models
Pure IP Model: Where all variables must take integer values.
Maximize z = 3x1 + 2x2
subject to x1 + x2 ≤ 6
x1, x2 ≥ 0, x1 and x2 integer
Mixed IP Model: Where some variables must be integer while others can take
real values.
Maximize z = 3x1 + 2x2
subject to x1 + x2 ≤ 6
x1, x2 ≥ 0, x1 integer
0-1 IP Model: Where all variables must take values 0 or 1 .
Maximize z = x1 - x2
subject to x1 + 2x2 ≤ 2
2x1 - x2 ≤ 1, x1, x2 = 0 or 1
Classifications of IP Models (cont.)
LP Relaxation: The LP obtained by omitting all integer or 0-1 constraints on variables
is called the LP relaxation of IP.
Integer Program:
Maximize z = 21x1 + 11x2
subject to
7x1 + 4x2 £ 13
x1, x2 ³ 0, x1 and x2 integer
LP Relaxation:
Maximize z = 21x1 + 11x2
subject to
7x1 + 4x2 £ 13
x1, x2 ³ 0
Result: Optimal obj. func. value of IP £ Optimal obj. func. value of LP relaxation
Some Special Formulations
2.1. Either-Or Constraints
Example: Dorian Auto
¨Dorian Auto is considering manufacturing three types of auto:
compact, midsize, large.
¨Resources required and profits obtained from these cars are given
below.
¨We have 6,000 tons of steel and 60,000 hours of labor available.
¨If any car is produced, we must produce at least 1,000 units of that
car.
Compact Midsize Large
Steel Req. 1.5 tons 3 tons 5 tons
Labor Req. 30 hours 25 hours 40 hours
Profit $2000 $3000 $4000
¨Find a production plan to maximize the profit.
Dorian Auto(cont.)
Decision Variables:
x1, x2, x3 = number of compact, midsize and large cars produced
y1, y2, y3 = 1 or 0 if compact , midsize and large cars are produced or not
Formulation:
Maximize z = 2x1 + 3x2 + 4x3
Subject to
1.5 x1 + 3x2 + 5x3 £ 6000
30 x1 + 25x2 + 40 x3 £ 60000
x1 £ My1; x2 £ My2; x3 £ My3
1000 - x1 £ M(1-y1)
1000 - x2 £ M(1-y2)
1000 - x3 £ M(1-y3)
x1, x2, x3 ³ 0 and integer; y1, y2, y3 = 0 or 1
2.2. K out of N constraints must hold
(K<N)
f1<=d1+M(1-y1)
f2<=d2+M(1-y2)
fN<=dN+M(1-yN)
Sum yi =K
2.3. Functions with N possible values
Example: Wyndor Glass Co.
¨ The Wyndor Glass Co. problem has a constraint of 18 hours of
production time per week in Plant 3 available for the two new products
or for certain future products that will be ready for production soon. In
order to leave any remaining capacity in usable blocks for these future
products, management now wants to impose the restriction that the
production time used by the two current new products be 6 or 12 or 18
hours per week. This constraint of the original model for 2 new
products is(3x1 + 2x2 <= 18). Now, this constraint becomes:
2.4. Conditional Constraints or Options
Example 1: Fixed Charge Problem
¨ Gandhi cloth company manufactures three types of clothing: shirts,
shorts, and pants
¨ Machinery must be rented on a weekly basis to make each type of
clothing. Rental Cost:
¨ $200 per week for shirt machinery
¨ $150 per week for shorts machinery
¨ $100 per week for pants machinery
¨ There are 150 hours of labor available per week and 160 square
yards of cloth
Labor hr Cloth yd Price Var. cost
Shirts 3 4 $12 $6
Shorts 2 3 $8 $4
Pants 6 4 $15 $8
¨ Find a solution to maximize the weekly profit
Fixed Charge Problem
Decision Variables:
x1 = number of shirts produced each week
x2 = number of shorts produced each week
x3 = number of pants produced each week
y1 = 1 if shirts are produced and 0 otherwise
y2 = 1 if shorts are produced and 0 otherwise
y3 = 1 if pants are produced and 0 otherwise
Formulation:
Max. z = 6x1 + 4x2 + 7x3 - 200y1 - 150 y2 - 100y3
Subject to
3x1 + 2x2 + 6x3 £ 150
4x1 + 3x2 + 4x3 £ 160
x1 £ M y1, x2 £ M y2, x3 £ M y3
x1, x2,,x3 ³ 0, and integer; y1, y2,,y3 = 0 or 1
Example 2: Cal Aircraft Co. (if)
¨ Cal Aircraft considers to:
¨ Build new factory in Los Angeles, San Francisco, or both.
¨ Build new warehouse (only one).
¨ Warehouse must be built close to city of a new factory.
What are the constraints between decisions?
¨ LA factory(x1), SFO factory(x2), LA warehouse(x3),SFO warehouse (x4)
¨ No more than one warehouse:
At most 1 of {x3 , x4}
x3 + x4 < 1
¨ Warehouse in LA only if Factory is in LA:
x3 implies x1
X3<=x1
x3 – x1 < 0
¨ Warehouse in SFO only if Factory is in SFO:
x4 implies x2
x -x <0
Cal Aircraft Manufacturing Company
Complete binary integer program:
Subject to:
6x1 + 3x2 + 5x3 + 2x4 ≤ 10
x3 + x4 ≤ 1
-x1 + x3 ≤ 0
-x2 + x4 ≤ 0
xi ≤ 1, xi ≥ 0, xi integer
Solution Tree
Z*=-inf
x =(0, 1, 0, 1) x = (1, 0, 4/5,0)
Incumbent,
Z*=9
(0.83,1,0,1)
x = (1, 1, 0,1/2)
x =(1, 4/5,0, 4/5)
x =(1, 1, 0, 1/2)
Practice 1
¨Maximize z = 21x1 + 11x2
subject to
7x1 + 4x2 £ 13
1³x1, x2 ³ 0; = x1,x2 binary
x1 and x2 integer
Z* =-
All F(3)
X1 X2
F(3)
0
26 25, (0,1) z* =25 F(2)
0
Z*= - 1
26, (1,0.67) F(2)
Solving MIP by B & B Algorithm.
Initialization: Set Z* =-∞. Apply the bounding step, fathoming step, and
optimality test described below to the whole problem. If not fathomed,
classify this problem as the one remaining subproblem for performing the
first full it-eration below.
Steps for each iteration:
1. Branching: Among the remaining (unfathomed) subproblems, select the
one that was created most recently. (Break ties according to which has the
larger bound.) Among the integer-restricted variables that have a noninteger
value in the optimal solution for the LP relaxation of the subproblem, choose
the first one in the natural ordering of the variables to be the branching
variable. Let xj be this variable and xj* its value in this solution. Branch from
the node for the subproblem to create two new subproblems by adding the
respective constraints xj≤[xj*] and xj ≥[xj*] + 1.
Solving MIP by B & B Algorithm (Cont.)
2. Bounding: For each new subproblem, obtain its bound by applying the simplex
method (or the dual simplex method when reoptimizing) to its LP relaxation and
using the value of Z for the resulting optimal solution.
3. Fathoming: For each new subproblem, apply the three fathoming tests given
below,and discard those subproblems that are fathomed by any of the tests.
Test 1 (F1) : Its bound Z*, where Z* is the value of Z for the current incumbent.
Test 2 (F2): Its LP relaxation has no feasible solutions.
Test 3 (F3): The optimal solution for its LP relaxation has integer values for the
integer-restricted variables. (If this solution is better than the incumbent, it
becomes the new incumbent and test 1 is reapplied to all unfathomed
subproblems with the new larger Z*.)
Optimality test: Stop when there are no remaining subproblems; the current
incumbent is optimal. Otherwise, perform another iteration.
Example for MIP
Max Z = 4x1 - 2x2 + 7x3 - x4
Subject to:
x1 + 5x3 ≤ 10
x1 + x2 - x 3 ≤ 1
6x1 - 5x2 ≤ 0
-x1 + 2x3 – 2x4 ≤ 3
xi ≥ 0, xi integer x1, x2, x3,
Example for MIP (Cont.)
Incumbent: x = (0,0,2,0.5) Z*=13.5
x = (5/6,1,11/6,0)
x = (1,1.2,1.8,0)
Z*=-
x = (5/6,2,11/6,0)
x = (1.25,1.5,1.75,0)