Download as ppt, pdf, or txt
Download as ppt, pdf, or txt
You are on page 1of 79

1

IE 312 Optimization
Siggi Olafsson
3018 Black
olafsson@iastate.edu
2
Optimization
In this class you will learn to solve industrial
engineering problems by modeling them as
optimization problems
You will understand common optimization
algorithms for solving such problems
You will learn the use of software for solving
complex problems, and you will work as part
of a team to address complex ill-structured
problems with multiple solutions
3
4
Optimization Formulation
integer
05 . 15 80 . 5 20 . 4 55 . 3 35 . 3 75 . 2 15 . 2 s.t.
max
appetizer of Number
6 5 4 3 2 1
6
1
i
i
i
i
x
x x x x x x
x
i x
= + + + + +
=

=
Decision variables:
Integer programming problem:
This is a variant of what is called
the knapsack problem
5
How about the traveling
salesman?
What is the shortest route that visits each city exactly once?
6
The Process
Problem
Model
Conclusions
Problem Formulation
Analysis
7
Problem Formulation
What is the objective function?
Maximize profit,
Minimize inventory, ...
What are the decision variables?
Capacity, routing, production and stock levels
What are the constraints?
Capacity is limited by capital
Production is limited by capacity
8
Mathematical Programs
Objective/constraints
Linear Non-linear

Continuous
Linear
Programming (LP)
Non-linear
Programming
(NLP)

Discrete
Integer
Programming
(IP), Mixed IP
(MIP)
NLIP, NLMIP
9
Analysis
Optimization Algorithm
Computer Implementation
Excel (or other spreadsheet)
Optimization software (e.g., LINDO)
Modeling software (e.g., LINGO)

Increasing
Complexity
10
Optimization Algorithms
Find an initial solution
Loop:
Look at neighbors of current solution
Select one of those neighbors
Decide if to move to selected solution
Check stopping criterion
11
In This Class You Will
Learn problem formulation (modeling)
Learn selecting appropriate algorithms
Learn using those algorithms
12
Academic Honesty
You are expected to be honest in all of your actions and
communications in this class.

Students suspected of committing academic dishonesty will
be referred to the Dean of Students Office as per
University policy.

For more information regarding Academic Misconduct see
http://www.dso.iastate.edu/ja/academic/misconduct.html
13
Professionalism
You are expected to behave in a
professional manner during this class.
14
The OR Process
Problem (System)
Model
Conclusions
Problem Formulation
Analysis
15
Problem Formulation
Capture the essence of the system
Variables
Relationships
Ask ourselves:
What is the objective?
What are the decision variables?
What are the constraints?
16
Mortimer Middleman
Wholesale diamond business
sale price $900/carat
average order 55 carats/week
International market
purchase price $700/carat
minimum order 100 carats/trip
trip takes one week and costs $2000
17
Inventory Problem
Cost of keeping inventory
insurance
tied up capital
0.5% of wholesale value/week
Cost of not keeping inventory
lost sales (no backordering)
18
The Current Situation
Holding cost of $38,409 in past year
Unrealized profits of $31,600
Resupply travel cost $24,000
Total of $94,009

Can we do better?
How do we start answering that question?
19
Problem Formulation
What are the decision variables?
When should we order?
Reorder point r (quantity that trigger order)
How much should we order?
Order quantity q
Note that this grossly simplifies the reality of
Mortimers life!
20
Problem Formulation
What are the constraints?


What is the objective?
Minimize cost
Holding cost
Replenishment cost
Lost-sales cost
0
100
>
>
r
q
21
Relationships
(System Dynamics)
Assumptions
Constant-rate demand
Is this a strong or weak assumption?
Is this assumption realistic?

22
System Dynamics
r
1 week
r
1 week
r
1 week
With safety stock No safety stock or lost sales With lost sales
Why might we get lost sales despite our planning?

Can we ignore this?
23
No lost sales implies r > 55
Cycle length


