You are on page 1of 41

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

Linear Program: Integer Program:

Max 3x1 + 2x2 Max 3x1 + 2x2


s.t. 3x1 + x2 < 9 s.t. 3x1 + x2 < 9
x1 + 3x2 < 7 x1 + 3x2 < 7
-x1 + x2 < 1 -x1 + x2 < 1
x 1, x 2 > 0 x1, x2 > 0 and integer
Graphical representation
x2

3 Z= 3x1 + 2x2

2 Optimal (2.5, 1.5)

x1
1 2 3
LP Relaxation: x1 = 2.5, x2 = 1.5, Z= 10.5
Graphical representation
x2

3 Z= 3x1 + 2x2

2 Optimal (2.5, 1.5)

x1
1 2 3
LP Relaxation: x1 = 2.5, x2 = 1.5, Z= 10.5
Graphical representation
x2

3 Z= 3x1 + 2x2

2 Infeasible solution (3, 2)


Optimal (2.5, 1.5)
1
Not optimal solution (2, 1)

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)

Some K of these constraints must hold:

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:

Maximize Z = 9x1 + 5x2 + 6x3 + 4x4

Subject to: 6x1 + 3x2 + 5x3 + 2x4 <10


x3 + x4 < 1 (at most)
x3 - x1 < 0 (if x3 then x1)
x4 - x2 < 0 (if x4 then x2)
xj = {0,1}, j=1,2,3,4
2.5. Capital Budgeting Problem
(Knapsack Type)
¨ Stockco Co. is considering four investments. It has $14,000
available for investment.
Investment Choice 1 2 3 4
Cash Outflow $5000 $7000 $4000 $3000
NPV $16000 $22000 $12000 $8000
¨ Formulate an IP model to maximize the NPV obtained from the
investments
¨ IP:
Maximize z = 16x1 + 22x2 + 12x3 + 8x4
Subject to 5x1 + 7x2 + 4x3 + 3x4 £ 14
x1, x2,,x3, x4 = {0, 1}
2.6. Set Covering and Set
Partitioning Problems
¨ Let Si be the set of all activities that possess
characteristic i. At least one member of the set Si must
be included among the chosen activities

¨ Set partitioning: exactly one member of each set Si


