IE 2252 LP Model Examples
IE 2252 LP Model Examples
INTRODUCTION TO LP MODELS - 2
1
Linear Programming Models - Continued
2
Blending Problems
• LP models used for problems in which various inputs must be
mixed (blended) in some desired proportion to produce
goods.
• Some examples:
– Blending various types of crude oils to produce different types of
gasoline
– Blending various chemicals to produce other compounds
– Blending various types of metal alloys to produce various types of
steel
3
SUNCO OIL’s problem
• Sunco Oil manufactures three types of gasolines (gas 1, gas 2 and gas 3)
by blending three types of crude oil (crude 1, crude 2 and crude 3).
• The sales and purchase prices :
Sales Price per Barrel ($) Purchase Price per Barrel ($)
Gas Crude
1 70 1 45
2 60 2 35
3 50 3 25
1 12 0.5
2 6 2.0
3 8 3.0
4
SUNCO OIL’s problem
• It costs $4 to convert one barrel of oil into one barrel of gasoline.
• Sunco also has the option of advertising to stimulate demand: Assume that
each $ spent daily in advertising for a particular type of gas increases the
demand by 10 barrels.
• For each crude oil type, the maximum amount that can be purchased is
5000 barrels daily.
5
Decision variables
• ai: dollars spent daily on advertising gas i, for i=1,2,3
6
Objective function: Max Profit
Daily revenues from gas sales:
70(x11 + x12 + x13)+ 60(x21 + x22 + x23)+ 50(x31 + x32 + x33)
Gas 1 Gas 2 Gas 3
Daily cost of purchasing crude oil:
45(x11 + x21 + x31)+ 35(x12 + x22 + x32)+ 25(x13 + x23 + x33)
Oil 1 Oil 2 Oil 3
Daily advertising costs:
a1 + a2 + a3
OBJECTIVE FUNCTION :
Max z = (70-45-4) x11+ … + (50-25-4) x33 – (a1 + a2 + a3)
7
SUNCO OIL’s problem: Constraints
• Gas 1 produced daily should be equal to its demand.
8
SUNCO OIL’s problem: Constraints
9
SUNCO OIL’s problem: Constraints
Average octane levels (at least 10, 8 and 6 required for gas 1, 2 and 3):
• If we blend 2 barrels of crude oil 1, 3 barrels of 2, and 1 barrel of 3:
(total octane)/(#barrels)=(12*2+6*3+8*1)/(2+3+1)=50/6
• Similarly, we have
(12 x11 + 6 x12 + 8 x13 ) / (x11 + x12 + x13 ) ≥ 10
12 x11 + 6 x12 + 8 x13 ≥ 10 (x11 + x12 + x13 )
• Nonnegativity: xij, ai ≥ 0
a3=0
z=287,750 13
Optimal Solution
14
Multiperiod Financial Models: Finco’s problem
• LPs can be used to model multi-period cash management problems. The
key is to determine the relations of cash on hand during different
periods.
• Finco Investment Corp. must determine investment strategy for the firm
during the next three years. Currently (time 0), $100,000 is available for
investment.
• Investment alternatives: A, B, C, D and E
• The cash flows associated with $1:
0 1
$100,000 𝑺𝑺𝒐𝒐 1.08 ∗ 𝑺𝑺𝒐𝒐 𝑺𝑺𝟏𝟏
A C D B
2 3
1.08 ∗ 𝑺𝑺𝟏𝟏 𝑺𝑺𝟐𝟐 1.08 ∗ 𝑺𝑺𝟐𝟐
16
Finco’s problem
• Finco requires that at most $75,000 be placed in a single investment.
• In addition to investments, Finco can earn interest at 8% per year by
keeping the uninvested cash in money market funds.
• Return from investments can be immediately reinvested.
• Finco cannot borrow funds, so the cash available for investment at any
time is limited to cash on hand.
• Formulate an LP that will maximize cash on hand at time 3.
Decision variables:
A: $s invested in A
B: $s invested in B
C: $s invested in C
D: $s invested in D
E: $s invested in E
St: $s invested in funds at time t; t=1,2,3
17
Cash Flow at time*
0 1 2 3
Finco’s problem A
B
-1
0
0,5
-1
1
0,5
0
1
C -1 1,2 0 0
D -1 0 0 1,9
• Objective function: E 0 0 -1 1,5
Time 3 cash on hand = B + 1.9 D + 1.5 E + 1.08 S2
max z= B + 1.9 D + 1.5 E + 1.08 S2
• Uninvested cash at time t that is carried over to time (t+1) =
Cash at time t - cash invested at time t
Subject to
“available number of employees in a day has to
be enough to meet the workforce requirement
of the day”
“number of employees start to work on any day
has to be nonnegative”
21
Workforce Planning
In the table below, for example, staff requirement of Monday
will be covered by those staffs starting working on Thursday,
Friday, Saturday, Sunday and Monday.
Mon x x x x x
Tue x x x x x
Wed x x x x x
Thu x x x x x
Fri x x x x x
Sat x x x x x
Sun x x x x x
22
Workforce Planning
Assume that 𝑠𝑠𝑠𝑠𝑠𝑠𝑠𝑠𝑠𝑠𝑖𝑖 is the number of workers starting working on day 𝑖𝑖
Minimize
start1+start2+start3+start4+start5+start6+start7
subject to
Decision Variable
24
Workforce Planning
25
Sailco Production Planning Problem
• Sailco Co. must determine how many sailboats should be produced during
each of the next four quarters.
• Demand is known: Q1: 40, Q2: 60, Q3: 75, Q4: 25.
26
Sailco Production Planning Problem
• Decision variables :
– xt : number of sailboats produced by regular time labor during quarter t
– yt : number of sailboats produced by overtime labor during quarter t
– It : number of sailboats on hand at the end of quarter t
• Parameters:
– dt : demand during period t
27
Sailco Production Planning Problem
X1 Y1 X2 Y2 X3 Y3 X4 Y4
I0=10 I1 I2 I3 I4
Q1 Q2 Q3 Q4
d1 d2 d3 d4
Xt Yt
It-1 It=It-1+Xt+Yt-dt
Qt
dt
28
Sailco Production Planning Problem
• Note that quarter t’s demand will be met on time if and only if
(iff ) It ≥ 0.
• Sailco’s constraints:
• Each period’s regular time production does not exceed 40.
• Inventory constraints for each time period.
29
Complete LP Model
subject to
x1≤40; x2≤40; x3≤40; x4≤40;
x1 + y1 + 10 - 40 = I1
x2 + y2 + I1 - 60 = I2
x3 + y3 + I2 - 75 = I3
x4 + y4 + I3 - 25 = I4
It ,xt, yt ≥ 0, t=1,2,3,4
30
Optimal Solution
40 0 40 10 40 35 25 0
10 10 0 0 0
Q1 Q2 Q3 Q4
40 60 75 25
31
Rolling Horizon
40 0 ? ? ? ? ? ?
10 ?10 ? ? ?
Q1 Q2 Q3 Q4
32
Rolling Horizon
40 0 ? ? ? ? ? ?
10 15 ? ? ?
Q1 Q2 Q3 Q5
Q4
33
Rolling Horizon Model
x2 + y2 + 15 = I2 + 60
x3 + y3 + I2 = I3 + 75
x4 + y4 + I3 = I4 + 25
x5 + y5 + I4 = I5 + 36
It ,xt, yt ≥ 0, t=2,3,4,5
34
If backlogs are allowed
X1 Y1 X2 Y2 X3 Y3 X4 Y4
B1=0 B2 B3 B4 B5=10
Q1 Q2 Q3 Q4
I0=10 I1 I2 I3 I4=0
d1 d2 d3 d4
Xt Yt
Bt Bt+1
Qt
It=It-1+Xt+Yt+Bt+1-Bt-dt
It-1
dt
35
Sailco Inventory Extension: Multi-product,
multi-period
36
Sailco Inventory Extension: Multi-product,
multi-period
• Let cit be the unit cost of manufacturing product i in normal time
during period t and oit be the corresponding unit cost for
overtime
• Let hit be the cost of having one unit of product i in the inventory
at the end of month t
38