Average inventory
Assuming No Lost Sales
55 rate demand
quantity order q
=
( )
2
) 55 (
2
) 55 ( ) 55 ( q
r
q r r
+ =
+ +
24
Optimization Model
55
100
55 /
2000
2
) 55 ( 50 . 3
cost/week ent Replenishm
cost/week Holding
>
>
+
|
.
|

\
|
+
r
q
q
q
r


Subject to
Minimize
25
Solving the Problem (Analysis)
Feasible solution
Any set of values that satisfies the constraints
Optimal solution
A feasible solution that has the best possible
objective function value
Algorithms:
Find a feasible solution
Try to improve on it
26
A Solution for Mortimer
What are some feasible solutions?

The smallest feasible value of r is 55
What happens if we change it to 56?
Increased holding cost!
Clearly the optimal replenishment
point is
55
*
= r
27
New Optimization Problem
100
55
2000
2
50 . 3
cost/week ent Replenishm
cost/week Holding
>
+
|
.
|

\
|
q
q
q


Subject to
Minimize
Differentiate the objective function and set equal to zero:
0
55 2000
2
50 . 3
2
=

+
q
28
Optimal Solution

=

=

=

=
7 . 250
7 . 250
50 . 3
55 2000 2
50 . 3
55 2000 2
55 2000
2
50 . 3
*
2
2
q
q
q
Optimum
29
Economic Order Quantity (EOQ)
ld r
h
f d
q
=
=
*
*
2
Classical result in inventory theory:
Lead time
(replenishment)
Weekly
demand
Holding cost
Cost of
replenishment
30
Discussion
Sensitivity Analysis
Exploring how the results change if parameters
change
Why is this important?
Closed-Form Solutions
Final result a simple formula in terms of the input
variables
Very fast computationally
Makes sensitivity analysis very easy
31
Evaluating the Model
Tractability of Model
Ease by which we can analyze the model
Validity
The degree by which inferences drawn
from model also hold for actual system
Trade-Off!
A Good Model is Tractable and Valid
32
Model Validity
A model is valid for a specific purpose
It only has to answer the questions we ask
correctly!
Recipe for a Good Model
Start with a simple model
Evaluate assumptions
Does adding complexity change the outcome?
Relax assumption/add constraint
33
Validity of Our Model
Customer demand (average 55)
0
20
40
60
80
100
120
1 3 5 7 9
1
1
1
3
1
5
1
7
1
9
2
1
2
3
2
5
2
7
2
9
3
1
3
3
3
5
3
7
3
9
4
1
4
3
4
5
4
7
4
9
5
1
Week
D
e
m
a
n
d
34
Simulation Analysis
Using the same conceptual model, we
can simulate the performance using the
historical data
Check if Mortimer is due with a shipment
Check if a new trip is warranted
Reduce inventory by actual demand
Simulation of our policy q=251, r=55
implies a cost of $108,621
35
Evaluation of Cost
Our predicted cost is




Mortimers current cost is $94,009
The simulated cost is $108,621
630 , 45 $
251
55
2000
2
251
50 . 3
cost/week ent Replenishm
cost/week Holding
= +
|
.
|

\
|


36
Simulation Validity
Which model should we trust:
The simulation model that predicts a performance of
$108,621, or
the EOQ model that predicts a performance of
$45,630?
Examine the assumptions made:
EOQ model: constant demand
Simulation: future identical to past
In general, simulation models have a high
degree of validity
37
Descriptive vs Prescriptive
How about tractability?
What does the simulation tell us? How
easy is it to do sensitivity analysis?
Descriptive models
Only evaluate an alternative or solution
Prescriptive models
Suggest a good (or optimal) alternative
38
Numerical Search
We can use our descriptive simulation
model to look for a better solution
Algorithm:
Start with an initial (good) solution
Check similar solution (neighbors)
Select one of the neighbors
Repeat until a stopping criterion is satisfied
39
Search for Reorder Point
0
10
20
30
40
50
60
70
80
90
100
0 50 100 150 200 250 300
q
r
$64,242
$63,054
$63,254
$108,421
$108,621
40
Search for Order Quantity
0
10
20
30
40
50
60
70
80
90
100
240 245 250 255 260 265
q
r
$63,054
$95,193 $72,781
Best Point Found
41
Evaluation
We have found a solution q=251, r=85
with cost $63,054
Better than current ($94,009) and
previously obtained solution ($108,621)
Is this the best solution?
We dont know!
What if we started with a different
initial solution?
42
A New Search
55
75
95
115
135
155
250 255 260 265 270 275
q
r
56,904
59,539
56,900
59,732
54,193
58,467
Initial
Solution
Best Point Found
43
Heuristic vs Optimal
Optimal Solution
Solution that is gives the best objective
function value
Heuristic Solution
A good feasible solution
Should we demand optimality?
Inaccurate search vs approximation in
model

44
Deterministic vs Stochastic
Models
Our deterministic simulation model
assumed future identical to past
Not true! Demand is random
Stochastic simulation fits a random
distribution to the historical data
The world is stochastic
Why not always use stochastic models?
Tractability versus validity
45
Mathematical Programming
Deterministic models
Assume all data known with certainty
Validity
Often produce valid results
Tractability
Easier than stochastic models
Known as mathematical
programming
46
Problem Formulation
Decision variables
Constraints
Variable-type constraints
Main constraints
Objective function
47
Two Crude Petroleum
Saudi Arabia
Venezuela
Refinery
Gasoline
Jet Fuel
Lubricants
$20
9000 barrels/day
$15
6000 barrels/day
2000
barrels
1500
barrels
500
barrels
48
Oil Processing Data
Barrel of Saudi Crude
0.3 barrels of gasoline
0.4 barrels of jet fuel
0.2 barrels of lubricant
Barrel of Venezuela Crude
0.4 barrels of gasoline
0.2 barrels of jet fuel
0.3 barrels of lubricant
49
Decision Variables
What can we control or decide upon?
How much of each crude
Thus, define



Clearly define what you mean!
nds) (in thousa crude/day Venezuelan of barrels
nds) (in thousa crude/day Saudi of barrels
2
1
=
=
x
x
50
Constraints
Variable-type constraints
Domain of decision variables
(most often a range)
Very simple here:


0 ,
2 1
> x x
51
Main Constraints (Dynamics)
Must meet our volume for each type




Availability
( )

s) (lubricant 5 . 0 3 . 0 2 . 0
fuel) (jet 5 . 1 2 . 0 4 . 0
(gasoline) 0 . 2 4 . 0 3 . 0
2 1
2 1
required
barrels el yield/barr
2 1
> +
> +
>

+

x x
x x
x x

6
9
2
1
s
s
x
x
52
Objective Function
What are we going to use to evaluate a pair
of values for the decision variables?
Minimize total cost


Note that since sales and production are fixed
this maximizes profit
2 1
15 20 min x x +
53
Standard Model
2 ,
6
9
s) (lubricant 5 . 0 3 . 0 2 . 0
fuel) (jet 5 . 1 2 . 0 4 . 0
(gasoline) 0 . 2 4 . 0 3 . 0 s.t.
2 1
2
1
2 1
2 1
2 1
>
s
s
> +
> +
> +
x x
x
x
x x
x x
x x
2 1
15 20 min x x +
54
Graphing Constraints
1
x
2
x
Variable-Type
Constraints
(must be positive)
55
Adding Main Constraints
1
x
00 . 5
4 . 0
2
, 0
67 . 6
3 . 0
2
, 0
2 4 . 0 3 . 0
2 1
1 2
2 1
= = =
= = =
> +
x x
x x
x x
2
x
56
Next Constraint
1
x
67 . 1
3 . 0
5 . 0
, 0
50 . 2
2 . 0
5 . 0
, 0
5 . 0 3 . 0 2 . 0
50 . 7
2 . 0
5 . 1
, 0
75 . 3
4 . 0
5 . 1
, 0
5 . 1 2 . 0 4 . 0
2 1
1 2
2 1
2 1
1 2
2 1
= = =
= = =
> +
= = =
= = =
> +
x x
x x
x x
x x
x x
x x
2
x
57
Final Constraints
1
x
6
2
s x
6
1
s x
Feasible
Region
2
x
58
Objective Function
1
x
2
x
2 1
15 20 x x +
60
105
150
59
Optimal Solution
1
x
2
x
5 . 92 5 . 3 15 2 20
15 20
2 1
= + =
+ x x
2
1
= x
5 . 3
1
= x
60
Variant
1
x
2
x
2
1
= x
5 . 3
1
= x
Many Optimal Solutions!
61
Types of Solutions
Unique Optimum
Multiple Optima
No Optimum
No feasible solution (empty feasible set)
Unbounded feasible set
62
Exercise
0 ,
1 . .
3 max
2 1
2 1
2 1
>
s +
+
w w
w w t s
w w
0 ,
1 . .
3 max
2 1
2 1
2 1
>
s +
+
w w
w w t s
w w
Q. Which of the above has and optimal solution
and which is unbounded?
63
Last Time
Formulated Two Crude Petroleum
Problem
Solved (Analyzed) the Model
Graphed the constraints
Found the most desirable extreme point

Can this approach be generalized to
realistic problem?
64
Pi Hybrids
Actual application
Manufacturer of Corn Seed
l=20 production facilities
m=25 hybrid varieties
n=30 sales regions
Want to look at the production and
distribution operations
65
Constants
Cost per bag of each hybrid at each facility
Processing capacity of each facility (bushels)
Bushels of corns needed for a bag of hybrid
Bags of hybrid demanded by each region
Cost per bag of shipping each hybrid from
each facility to each customer region
66
Indexing Variables
Initial structure






Have lm =500 x-variables and lmn =1500 y-variables

f h x
h f
facility at produced hybrid of bags of number
,
=
r f h y
r h f
region to from shipped of bags of number
, ,
=
m h l f ,..., 2 , 1 ; ,..., 2 , 1 = =
. ,..., 2 , 1 ; ,..., 2 , 1 ; ,..., 2 , 1 m r m h l f = = =
67
Defining Cost
Define

Then the total production cost is
f h p
h f
facility at hybrid producing of bag per cost
,
=

= =
l
f
m
h
h f h f
x p
1 1
, ,
Summing over
all facilities
Summing over
all hybrids
68
More Definitions
r f h s
r h d
h a
f u
r h f
r h
h
f
to from shipping of bag per cost
region in demanded of bags of number
hybrid of bag a for needed bushels of number
bushels in facility of capacity
, ,
,
=
=
=
=
69
Objective Function
Have
Total Cost = Production Cost + Shipping Cost

which implies an objective function

= = = = =
+
l
f
m
h
n
r
r h f r h f
l
f
m
h
h f h f
y s x p
1 1 1
, , , ,
1 1
, ,
min
70
Constraints
Capacity constraints




Demands must be met
Balance between production and distribution

=
s
m
h
f h f h
u x a
1
bags
,
g bushels/ba
. ,..., 2 , 1 l f =
71
Complete Model
0 ; 0
, ,
, ,
,
, , ,
1
, , ,
1
, , ,
1
,
> >
=
=
s

=
=
=
r h f h f
n
r
h f r h f
l
f
r h r h f
m
h
f h f h
y x
h f x y
r h d y
f u x a
s.t.

= = = = =
+
l
f
m
h
n
r
r h f r h f
l
f
m
h
h f h f
y s x p
1 1 1
, , , ,
1 1
, ,
min
72
Model Size
Variables
500 x-variables
1500 y-variables
Constraints
l =20 capacity constraints
mn =750 demand constraints
lm = 500 balance constraints
lm + lmn = 15500 non-negativity constraints
73
Tractability and Validity
Is this a tractable model?
Yes, it is actually not very big at all!
Is this a valid model?
Constant production cost
Reasonable for certain range of production
Deterministic demand
Reasonable for known products/markets
Constant shipping cost
Reasonable for certain range of shipped items
74
Mathematical Programming
General Model
) ,..., ( max min/
1 n
x x f
i n
b x x g

>
=
s
) ,..., (
1
Constants
Right Hand
Side (RHS)
75
Linear versus Nonlinear
A function is linear if it is a weighted
sum of the decision variables, otherwise
nonlinear
A linear program (LP) has a linear
objective function f and constraint
functions g
1
,,g
m

A nonlinear program has at least one
nonlinear function
76
Exercise
j y
y d
y
j
j
j j
>
s
+

=
, 1
s.t.
) 11 (3y min
5
1
4 1
|
o
j y
y d
y
j
j
j j
>
s
+

=
, 1
s.t.
) 11 (3y min
5
1
2
4 1
|
o
j y
y y
y
j
j
j
>
s

=
, 1
100
s.t.
min
2 1
5
1
(a)
(c)
(b)
Linear or nonlinear?
77
Integer Programs
A variable is discrete if it can only take
a limited or countable number of values
A variable is continuous if it can take
values in a specific interval
Mathematical programs can be
continuous
discrete (integer/combinatorial)
mixed
78
Classification Summary
Linear Program (LP) ILP
Nonlinear Program (NLP) INLP
Integer Program (IP)
Increased difficulty
79
Exercise
Should these variables be discrete or continuous?
Operating temperature of a chemical process
Warehouse slot assigned to a particular product
Whether a capital project is selected for
investment
Amount of money converted from yen to dollars
Number of aircraft produced on a defense contract

You might also like