must be included among the chosen activities
Example: Western Airlines
¨ Western Airlines has decided to have hubs in USA.
¨ Western runs flights between the following cities: Atlanta, Boston, Chicago,
Denver, Houston, Los Angeles, New Orleans, New York, Pittsburgh, Salt Lake
City, San Francisco, and Seattle.
¨ Western needs to have a hub within 1000 miles of each of these cities.
¨ Determine the minimum Cities within 1000 miles
Atlanta (AT) AT, CH, HO, NO, NY, PI
number of hubs ?
Boston (BO) BO, NY, PI
Chicago (CH) AT, CH, NY, NO, PI
Denver (DE) DE, SL
Houston (HO) AT, HO, NO
Los Angeles (LA) LA, SL, SF
New Orleans (NO) AT, CH, HO, NO
New York (NY) AT, BO, CH, NY, PI
Pittsburgh (PI) AT, BO, CH, NY, PI
Salt Lake City (SL) DE, LA, SL, SF, SE
San Francisco (SF) LA, SL, SF, SE
Seattle (SE) SL, SF, SE
Formulation of Set Covering Problems
Decision Variables:
xi = 1 if a hub is located in city i
xi = 0 if a hub is not located in city i
Minimize xAT + xBO + xCH + xDE + xHO + xLA + xNO + xNY + xPI + xSL + xSF + xSE
subject to AT BO CH DE HO LA NO NY PI SL SF SE Required
AT 1 0 1 0 1 0 1 1 1 0 0 0 xAT >= 1
BO 0 1 0 0 0 0 0 1 1 0 0 0 xBO >= 1
CH 1 0 1 0 0 0 1 1 1 0 0 0 xCH >= 1
DE 0 0 0 1 0 0 0 0 0 1 0 0 xDE >= 1
HO 1 0 0 0 1 0 1 0 0 0 0 0 xHO >= 1
LA 0 0 0 0 0 1 0 0 0 1 1 0 xLA >= 1
NO 1 0 1 0 1 0 1 0 0 0 0 0 xNO >= 1
At least
NY 1 1 1 0 0 0 0 1 1 0 0 0 xNY >= 1
PI 1 1 1 0 0 0 0 1 1 0 0 0 xPI >= 1
SL 0 0 0 1 0 1 0 0 0 1 1 1 xSL >= 1
SF 0 0 0 0 0 1 0 0 0 1 1 1 xSF >= 1
SE 0 0 0 0 0 0 0 0 0 1 1 1 xSE >= 1
Summary
¨Either… or: choose 1 or more options (with or
without LB or UB)
¨Or: choose 1 option (options)
¨K out of N
¨At most
¨If …then
¨At least (set covering)
¨Exactly 1 (partitioning)
3. Applications of Binary Variables
¨ Making “yes-or-no” type decisions
¨ Build a factory?
¨ Manufacture a product?
¨ Assign a person to a task?
¨ Logical constraints
¨ Alternative constraints
¨ Conditional constraints
¨ Either-or constraints
¨ Production must either be 0 or ≥ 100.
¨ Subset of constraints
¨ meet 3 out of 4 constraints.
¨ Representing non-linear functions: piecewise linear representation
¨ Set-covering, and set partitioning
¨ Make a set of assignments that “cover” a set of requirements.
¨ Partition a set into subsets meeting given requirements
Some Other Applications
¨ Investment Analysis
¨ Should we make a certain fixed investment?
¨ Examples: Turkish Petroleum Refineries (1990), South African National
Defense Force (1997), Grantham, Mayo, Van Otterloo and Company
(1999)
¨ Site Selection
¨ Should a certain site be selected for the location of a new facility?
¨ Example: AT&T (1990)
¨ Designing a Production and Distribution Network
¨ Should a certain plant remain open? Should a certain site be selected for a
new plant? Should a distribution center remain open? Should a certain site
be selected for a new distribution center? Should a certain distribution
center be assigned to serve a certain market area?
¨ Examples: Ault Foods (1994), Digital Equipment Corporation (1995)
Some Other Applications
¨ Dispatching Shipments
¨ Should a certain route be selected for a truck? Should a certain size truck be
used? Should a certain time period for departure be used?
¨ Examples: Quality Stores (1987), Air Products and Chemicals, Inc. (1983),
Reynolds Metals Co. (1991), Sears, Roebuck and Company (1999)
¨ Scheduling Interrelated Activities
¨ Should a certain activity begin in a certain time period?
¨ Examples: Texas Stadium (1983), China (1995)
¨ Scheduling Asset Divestitures
¨ Should a certain asset be sold in a certain time period?
¨ Example: Homart Development (1987)
¨ Airline Applications:
¨ Should a certain type of airplane be assigned to a certain flight leg? Should
a certain sequence of flight legs be assigned to a crew?
¨ Examples: American Airlines (1989, 1991), Air New Zealand (2001)
3. Methods To Solve IPs

¨Branch and Bound


¨ Binary Integer Programs
¨ Integer Programs
¨ Mixed Integer (Real) Programs
¨Cutting Planes
Basic Concepts of Branch and Bound
 The basic concept underlying the branch-and-bound technique
is to DIVIDE and CONQUER.
 The original “large” problem is hard to solve directly, it is divided
into smaller and smaller subproblems until these subproblems
can be conquered.
 The dividing (branching) is done by partitioning the entire set of
feasible solutions into smaller and smaller subsets.
 The conquering (fathoming) is done partially by
(i) giving a bound for the best solution in the subset;
(ii) discarding the subset if the bound indicates that it can’t contain
an optimal solution.
There are 3 steps: branching, bounding and fathoming.
Solving BIP by Branch-and-Bound Algorithm
For the BIP Problem.
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 “sub-problem” for performing the
first full iteration
below.
Steps for each iteration:
1. Branching: Among the remaining (unfathomed) sub-problems,
select the one that was created most recently. (Break ties
according to which has the larger bound.) Branch from the node
for this sub-problem to create two new sub-problems by fixing the
next variable (the branching variable) at either 0 or 1.
Solving BIP by B&B Algorithm (Cont.)
2. Bounding: For each new sub-problem, obtain its bound by applying the
simplex method to its LP relaxation and rounding down the value of Z for the
resulting optimal solution.
3. Fathoming: For each new sub-problem, apply the three fathoming tests, and
discard those sub-problems that are fathomed (by testing).
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: B&B for BIPs

Max Z = 9x1 + 5x2 + 6x3 + 4x4

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)

Z= 32, (1,1) Z*=32


Practice 2

¨Maximize Z = 10x1 + 25x2,


¨subject to
19x1 - 6x2 <= 15
5x1 + 15x2 <= 15
x1, x2 are binary.
PRACTICE 2

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)

You might also like