MS (Integer Programming)
MS (Integer Programming)
MODELS
Learning Objectives
• Formulate integer programming (IP) models.
• Set up and solve IP models using Excel’s
Solver.
• Understand the difference between general
integer and binary integer variables
• Understand use of binary integer variables in
formulating problems involving fixed (or
setup) costs.
Integer Programming Models
• Some business problems can be solved only if
variables have integer values.
– Airline decides on the number of flights to operate
in a given sector must be an integer or whole
number amount.
Other examples:
– The number of aircraft purchased this year
– The number of machines needed for production
– The number of trips made by a sales person
– The number of police officers assigned to the night
shift.
Some Facts
Integer variables may be required when the model
represents a one time decision (not an ongoing
operation).
Optimal Solution:
Z = $1,055.56
x1 = 2.22 presses
x2 = 5.55 lathes
Feasible Solution Space with Integer Solution Points
Why not enumerate all the feasible integer points
and select the best one?
• Profits:
– Chandelier profit $600 / unit and
Enumeration of all
integer solutions
Pure Integer Programming
Example 1: Harrison Electric Company (7 of 8)
• Table lists the entire set of integer-valued solutions
for problem.
• By inspecting the right-hand column, optimal integer
solution is:
C = 3 chandeliers,
F = 2 ceiling fans.
• Total profit = $3,200.
• The rounded off solution:
C=4
F=1
Total profit = $3,100.
General Integer Variables Excel Solver Solution
Example 1: Harrison Electric Company (8 of 8)
Solver Options
Premium Solver for Education
Pure Integer Programming
Example 2: Boxcar Burger Restaurants (1 of 4)
• Decision Variables
X1 = Number of suburban boxcar burger restaurants
to be opened.
X2 = Number of downtown boxcar burger restaurants
to be opened.
ST :
• Problem Summary
– Schedule lifeguard over 5 consecutive days.
– Minimize the total number of lifeguards.
– Meet the minimum daily lifeguard requirements
• Decision Variables:
– Xi = the number of lifeguards scheduled to
• Objective Function:
– Minimize the total number of lifeguards scheduled
Pure Integer Programming
Example 3: Personnel Scheduling Problem (4 of 6)
To ensure that enough lifeguards are scheduled for each day,
ask which workers are on duty. For example:
X1 + X2 + X3 + X4 + X7 4 (Wendnesday)
X1 + X2 + X3 + X4 + X5 6 (Thursday)
X2 + X3 + X4 + X5 + X6 7 (Friday)
X3 + X4 + X5 + X6 + X7 9 (Saturday)
All variables are non negative integers
Pure Integer Programming
Example 3: Personnel Scheduling Problem (6 of 6)
TOTAL LIFEGUARDS 10
Required Floor
Machine Purchase
Space
Price
(sq. ft.)
Press 15 $8,000
Lathe 30 4,000
Pure Integer Programming
Example 4: Machine Shop (2 of 2)
X1, X2 0
X1 integer.
Mixed Integer Programming
Example 2: Investment Problem (1 of 2)
$250,000 available for investments providing greatest return after
one year.
Data:
Condominium cost $50,000/unit, $9,000 profit if sold after
one year.
Land cost $12,000/ acre, $1,500 profit if sold after one year.
Municipal bond cost $8,000/bond, $1,000 profit if sold after
one year.
Only 4 condominiums, 15 acres of land, and 20 municipal
bonds available.
Mixed Integer Programming
Example 2: Investment Problem (2 of 2)
Integer Programming Model:
Maximize Z = $9,000x1 + 1,500x2 + 1,000x3
subject to:
50,000x1 + 12,000x2 + 8,000x3 $250,000
x1 4 condominiums
x2 15 acres
x3 20 bonds
x2 0
x1, x3 0 and integer
x1 = condominiums purchased
x2 = acres of land purchased
x3 = bonds purchased
Models with Binary Variables
Models With Binary Variables
Binary variables restricted to values of 0 or 1.
– Three (i.e., n = 3) Texas oil firms (XT, XH, and XL) of which at
least two (that is, k = 2) must be selected.
X T + X H + XL 2
Pure Binary IP Models:
Example 1. Oil Portfolio Selection (5 of 7)
XB + XD 1
XS + XC = 1
Pure Binary IP Models:
Example 1. Oil Portfolio Selection (6 of 7)
• Condition if British Petroleum stock is included in portfolio, then
Texas-Trans Oil stock must also be in portfolio. (if-then constraints)
XB XT
or XB - XT 0
• If XB equals 0, constraint allows XT to equal either 0 or 1.
• If XB equals 1, then XT must also equal 1.
1. Website 120 55 40 25
2. Warehouse 85 45 35 20
3. Clothing department 105 60 25 --
4. Computer department 140 50 35 30
5. ATMs 75 30 30 --
• Objective function:
– Maximize the overall point score of the funded projects
• Constraints:
– See the mathematical model.
Pure Binary IP Models
Example 4: Salem City Council (4 of 6)
Max 4176X1+ 1774X2 + 2513X3 + 1928X4 + 3607X5 + 962X6 + 2829X7 + 1708X8 + 3003X9
ST
The maximum amounts of funds to be allocated is $900,000
400X1+ 350X2 + 50X3 + 100X4 + 500X5 + 90X6 + 220X7 + 50X8 + 140X9 900
The number of new jobs created must be at least 10
7X1+ X3 + 2X5 + X6 + 8X7 + 3X8 + 2X9 10
The number of police-related activities selected is at most 3 (out of 4)
X1+ X2 + X3 + X4 3
Sports funds and music funds must be restored / not restored together
X7 - X8 = 0
CONTINUE
Pure Binary IP Models
Example 4: Salem City Council (6 of 6)
400X1+ 350X2 + 50X3 + 100X4 + 500X5 + 90X6 + 220X7 + 50X8 + 140X9 650 + MY1
X1+ X2 + X3 + X4 + X5 + X6 3 - MY2
X7 + X8 + X9 3 - MY5
X7 + X8 + X9 3 + MY5
Y1+ Y2 + Y3 + Y4 + Y5 2
Exhibit 5.19
The Fixed Charge Location Problem
• In the Fixed Charge Problem we have:
where:
C is a variable cost, and F is a fixed cost
CX + F If X > 0
Total Cost = 0 If X = 0
Fixed Charge Problems:
Example 2: Hardgrave Machine Company –Location (1 of 9)
• Produces computer components at its plants in Cincinnati and
Pittsburgh.
– Plants are not able to keep up with demand for orders at
warehouses in Detroit, Houston, New York, and Los Angeles.
– Firm is to build a new plant to expand its productive capacity.
– Sites being considered are Seattle, Washington and
Birmingham.
• Table presents -
– Production costs and capacities for existing plants and demand
at each warehouse.
– Estimated production costs of new (proposed) plants.
• Transportation costs from plants to warehouses are also
summarized in the Table
Fixed Charge Problems
Example 2: Hardgrave Machine Company (2 of 9)
Fixed Charge Problems:
Example 2: Hardgrave Machine Company (3 of 9)
Fixed Charge Problems:
Example 2: Hardgrave Machine Company (4 of 9)
• Monthly fixed costs are $400,000 in Seattle and
$325,000 in Birmingham
• Which new location will yield lowest cost in
combination with existing plants and warehouses?
• Unit cost of shipping from each plant to warehouse is
found by adding shipping costs to production costs
• Solution must consider monthly fixed costs of
operating new facility.
Fixed Charge Problems
Example 2: Hardgrave Machine Company (5 of 9)
• Use binary variables for each of the two locations.
YS = 1 if Seattle selected as new plant.
= 0 otherwise.
YB = 1 if Birmingham is selected as new plant.
= 0 otherwise.
• Use binary variables for representative quantities.
Xij = # of units shipped from plant i to warehouse j
where
i = C (Cincinnati), K (Kansas City), P ( Pittsburgh),
S ( Seattle), or B (Birmingham)
j = D (Detroit), H (Houston), N (New York), or
L (Los Angeles)
Fixed Charge Problems
Example 2: Hardgrave Machine Company (6 of 9)
• Objective: minimize total costs =
$73XCD + $103XCH + $88XCN + $108XCL + $85XKD +
$80XKH + $100XKN + $90XKL + $88XPD + $97XPH +
$78XPN + $118XPL + $84XSD + $79XSH + $90XSN +
$99XSL + $113XBD + $91XBH + $118XBN + $80XBL +
$400,000YS + $325,000YB
• Last two terms in above expression represent fixed costs.
• Costs incurred only if plant is built at location that has
variable Yi = 1.
Fixed Charge Problems
Example 2: Hardgrave Machine Company (7 of 9)
• Flow balance constraints at plants and warehouses:
Net flow = (Total flow in to node) - (Total flow out of node)
• Flow balance constraints at existing plants (Cincinnati, Kansas
City, and Pittsburgh) :
(0) - (XCD + XCH + XCN + XCL) = -15,000 (Cincinnati supply)
(0) - (XKD + XKH + XKN + XKL) = -6,000 (Kansas City supply)
(0) - (XPD + XPH + XPN + XPL) = -14,000 (Pittsburgh supply)
• Flow balance constraint for new plant - account for the 0,1
(Binary) YS and YB variables:
(0) - (XSD + XSH + XSN + XSL) = -11,000YS (Seattle supply)
(0) - (XBD + XBH + XBN + XBL) = -11,000YB (Birmingham
supply)
Fixed Charge Problems
Example 2: Hardgrave Machine Company (8 of 9)
Production
Amounttime used atbyeach
received plant cannot
a distribution exceed
center the exceed
cannot time available:
its
demand or be less than 70%
6X1 of its demand
+ 6Z1 640
For G50 7X2 + 8Z2 960 For G90
X11 + X21 + X31 + X41 < 20 Z11 + Z21 +Z31 + Z41 < 50
9X3 + 7Z3 480
X11 + X21 + X31 + X41 > 14 Z11 + Z21 + Z31 + Z41 > 35
X12 + X22 + X32 + X42 <5X4
30 + 9Z4 640Z12 + Z22 + Z32 + Z42 < 60
X12 + X22 + X32 + X42 > 21 Z12 + Z22 + Z32 + Z42 > 42
X13 + X23 + X33
All +the
X43variables
< 50 Z13 + Z23 + Z33 + Z43 < 70
are non negative
X13 + X23 + X33 + X43 > 35 Z13 + Z23 + Z33 + Z43 > 49
AA portion
portion ofof the
the WINQSB
WINQSB optimal
optimal solution
solution
Solution summary:
• Note that the fixed cost of operating the plants was not included in the
objective function because all the plants remain operational.
Ensure that the amount shipped from a plant equals the amount produced in a plant
Amounttime
Production received
used atbyeacha distribution
plant cannotcenter cannot
exceed the exceed its
time available:
demand or be less 6X1 than
+ 6Z1 70% of its demand
- 640Y1 0
For G50 For G90
7X2 + 8Z2 - 960Y2 0
X11 + X21 + X31 + X41 < 20 Z11 + Z21 +Z31 + Z41 < 50
9X3 + 7Z3 - 480Y3 0Z11 + Z21 + Z31 + Z41 > 35
X11 + X21 + X31 + X41 > 14
5X4
X12 + X22 + X32 + <9Z4
+ X42
30 - 640Y4 0Z12 + Z22 + Z32 + Z42 < 60
X12 + X22 + X32 + X42 > 21 Z12 + Z22 + Z32 + Z42 > 42
X13 + X23 + X33 + X43 < 50
All Xij, X>i, Z35ij,
X13 + X23 + X33 + X43
Zi > 0, and YZ13
i
+ Z23 + Z33 + Z43 < 70
are 0,1.
Z13 + Z23 + Z33 + Z43 > 49
AA portion
portion ofof the
the WINQSB
WINQSB optimal
optimal solution
solution
Solution Summary:
• The Philadelphia plant should be closed.