Lecture 23
Lecture 23
Lecture 23
2
Introduction to Linear Programming
The Importance of Linear Programming
– Many real world problems lend themselves to linear
programming modeling.
– Many real world problems can be approximated by
linear models.
– There are well-known successful applications in:
Manufacturing
Marketing
Finance (investment)
Advertising
Agriculture
3
Introduction to Linear Programming
The Importance of Linear Programming
– There are efficient solution techniques that solve
linear programming models.
– The output generated from linear programming
packages provides useful “what if” analysis.
4
Introduction to Linear Programming
Assumptions of the linear programming
model
– The parameter values are known with certainty.
– The objective function and constraints exhibit
constant returns to scale.
– There are no interactions between the decision
variables (the additivity assumption).
– The Continuity assumption: Variables can take on
any value within a given feasible range.
5
The Galaxy Industries Production
Problem –
A Prototype Example
Galaxy manufactures two toy doll
models:
– Space Ray.
– Zapper.
Resources are limited to
– 1000 pounds of special plastic.
– 40 hours of production time per week.
6
The Galaxy Industries Production
Problem –
A Prototype Example
Marketing requirement
– Total production cannot exceed 700 dozens.
– Number of dozens of Space Rays cannot exceed
number of dozens of Zappers by more than 350.
• Technological input
– Space Rays requires 2 pounds of plastic and
3 minutes of labor per dozen.
– Zappers requires 1 pound of plastic and
4 minutes of labor per dozen.
7
The Galaxy Industries Production
Problem –
A Prototype Example
The current production plan calls for:
– Producing as much as possible of the more profitable product,
Space Ray ($8 profit per dozen).
– Use resources left over to produce Zappers ($5 profit
per dozen), while remaining within the marketing guidelines.
9
The Galaxy Linear Programming Model
Decisions variables:
– X1 = Weekly production level of Space Rays
(in dozens)
– X2 = Weekly production level of Zappers (in
dozens).
Objective Function:
– Weekly profit, to be maximized 10
The Galaxy Linear Programming Model
FEASIBLE REGION
12
Using a graphical presentation
we can represent all the constraints,
the objective function, and the three
types of feasible points.
13
Graphical Analysis – the Feasible
Region
X2
X1
14
Graphical Analysis – the Feasible
Region
X2
Infeasible
Production Feasible
Time
3X1+4X2 £ 2400 X1
500 700
15
Graphical Analysis – the Feasible
Region
X2
1000 The Plastic constraint
2X1+X2 £ 1000
700 Total production constraint:
X1+X2 £ 700 (redundant)
500
Infeasible
Production mix
constraint:
Production Feasible X1-X2 £ 350
Time
3X1+4X2£ 2400
X1
500 700
Boundary points.
Interior points. Extreme points.
• There are three types of feasible 16
Solving Graphically for an
Optimal Solution
17
The search for an optimal solution
Start
X2 at some arbitrary profit, say profit = $2,000...
1000 Then increase the profit, if possible...
...and continue until it becomes infeasible
X1
18
500
Summary of the optimal solution
Space Rays = 320 dozen
Zappers = 360 dozen
Profit = $4360
– This solution utilizes all the plastic and all the
production hours.
by only 40 dozens.
19
Extreme points and optimal solutions
20
Multiple optimal solutions
• For multiple optimal solutions to exist, the
objective function must be parallel to one of
the constraints
• Any weighted average of
optimal solutions is also
an optimal solution.
21
2.4 The Role of Sensitivity
Analysis of the Optimal
Is the optimalSolution
solution sensitive to changes in
input parameters?
22
Sensitivity Analysis of
Objective Function Coefficients.
Range of Optimality
– The optimal solution will remain unchanged as long as
An objective function coefficient lies within its range of
optimality
There are no changes in any other input parameters.
M
Ma ax
x 3 4X
.75 1 +
X 5X
M
1 +
ax
5X 2
8X
2
1
+
500
5X
Max
2
2X
1 + 5X
2
X1
24
500 800
Sensitivity Analysis of
Objective
X
Function Coefficients.
1000 2
M
ax
8X
Ma
2
x
10
500
Ma
X1
x3
.75
+5
X
+5
X2
1
X
2
25
400 600 800 X1
Reduced cost
Assuming there are no other changes to the input
parameters, the reduced cost for a variable Xj that
has a value of “0” at the optimal solution is:
– The negative of the objective coefficient increase of
the variable Xj (-DCj) necessary for the variable to
be positive in the optimal solution
– Alternatively, it is the change in the objective value
per unit increase of Xj.
Complementary slackness
At the optimal solution, either the value of a variable
is zero, or its reduced cost is 0.
26
Sensitivity Analysis of
Right-Hand Side Values
29
Shadow Price – graphical
demonstration
The Plastic
constraint X2
When more plastic becomes
available (the plastic constraint is
relaxed), the right hand side of the
1000
plastic constraint increases.
2X 1
Maximum profit =
2X 1
+1
+1
$4360
x2
x2
<=
Maximum profit =
<=
10
500
10
01
$4363.4
00
Shadow price =
4363.40 – 4360.00 =
3.40
Production time X1
constraint
500 30
Range of Feasibility
becomes active.
10
constraint constraint
X1 + X2 £ 700
500
This is an infeasible solution
Production time
constraint
X1
500 32
The Plastic
Range of Feasibility
constraint 2X 1 X2
1000
increases as the amount
x2
£1
of plastic increases.
00
0
500
Production time
constraint
X1
500 33
Range of Feasibility
X2
500
2X1 + 1X2 £ 1100
A new active
constraint
X1
500 34
The correct interpretation of shadow
prices
– Sunk costs: The shadow price is the
value of an extra unit of the resource, since
the cost of the resource is not included in
the calculation of the objective function
coefficient.
Addition of a constraint.
Deletion of a constraint.
Addition of a variable.
Deletion of a variable.
Changes in the left - hand side
coefficients. 36
Infeasible Model
No point, simultaneously,
lies both above line 1 and
below lines 2 and 3
2
.
3 1 37
Solver – Infeasible Model
38
Unbounded solution
th
eO Ma
xim
bje
cti i ze
Th ve
ef Fu
nc
r e ea ti o
g s
io ibl n
n e
39
Solver – An Alternate Optimal
Solution
Solver does not alert the user to the
existence of alternate optimal solutions.
Many times alternate optimal solutions
exist when the allowable increase or
allowable decrease is equal to zero.
In these cases, we can find alternate
optimal solutions using Solver by the
following procedure:
40
Solver – An Alternate Optimal
Solution
Observe that for some variable X the
j
Allowable increase = 0, or
Allowable decrease = 0.
Add a constraint of the form:
Objective function = Current optimal value.
If Allowable increase = 0, change the objective
to Maximize Xj
If Allowable decrease = 0, change the objective
to Minimize Xj
41
Cost Minimization Diet Problem
• Mix two sea ration products: Texfoods,
Calration.
• Minimize the total cost of the mix.
• Meet the minimum requirements of
Vitamin A,
Vitamin D, and Iron.
42
Cost Minimization Diet Problem
Decision variables
– X1 (X2) -- The number of two-ounce portions of
Texfoods (Calration)
product used in a serving.
The Model
Cost per 2 oz.
Minimize 0.60X1 + 0.50X2
Subject to
20X1 + 50X2 ³ 100 Vitamin A
% Vitamin A
provided per 2 oz. 25X1 + 25X2 ³ 100 Vitamin D
% required
50X1 + 10X2 ³ 100 Iron
X1, X2 ³ 0 43
The Diet Problem - Graphical solution
10
The Iron constraint
Feasible Region
44
2 4 5
Cost Minimization Diet Problem
Summary of the optimal solution
– Texfood product = 1.5 portions (= 3 ounces)
Calration product = 2.5 portions (= 5 ounces)
40
35
Eustis 30 Orlando
400,000 600,000
2 5
22
55
Clermont 20 Leesburg
300,000 225,000
3 25 6
Defining the Decision
Variables
Xij = # of bushels shipped from node i to node j
Specifically, the nine decision variables are:
MIN:
240P1+250P2+265P3+285P4+280P5+260
P6
+ 3.6(B1+B2)/2 + 3.75(B2+B3)/2 +
3.98(B
Note: 3+B4)/2 inventory in any month is
The beginning
the same as the ending inventory in the
+ 4.28(Bmonth.
previous 4+B5)/2 + 4.20(B5+ B6)/2 +
3.9(B +B )/2
Defining the Constraints - I
Production levels
2,000 <= P1 <= 4,000 } month 1
1,750 <= P2 <= 3,500 } month 2
2,000 <= P3 <= 4,000 } month 3
2,250 <= P4 <= 4,500 } month 4
2,000 <= P5 <= 4,000 } month 5
1,750 <= P6 <= 3,500 } month 6
Defining the Constraints - II
Ending Inventory (EI = BI + P - D)
1,500 < B1 + P1 - 1,000 < 6,000 } month 1
1,500 < B2 + P2 - 4,500 < 6,000 } month 2
1,500 < B3 + P3 - 6,000 < 6,000 } month 3
1,500 < B4 + P4 - 5,500 < 6,000 } month 4
1,500 < B5 + P5 - 3,500 < 6,000 } month 5
1,500 < B6 + P6 - 4,000 < 6,000 } month 6
Defining the Constraints - III
Beginning Balances
B1 = 2750
Notice that the
B2 = B1 + P1 - 1,000 Bi can be
B3 = B2 + P2 - 4,500 computed
directly from
B4 = B3 + P3 - 6,000 the Pi.
Therefore, only
B5 = B4 + P4 - 5,500 the Pi need to
B6 = B5 + P5 - 3,500 be identified
as changing
B7 = B6 + P6 - 4,000 cells.
Implementing the Model
See file Fig3-33.xlsm
A Multi-Period Cash Flow
Problem:
The Taco-Viva Sinking Fund - I
Taco-Viva needs a sinking fund to pay $800,000 in
building costs for a new restaurant in the next 6 months.
Payments of $250,000 are due at the end of months 2
and 4, and a final payment of $300,000 is due at the end
of month 6.
The following investments may be used.
Investment Available in Month Months to Maturity Yield at Maturity
A 1, 2, 3, 4, 5, 6 1 1.8%
B 1, 3, 5 2 3.5%
C 1, 4 3 5.8%
D 1 6 11.0%
Summary of Possible Cash Flows
Cash Inflow/Outflow at the Beginning of Month
Investment 1 2 3 4 5 6 7
A1 -1 1.018
B1 -1 <_____> 1.035
C1 -1 <_____> <_____> 1.058
D1 -1 <_____> <_____> <_____> <_____> <_____> 1.11
A2 -1 1.018
A3 -1 1.018
B3 -1 <_____> 1.035
A4 -1 1.018
C4 -1 <_____> <_____> 1.058
A5 -1 1.018
B5 -1 <_____> 1.035
A6 -1 1.018
Req’d Payments $0 $0 $250 $0 $250 $0 $300
Defining the Decision Variables
Ai = amount (in $1,000s) placed in investment
A at the beginning of month i=1, 2, 3, 4, 5,
6
Bi = amount (in $1,000s) placed in investment
B at the beginning of month i=1, 3, 5
Ci = amount (in $1,000s) placed in investment
C at the beginning of month i=1, 4
Di = amount (in $1,000s) placed in investment
D at the beginning of month i=1
Defining the Objective Function
MIN: A1 + B1 + C1 + D1
Defining the Constraints
Cash Flow Constraints
1.018A1 – 1A2 = 0 } month 2
1.035B1 + 1.018A2 – 1A3 – 1B3 = 250 } month 3
1.058C1 + 1.018A3 – 1A4 – 1C4 = 0 } month 4
1.035B3 + 1.018A4 – 1A5 – 1B5 = 250 } month 5
1.018A5 –1A6 = 0 } month 6
1.11D1 + 1.058C4 + 1.035B5 + 1.018A6 = 300 } month 7
Nonnegativity Conditions
Ai, Bi, Ci, Di >= 0, for all i
Implementing the Model
See file Fig3-37.xlsm
Risk Management:
The Taco-Viva Sinking Fund - II
Assume the CFO has assigned the following risk ratings to
each investment on a scale from 1 to 10 (10 = max risk)
A 1
B 3
C 8
D 6
The CFO wants the weighted average risk to not
exceed 5.
Defining the Constraints
Risk Constraints
1A1 + 3B1 + 8C1 + 6D1
A1 + B 1 + C 1 + D 1
<5 } month 1
nO
MAX: Oij w j
j 1
Defining the Constraints
Efficiency cannot exceed 100% for any unit
nO nI
Okj w j I kj v j , k 1 to the number of units
j 1 j 1
Nonnegativity Conditions
wj, vj >= 0, for all j
Important Point