ENMG
604
Deterministic Optimization:
Models & Methods
Ali A. Yassine, Ph.D.
Engineering Management Program
American University of Beirut
ali.yassine@aub.edu.lb
LP Intro. & Graphical Solution
– Optimization Basics
– Geometry of LPs illustrated on GTC
– Graphical Sensitivity Analysis
– Excel Solution
1
Deterministic models
- Assume all data are known with certainty
- Involve optimization
Stochastic models
- explicitly represent uncertain data via random
variables or stochastic processes.
- characterize / estimate system performance.
Most of the deterministic OR models can be formulated
as mathematical programs.
"Program", in this context, has to do with a plan (not a computer program).
Mathematical Program
Maximize / minimize z = f(x1, x2,…, xn)
Subject to gi (x1, x2,…, xn)
{} ≤
≥
=
bi i =1,…,m
Xj ≥ 0 j = 1,…,n
2
• xj are called decision variables. These are things that
you control.
• g i (x 1 ,x 2 ,…, x n )
{} ≤
≥
=
b i are called structural
(or functional or technological) constraints.
• x j > 0 are non-negativity constraints.
-
• f(x1, …, xn) is the objective function.
Linear Programming
A linear program is a special case of a mathematical program;
i.e., f and g1,…, gm are linear functions.
Linear Program:
Maximize/minimize z = c 1 x 1 + c 2 x 2 + • • • + cnxn
Subject to a i1 x 1 + a i2 x 2 + …+ a in x n
{}≤
≥
=
bi , i = 1,…,m
x j ≤ u j, j = 1,…,n
xj ≥ 0, j = 1,…,n
3
(i) activity j’s contribution to obj fcn is c jx j
usage in constraint i a ij x j
both are proportional to the level of activity j
(volume discounts, set-up charges, and nonlinear
efficiencies are potential sources of violation)
1
(ii) no "cross terms", e.g., x x
2 1 5 , may not appear in
the objective or constraints.
(iii) fractional values for decision variables are
permitted
(iv) the data in a ij , c j , b i , and u j are known with
certainty
Nonlinear programming and integer programming are
Needed when we cannot satisfy some combination of
(i), (ii), and (iii).
Stochastic models must be used when a problem has
significant uncertainties in the data that must be
explicitly incorporated in the model ( a relaxation of
assumption (iv) )
4
Data for the GTC Problem
Want to determine the number of wrenches and pliers to produce
given the available raw materials, machine hours and demand.
In order to formulate this problem
as an LP:
1.Define the Decision Variables (DVs) that we seek to determine
2. Build the Objective Function (OF), which the goal that we seek
to optimize
2. Construct the Constraints that we need to satisfy
5
( )
x1
.
.
.
• A feasible solution x = satisfies the
xn
constraints (both structural and non-negativity)
• The objective function ranks the feasible solutions
• Optimal feasible solution or simply optimal solution
is the best feasible solution
Formulating the GTC Problem
P = number of pliers manufactured
W = number of wrenches manufactured
Maximize Profit = .4 W + .3 P
Steel: 1.5 W + P ≤ 15,000
Molding: W + P ≤ 12,000
Assembly: 0.4 W + 0.5 P ≤ 5,000
Wrench Demand: W ≤ 8,000
Pliers Demand: P ≤ 10,000
Non-negativity: P,W ≥ 0
6
Reformulation
P = number of 1000s of pliers manufactured
W = number of 1000s of wrenches manufactured
Maximize Profit = 400 W + 300 P
Steel: 1.5 W + P ≤ 15
Molding: W + P ≤ 12
Assembly: 0.4 W + 0.5 P ≤ 5
Wrench Demand: W ≤ 8
Pliers Demand: P ≤ 10
Non-negativity: P,W ≥ 0
Characteristics of Solutions to LPs
A Graphical Solution Procedure (LP’s with 2 decision variables
can be solved/viewed this way.)
1. Plot each constraint as an equation and then decide which
side of the line is feasible (if it’s an inequality).
2. Find the feasible region.
3. Plot two iso-profit (or iso-cost) lines.
4. Imagine sliding the iso-profit line in the direction of
Improving objective. The “last point touched” as the sliding
iso-profit line leaves the feasible region is optimal.
7
Graphing the Feasible Region
P
We will construct and shade
14
the feasible region one or
two constraints at a time.
12
10
8
6
4
2
W
2 4 6 8 10 12 14
Graphing the Feasible Region
P
14
12
Graph the Constraint:
10
1.5 W + P ≤ 15
8
6
4
2
W
2 4 6 8 10 12 14
8
Graphing the Feasible Region
P
14
12
10
Graph the Constraint:
W + P ≤ 12
8
6
4
2
W
2 4 6 8 10 12 14
Graphing the Feasible Region
P
14
12
Graph the Constraint:
10
0.4 W + 0.5 P ≤ 5
8
What happened to the
6
constraint :
4
W + P ≤ 12?
2
W
2 4 6 8 10 12 14
9
Graphing the Feasible Region
P
14
12
10
8
Graph the Constraints:
6
W ≤ 8
4
P ≤ 10
2
W
2 4 6 8 10 12 14
How do we find an optimal solution?
P
14
12
Maximize z = 400W + 300P
10
8
It is the largest value of
q such that
6
400W + 300P = q has a
4
feasible solution
2
W
2 4 6 8 10 12 14
10
How do we find an optimal solution?
P
14
12
Maximize z = 400W + 300P
10
8
Is there a feasible solution
with
6
z = 400W + 300P = 1200?
4
z=1200
2
W
2 4 6 8 10 12 14
How do we find an optimal solution?
P
14
Maximize z = 400W + 300P
12
10
Is there a feasible
z=3600 solution with z = 2400?
8
z =2400
6
Is there a feasible
4
solution with z = 3600?
2
W
2 4 6 8 10 12 14
11
How do we find an optimal solution?
P
14
Maximize z = 400W + 300P
12
10
Can you see what the
8
z = 3600 optimal solution will be?
6
z = 2400
4
2
W
2 4 6 8 10 12 14
How do we find an optimal solution?
P
Maximize z = 400W + 300P
14
12
What characterizes the
optimal solution?
10
What is the optimal solution
8
vector? W = ? P = ?
6
What is its solution value?
4
z = ?
2
W
2 4 6 8 10 12 14
12
Optimal Solution Structure
P Binding constraints
Maximize z = 400W + 300P
1.5 W + P ≤ 15
14
.4W + .5P ≤ 5
12
plus other constraints
10
8
A constraint is said to be binding
if it holds with equality at the
6
optimum solution.
4
Other constraints are non-binding
2
W
2 4 6 8 10 12 14
How do we find an optimal solution?
Optimal solutions occur at
P corner points. In two
dimensions, this is the
intersection of 2 lines.
14
Maximize z = 400W + 300P
12
1.5W + P = 15
10
.4W + .5P = 5
8
Solution:
6
.7W = 5, W = 50/7
4
P = 15 - 75/7 = 30/7
z = 29,000/7 = 4,142 6/7
2
W
2 4 6 8 10 12 14
13
Finding an optimal solution in
two dimensions: Summary
• The optimal solution (if one exists) occurs at a “corner point” of
the feasible region.
• In two dimensions with all inequality constraints, a corner point
is a solution at which two (or more) constraints are binding.
• There is always an optimal solution that is a corner point
solution (if a feasible solution exists).
• More than one solution may be optimal in some situations
Possible Outcomes of an LP
1. Infeasible – feasible region is empty; e.g., if the
constraints include
x 1 + x 2 ≤ 6 and x 1 + x 2 ≥ 7
2. Unbounded - Max 15x 1 +15x 2 (no finite optimal solution)
s.t. x1 + x2 ≥ 1
x1 , x 2 ≥ 0
3. Multiple optimal solutions - max 3x 1 + 3x 2
s.t. x 1 +x 2 ≤1
x 1, x 2 ≥0
4. Unique Optimal Solution.
Note: multiple optimal solutions occur in many practical (real-world) LPs.
14
x2
Maximize z = x1 + x2
4 subject to 3x1 + x2 ≥ 6
3 3x1 + x2 ≤ 3
2
x1 ≥ 0, x2 ≥ 0
1
0 Figure 10. Inconsistent constraint system
1 2 3 4
x1
0
x1 –4 –3 –2 –1 0 Maximize z = x1 + x2
0
–1 subject to x1 – 2x2 ≥ 0
–2
–x1 +x2 ≥ 1
–3
x1 ≥ 0, x2 ≥ 0
–4
x2
Figure 11. Constraint system allowing only nonpositive values for x1 and x2
x2
z1 z2 z3
Maximize z = 3x1 – x2
4
subject to 15x1 – 5x2 ≤ 30
3
10x1 + 30x2 ≤ 120
2
x1 ≥ 0, x2 ≥ 0
1
0 Figure 6. Example with alternate optimal solutions
0 1 2 3 4 x1
x2 z3
z2 Maximize z = –x1 + x2
z1
4
subject to –x1 + 4x2 ≤ 10
3
–3x1 + 2x2 ≤ 2
2
x1 ≥ 0, x2 ≥ 0
1
0
0 1 2 3 4 x1 Figure 7. Bounded objective function with an unbounded feasible region
15
Preview of the Simplex Algorithm
• In n dimensions, one cannot evaluate the
solution value of every extreme point
efficiently. (There are too many.)
• The simplex method finds the best solution by
a neighborhood search technique.
• Two feasible corner points are said to be
“adjacent” if they have one binding constraint
in common.
Preview of the Simplex Method
P
14
Maximize z = 400W + 300P
12
Start at any feasible extreme point.
10
Move to an adjacent extreme point
8
with better objective value.
6
Continue until no adjacent
extreme point has a better
4
objective value.
2
W
2 4 6 8 10 12 14
16
Sensitivity Analysis
The study of the sensitivity of the optimal solution to changes in
model parameters.
- Changes in RHS of constraints: bj
- Changes in O.F. coefficients: ci
Sensitivity Analysis
P Suppose the pliers What is the impact on
demand is decreased the optimal solution
to 10 - Δ. value?
14
12
The shadow price of a constraint is
the unit increase in the optimal
10
objective value per unit increase in
the RHS of the constraint.
8
Changing the RHS of a non-
6
binding constraint by a small
4
amount has no impact. The
shadow price of the constraint is 0.
2
W
2 4 6 8 10 12 14
17
Preview of Sensitivity Analysis
P
Suppose slightly more steel is
14
available? 1.5W + P ≤ 15 + Δ
12
10
What is the impact on the optimal
8
solution value?
6
4
2
W
2 4 6 8 10 12 14
Shifting a Constraint
P
5 Steel is increased to 15 + Δ.
What happens to the
optimal solution?
What happens to the
4 optimal solution value?
3 W
6 7 8
18
Shifting a Constraint
P
5 Steel is increased to 15 +Δ.
What happens to the
optimal solution?
What happens to the
4 optimal solution value?
3 W
6 7 8
Finding the New Optimum Solution
Maximize z = 400W + 300P
Binding 1.5W + P = 15 + Δ
Constraints: .4W + .5P = 5
W = 50/7 +(10/7)Δ
Solution: P= 30/7 -8/7Δ
z = 29,000/7 +(1,600/7)Δ
Conclusion: If the amount of steel increases by Δ units
(for sufficiently small Δ) then the optimal objective value
increases by (1,600/7)Δ.
The shadow price of a constraint is the unit increase in the
optimal objective value per unit increase in the RHS of the
constraint.
Thus the shadow price of steel is 1,600/7 = 228 4/7.
19
Some Questions on Shadow Prices
• Suppose the amount of steel was decreased by Δ units. What is
the impact on the optimum objective value?
• How large can the increase in steel availability be so that the
shadow price remains as 228 4/7?
• Suppose that steel becomes available at $1200 per ton. Should
you purchase the steel?
• Suppose that you could purchase 1 ton of steel for $450.
Should you purchase the steel? (Assume here that this is the
correct market value for steel.)
Bounds on RHS coefficients in
Sensitivity Analysis
• Recall that the optimum solution is a corner
point, which in 2 dimensions is the solution of
2 equations in 2 variables, and the equations
are the binding constraints.
• Compute the largest changes in the RHS
coefficient so that all constraints remain
satisfied.
20
Shifting a Constraint
GTC
P
5 Steel is increased to 15 + Δ.
What happens to the
optimal solution?
Recall that W <= 8.
4
The structure of the
optimum solution
changes when Δ = .6, and
W is increased to 8
3 W
6 7 8
Changing the RHS coefficient
Increase steel from 15 to 15 + Δ
1.5 W + P ≤ 15
= 15 + Δ Binding Constraint
W + P ≤ 12
≤
0.4 W + 0.5 P = 5 Binding Constraint
W ≤ 8
P ≤ 10
P,W ≥ 0
W = 50/7 +(10/7)Δ; P= 30/7 –(8/7)Δ
21
Changing the RHS coefficient
Compute changes in the LHS of remaining constraints
1.5 W + P = 15 + Δ
W + P ≤ 80/7 + (2/7)Δ ≤ 12
= 12
0.4 W + 0.5 P ≤
= 5
W ≤
= 50/7
8 + (10/7)Δ ≤ 8
P =≤ 1030/7 – (8/7)Δ ≤ 10
50/7 +(10/7)P,W ≥ 030/7 –(8/7)Δ ≥ 0
Δ ≥ 0;
W = 50/7 +(10/7)Δ; P= 30/7 –(8/7)Δ
Changing the RHS coefficient
Compute upper and lower bounds on Δ
1.5 W + P = 15 + Δ
80/7 + (2/7)Δ ≤ 12 Δ≤ 2
≤
0.4 W + 0.5 P = 5
50/7W+ (10/7)Δ ≤ ≤ 8 8 Δ ≤ 3/5
30/7 – (8/7)Δ P≤ ≤1010 Δ ≥ -5
50/7 +(10/7)P,W 0
Δ ≥ ≥0; Δ ≥ -5
30/7 –(8/7)Δ ≥ 0 Δ ≤ 15/4
So, -5 ≤ Δ ≤ 3/5
22
Summary for changes in RHS coefficients
• Determine the binding constraints
• Determine the change in the “corner point solution” as a
function of Δ.
• Compute the largest and smallest values of Δ so that the
solution stays feasible.
• The shadow price is valid so long as the “corner point
solution” remains optimal, which is so long as it is feasible.
• If there are three binding constraints, then choose two of
these to get the two equations to solve, and the technique
still works. (But the change in the solution as a function of
Δ depends on which two constraints are chosen.)
Bounds on Cost coefficients in
Sensitivity Analysis
• Recall that the optimum solution is a corner point, which in 2
dimensions is the solution of 2 equations in 2 variables, and
the equations are the binding constraints.
• The solution has two neighboring corner point solutions
• Compute the largest changes in the cost coefficient so that
the current corner point solution has a better objective value
than its neighboring corner point solutions.
23
Shifting a Cost Coefficient
The objective is:
P
Maximize z = 400W + 300P
10
What happens to the
8
optimal solution if 300P is
replaced by (300+δ)P
6
How large can δ be for
4
your answer to stay
correct?
2
.4W + .5P = 5
W
2 4 6 8 10
GTC
Determining Bounds on Cost Coefficients
z = 400W + (300+δ) P
P W = 0; P= 10;
z = 3000 + 10 δ
10
8
W = 50/7; P= 30/7;
6
z = 29,000/7 + 30 δ /7
4
W = 8; P= 3;
2
z = 4100 + 3 δ
W
2 4 6 8 10
24
Determining Bounds on z = 29,000/7 + 30 δ /7
Cost Coefficients ≥ 4100 + 3 δ Î
δ ≥ -100/3
P W = 0; P= 10; z = 29,000/7 + 30 δ /7
z = 3000 + 10 δ ≥ 3000 + 10 δ Î
10
δ ≤ 200
8
W = 50/7; P= 30/7;
6
z = 29,000/7 + 30 δ /7
4
W = 8; P= 3;
2
z = 4100 + 3 δ
W
2 4 6 8 10
Summary: 2D Geometry helps
guide the intuition
• The Geometry of the Feasible Region
– Graphing the constraints
• Finding an optimal solution
– Graphical method
– Searching all the extreme points
– Simplex Method
• Sensitivity Analysis
– Changing the RHS
– Changing the Cost Coefficients
25
How to solve LPs using Excel Solver
26
27
Computations with Excel Add-ins
Math Programming Add-in
Where?
Download from:
www.ormm.net
Activate Excel Add-ins
Tools Menu: Add-ins
or
Add ORMM Add-in
28
Available ORMM Add-ins
Excel Worksheet with Optimal Solution
29
Sensitivity Analysis
MSR Marketing Inc.
adapted from Frontline Systems
•Need to choose ads to reach at least 1.5 million people
•Minimize Cost
•Upper bound on number of ads of each type
TV Radio Mail Newspaper
Audience Size 50,000 25,000 20,000 15,000
Cost/Impression $500 $200 $250 $125
Max # of ads 20 15 10 15
30
Formulating as a math model
Work with your partner
1. The decisions are how many ads of each type
to choose. Let x1 be the number of TV ads
selected. Let x2, x3, x4 denote the number of
radio, mail, and newspaper ads. These are
the “decision variables.”
2. What is the objective? Express the objective
in terms of the decision variables.
3. What are the constraints? Express these in
terms of the decision variables.
4. If you have time, try to find the best solution.
The MSR Marketing Problem
Minimize 500 x1 + 200 x2 + 250 x3 + 125 x4
subject to 50 x1 + 25 x2 + 20 x3 + 15 x4 ≥ 1,500
0 ≤ x1 ≤ 20
0 ≤ x2 ≤ 15
0 ≤ x3 ≤ 10
0 ≤ x4 ≤ 15
MSR Marketing
31
The pigskin problem
• Pigskin company makes footballs
• All data below is for 1000s of footballs
• Forecast demand for next 6 months
– 10, 15, 30, 35, 25 and 10
• Current inventory of footballs: 5
• Determine the production levels and inventory levels over
the next six months
– meet demand at minimum cost
– satisfy constraints
The pigskin problem (continued)
• Max Production capacity: 30 per month
• Max Storage capacity: 10 per month
• Production Cost per football for next 6 months:
– $12.50, $12.55, $12.70, $12.80, $12.85, $12.95
• Holding cost: $.60 per football per month
• With your partner: write an LP to describe the problem.
32
On the formulation
• Choose decision variables.
– Let xj = the number of footballs produced in
month j (in 1000s)
– Let yj = the number of footballs held in
inventory from month j to month j + 1.
(in 1000s)
– y0 = 5
• Then write the constraints and the
objective.
Pigskin Spreadsheet
33