Optimiztion
Optimiztion
Unconstrained Optimization
2
Common Features
• Each of these problems . . .
n Requires the use of a Prescriptive Model,
n Utilizes a math function to make the decision,
n Looks for an “extreme point” solution, and
n Are unconstrained in that there is not a resource limit.
• What is an extreme point of a function?
n The point, or points, where the function takes on an
extreme value, typically either a minimum or a maximum.
n The point(s) where the slope or “rate of change” of the
function is equal to zero.
3
Extreme Points
• Types of Extreme points
n Minimum, Maximum, or Inflection Points
n The minimum and maximum points are either global or local
Inflection
y Point Global
Local Maximum Maximum
Local Minimum x
Global Minimum
5
Classical Optimization
• Use differential calculus to find extreme solutions
n Look for where the rate of change, the slope, goes to zero
n Check for sufficiency conditions
n Continuity and convexity come into play
• Example: iWidget
n We are manufacturing a product where we know:
w The cost function = f(# made) = 500,000 + 75x
w The demand function = f(price) = 20,000 – 80p
w And therefore the profit function = -80p2 + 26,000p – 2,000,000
n We want to find the price, p, that maximizes profits.
6
iWidget Approximate slope from price=$170 to p=$171
the profit decreases from $108,000 to $106,720
Profit = -80p2 +26,000p – 2,000,000 Slope = rise/run = -$1,280 / $1 = -1,280
$125,000
$100,000
$75,000
$-
$100 $110 $120 $130 $140 $150 $160 $170 $180 $190 $200 $210 $220
$(25,000)
$(125,000)
7
Finding the Instantaneous Slope:
The First Derivative
8
Calculating Instantaneous Slope
Different nomenclature
• Given any function, y=f(x), we define y’=f’(x) as is often used, but they
all mean the same thing
the instantaneous rate of change at point x. – the instantaneous rate
of change of function f
⎛ f ( x + δ ) − f ( x) ⎞ with respect to x.
f '( x) = lim ⎜ ⎟
δ →0 δ
⎝ ⎠ dy
y' = f '(x) =
• Example: Suppose we have f(x) = -4x2 + 5x. dx
⎛⎡ 2 ⎤ ⎡ 2 ⎤⎞
⎜ ⎢⎣(
−4 x +)δ (
+5 x +δ ) −
⎥⎦ ⎣−4x + 5x ⎦⎟ ⎛ −4 x 2 + 2δ x + δ 2 + 5x + 5δ + 4x 2 − 5x ⎞
( )
f '(x) = ⎜ ⎟ =⎜ ⎟
⎜ δ ⎟ ⎜ δ ⎟
⎝ ⎠
⎝ ⎠
⎛ −4x 2 − 8δ x − 4δ 2 + 5x + 5δ + 4x 2 − 5x ⎞ ⎛ −4x 2 + 4x 2 + 5x − 5x − 8δ x + 5δ − 4δ 2 ⎞
=⎜ ⎟ =⎜ ⎟
⎝ δ ⎠ ⎝ δ ⎠
But, as δ approaches zero, this becomes:
⎛ −8δ x + 5δ − 4δ 2 ⎞
=⎜ ⎟ = −8x + 5− 4δ ()
y ' = f ' x = −8x + 5
⎝ δ ⎠
Which is the function that gives me
the instantaneous slope at any point! 9
y=f(x) = -4x^2 + 5x
$4
$2
$-
-1 -0.75 -0.5 -0.25 0 0.25 0.5 0.75 1 1.25 1.5 1.75 2
$(2)
$(4)
The extreme point occurs where slope = 0!
$(6) So, to find the extreme point, simply:
1. Take the first derivative of your function,
$(8) 2. Set it equal to zero, and
3. Solve for x*, the value of x at extreme point.
$(10)
This is called the First Order Condition!
10
f'(x) Slope at Point x
0
-1 -0.75 -0.5 -0.25 0 0.25 0.5 0.75 1 1.25 1.5 1.75 2
-5
-10
-15
10
Rule for Differentiation
• Luckily, we have some simple rules for finding derivatives!
y = f (x) = a è y ' = f '(x) = 0
y = f (x) = ax n è y ' = f '(x) = anx n−1
It is a linear function! The slope of a
y=3x + 12 = 3x1 + 12 y’=3(1)x(1-1) + 0 = 3 linear function does not change!
There are many different shortcuts and rules for finding derivatives of more
complex functions – but we will use the Power Rule almost all of the time.
11
Solving the iWidget Problem
12
iWidget Solution
• Find the price, p, that maximizes the profit function:
y = -80p2 + 26,000p – 2,000,000
• Solution
1. Take the first derivative:
y’ = dy/dp = -80(2)p(2-1) + 26,000(1)p(1-1) = -160p + 26,000
2. Set the first derivative equal to zero:
-160p + 26,000 = 0
3. Solve for p*:
-160p = -26,000 so that p*= 26,000 / 160
p* = $162.50
14
iWidget Solved
• By observation, we know that p*=162.50 is a global optimal,
but lets do it formally.
15
Example: Gears Unlimited
16
Gears Unlimited
Inventory Replenishment Policy
Gears Unlimited distributes specialty gears, derailleurs, and brakes for high-end
mountain and BMX bikes. One of their most steady selling items is the PK35
derailleur. They sell about 1500 of the PK35’s a year. They cost $75 each to procure
from a supplier and Gears Unlimited assumes that the cost of capital is 20% a year. It
costs about $350 to place and receive an order of the PK35s, regardless of the
quantity of the order.
How many PK35s should Gears Unlimited order at a time to minimize the average
annual cost in terms of purchase cost, ordering costs, and holding costs?
1. What do we know? 3. What is my objective function?
D = Demand = 1,500 items/year TotalCost = PurchaseCost + OrderCost + HoldingCost
c = Unit cost = 75 $/item Purchase Cost = cD = (75)(1500) = 112,500 $/yr
A = Ordering cost = 350 $/order OrderCost = A(D/Q) = (350)(1500)/Q = 525,000/Q $/yr
r = Cost of capital = 0.20 $/$/year HoldingCost = rc(Q/2) = (.20)(75)(Q/2) = 7.5Q $/yr
18
Gears Unlimited – Total Cost Function
Total Cost (Q)
$160,000 TC(Q) = 112,500 + 525,000/Q + 7.5Q
$150,000
Optimal Order Quantity, Q*
$140,000 Q* = 265 items/order
Total Cost (Q*) = 116,469 $/year
$130,000
$120,000
$110,000
$60,000
-500 -450 -400 -350 -300 -250 -200 -150 -100 -50 0 50 100 150 200 250 300 350 400 450 500
Order Quantity (Q)
19
Gears Unlimited – Total Cost Function
$126,000
$122,000
$121,000
$120,000
Optimal Order Quantity, Q*
Q* = 265 items/order
$119,000
Total Cost (Q*) = 116,469 $/year
$118,000
$117,000
$116,000
0 25 50 75 100 125 150 175 200 225 250 275 300 325 350 375 400 425 450 475 500
Order Quantity (Q)
20
Example: boxy.com
21
boxy.com
Optimal Design
You are consulting with boxy.com, the premier online corrugated packaging company.
They just received a large quantity of heavy duty cardboard from a third party at an
extremely low cost. All of the sheets are 1 meter by 1.5 meters in dimension. You
have been asked to come up with the design that maximizes the total volume of a box
made from this sheet. The only cutting that can be made, however, are equal-sized
squares from each of the four corners. The edges then fold up to form the box.
How big should the square cut-outs be to maximize the box’s volume?
x
1. What do we know?
W= Width = 1 m
1.0 m
L = Length = 1.5 m
x = Height of box (also the amount cut)
boxy.com Solution
1.0 m
1. Determine the Objective Function
V = f(x) = = 4x3-2Wx2-2Lx2+WLx
1.5 m
= 4x3-5x2+1.5x
2. Take first derivative
f’(x) = (4)(3)x(3-1) – (5)(2)x(2-1) +1.5(1)x(1-1) Recall . . .
= 12x2 – 10x +1.5 y = ax 2 + bx + c
− b ± b 2 − 4ac
3. Set 1st derivative equal to zero and solve for x* r1 ,r2 =
2a
f’(x*) = 12x2 – 10x +1.5 = 0
= 0.637m ✗
10 + 28
2
−(−10)± (−10) − 4 (12) (1.5) 10 ± 100 − 72 10 ± 28 r1 =
r1, r2 = = = 24
2 (12) 24 24 10 − 28
r2 = = 0.196m ✔
4. Check 2nd order conditions 24
f’’(x*) = 12 (2)x* - 10(1) = 24x* - 10 < 0
The function at x*=0.196 is a local maximum.
Maximum volume = 0.132 m3
23
boxy.com Optimal Cut-Out, x* = 0.196 m
Max Volume (x*) = 0.132 m3
Things to Note:
0.14 • As x increases beyond .5m, the volume
increases dramatically – but we cannot
cut out more than 0.5 m!
0.12 • Within the “feasible region” of 0<x<0.5
the volume function is concave
• The second root (x=0.637) is not feasible
0.10
Box Volume (cubic meters)
0.08
0.196
0.06
0.608 m
0.04
0.02 1.108 m
-
- 0.05 0.10 0.15 0.20 0.25 0.30 0.35 0.40 0.45 0.50
Size of corner cut-out (meters)
24
Key Points from Lesson
25
Key Points from Lesson
Power Rule
• Unconstrained Optimization
y = f (x) = ax n ⇒ y ' = f '(x) = anx n−1
n Extreme points of a function
n Typically minimums or maximums
n Extreme points occur where slope = 0
• To Find Extreme Point Solutions, f(x*)
n First Order (Necessary) Condition
w f’(x*) = 0
w First derivative used to find instantaneous rate of change
n Second Order (Sufficiency) Condition
w If f’’(x) > 0 then the extreme point is a local minimum
w If f’’(x) < 0 then the extreme point is a local maximum
w If f’’(x) = 0 then it is inconclusive
w If f(x) is convex then f(x*) is a global minimum
w If f(x) is concave then f(x*) is global maximum
26
Questions, Comments, Suggestions?
Use the Discussion Forum!
2
How does this differ from our earlier problems?
n Similarities
w Requires a prescriptive model
w Uses an objective function
w Solution is an extreme value
n Differences
w Multiple decision variables
w Constraints on resources
3
• What approach will we take?
n Math Programming
w Powerful family of optimization methods
w Different techniques and methodologies
§ Linear Programming (LPs)
§ Integer Programming (IPs)
§ Mixed Integer and Linear Programming (MILPs)
§ Non-linear Programming (NLPs)
n Why?
w The most widely used approach in Supply Chains
§ Designing networks, planning production, selecting transportation providers,
allocating inventory, scheduling port and terminal operations, fulfilling orders,
etc. etc. etc.
w Readily available
§ Embedded into most all supply chain decision support software tools
§ Included in most spreadsheet and other tools
w Best way to identify the “best” solution under limited resources
4
What will we do in this lesson?
• Problem Formulation
• Graphical Representation
• Sensitivity Analysis
• Formal Notation
• Anomalies
5
Problem Formulation
6
Simple Problem Formulation Process
1. Determine the decision variables
n What are you trying to decide?
n What are their upper or lower bounds?
2. Formulate the objective function
n What are we trying to minimize or maximize?
n Must include the decision variables and the form of the
function determines approach (linear for LP)
3. Formulate each constraint
n What is my feasible region? What are my limits?
n Must include the decision variables and will almost
always be linear functions
7
Formulating – Banner Chemicals
• Situation
n Banner Chemicals manufactures specialty chemicals. One of their products comes in two
grades, high and supreme. The capacity at the plant is 110 barrels per week.
n The high and supreme grade products use the same basic raw materials but require different
ratios of additives. The high grade requires 3 gallons of additive A and 1 gallon of additive B
per barrel while the supreme grade requires 2 gallons of additive A and 3 gallons of additive B
per barrel.
n The supply of both of these additives is quite limited. Each week, this product line is allocated
only 300 gallons of additive A per week and 280 gallons of additive B.
n A barrel of the high grade has a profit margin of $80 per barrel while the supreme grade has a
profit margin of $200 per barrel.
• Question
n How many barrels of High and Supreme grade should Banner Chemicals produce each week?
XS
Step 1. Determine Decision Variables
XH = Number of High grade barrels to produce per week
XS = Number of Supreme grade barrels to produce per week
Bounds XH ≥ 0 XS ≥ 0 XH
8
Formulating – Banner Chemicals
• Situation
n Banner Chemicals manufactures specialty chemicals. One of their products comes in two
grades, high and supreme. The capacity at the plant is 110 barrels per week.
n The high and supreme grade products use the same basic raw materials but require different
ratios of additives. The high grade requires 3 gallons of additive A and 1 gallon of additive B
per barrel while the supreme grade requires 2 gallons of additive A and 3 gallons of additive B
per barrel.
n The supply of both of these additives is quite limited. Each week, this product line is allocated
only 300 gallons of additive A per week and 280 gallons of additive B.
n A barrel of the high grade has a profit margin of $80 per barrel while the supreme grade has a
profit margin of $200 per barrel.
• Question
n How many barrels of High and Supreme grade should Banner Chemicals produce each week?
XS
Step 2. Formulate Objective Function
(0,12) pro
Profit = 80XH + 200XS fit
=2
40
pro 0 (20,4)
(0,5) fit
=1
Maximize z(XH, XS) = 80XH + 200XS 00
0
(12.5,0) (30,0) XH
9
Formulating – Banner Chemicals
• Situation
n Banner Chemicals manufactures specialty chemicals. One of their products comes in two
grades, high and supreme. The capacity at the plant is 110 barrels per week.
n The high and supreme grade products use the same basic raw materials but require different
ratios of additives. The high grade requires 3 gallons of additive A and 1 gallon of additive B
per barrel while the supreme grade requires 2 gallons of additive A and 3 gallons of additive B
per barrel.
n The supply of both of these additives is quite limited. Each week, this product line is allocated
only 300 gallons of additive A per week and 280 gallons of additive B.
n A barrel of the high grade has a profit margin of $80 per barrel while the supreme grade has a
profit margin of $200 per barrel.
• Question
n How many barrels of High and Supreme grade should Banner Chemicals produce each week?
XS
Step 3. Formulate Constraints
Plant Capacity is 110 barrels XH + XS ≤ 110
High Supreme Available Feasible
Region
Additive A 3 gal 2 gal 300 gal 3XH + 2XS ≤ 300
XH
subject to
XH + XS ≤ 110 Constraints - Limits to resources or
requirements of the system that must be
3XH + 2XS ≤ 300 adhered to absolutely. Consists of a Left
Hand Side (LHS) function, that has some
XH + 3XS ≤ 280 relationship (≤,=,≥) to a Right Hand Side
(RHS) that must be satisfied.
XH ≥0
Bounds or Non-Negativity Conditions
XS ≥ 0 Decision variables typically can’t be negative.
Decision Variables
The unknowns in the problem whose values you are trying to determine.
XH = Number of High grade barrels to produce per week
XS = Number of Supreme grade barrels to produce per week
11
Graphical Representation
12
Graphical Representation – Banner Chemicals
Max z(XH, XS) = 80XH + 200XS
s.t.
Plant XH + XS ≤ 110
Add. A 3XH + 2XS ≤ 300
XS
XH
The Feasible Region is defined by the constraints
and the bounds on the Decision Variables
13
Graphical Representation – Banner Chemicals
Max z(XH, XS) = 80XH + 200XS
s.t.
Plant XH + XS ≤ 110
Add. A 3XH + 2XS ≤ 300
XS
XH
The Feasible Region is defined by the constraints
and the bounds on the Decision Variables
14
Graphical Representation – Banner Chemicals
Max z(XH, XS) = 80XH + 200XS
s.t.
Plant XH + XS ≤ 110
Add. A 3XH + 2XS ≤ 300
XS
XH
The Feasible Region is defined by the constraints
and the bounds on the Decision Variables
15
Graphical Representation – Banner Chemicals
Max z(XH, XS) = 80XH + 200XS
s.t.
Plant XH + XS ≤ 110
Add. A 3XH + 2XS ≤ 300
XS
XH
The Feasible Region is defined by the constraints
and the bounds on the Decision Variables
16
Graphical Representation – Banner Chemicals
Max z(XH, XS) = 80XH + 200XS
s.t.
Optimal Solution Plant XH + XS ≤ 110
XH= 25 barrels Add. A 3XH + 2XS ≤ 300
XS = 85 barrels
XS
XH
Objective Function @ Profit = 16,000
Objective Function @ Profit = 10,000 17
Graphical Representation – Banner Chemicals
What if the objective function changed?
Max
Max z(X
z(XHH,, X
XSS)) == 80X
200XH ++200X
80XSS
H
s.t.
Plant XH + XS ≤ 110
Optimal Solution Add. A 3XH + 2XS ≤ 300
XH= 100 barrels
XS
XH
18
Graphical Representation – Banner Chemicals
The solution of a Linear Program will always be in a
“corner” of the Feasible Region due to: Max z(XH, XS) = 80XH + 200XS
- Linear objective function s.t.
- Linear constraints that form a convex feasible region Plant XH + XS ≤ 110
Add. A 3XH + 2XS ≤ 300
XH= 0 barrels
XS
XH= 80 barrels
XS = 30 barrels
XH
XH= 0 barrels
XS = 0 barrels The objective function determines
inwhich corner is the solution.
19
Interpreting Results
and Sensitivity Analysis
20
OK, so I got an answer, now what?
• Sometimes the original question is the least
interesting one!
Binding Constraints:
di t
Addi t
Optimal Solution ive B
XH= 25 barrels
XS = 85 barrels Obje
Max Profit = 19,000 ctive
Func
t ion
Pl a
nt
XH
Software packages will provide you with details on shadow prices of
binding constraints, slack constraint ranges, and other features.
22
Formal Notation
23
Problem Formulation – Banner Chemicals
Max z(XH, XS) = 80XH + 200XS Max z =∑ pi xi
i∈M Summation
s.t. s.t. from i to M
XH + XS ≤ 110
3XH + 2XS ≤ 300 xi ≤ C
XH + 3XS ≤ 280
∑ i∈M for all
XH ≥0 ∑ aij xi ≤ A j ∀j ∈ N
i∈M
XS ≥ 0
xi ≥ 0 ∀i ∈ M
is a
Indices member of
Products i in M
Max z = f (x) Additives j in N
Input Data
pi = Profit margin for product i ($/barrel)
s.t. C = Plant capacity (barrels/week)
Aj = Additive j available (gallons/week)
g(x) ≤ b aij = Quantity of additive j required per
barrel of product i (gallons/barrel)
x≥0 Decision Variables
xi = Quantity of product i to produce (barrels)
24
Anomalies
25
Special Cases in Math Programming Models
n Infeasibility
26
Anomalies – Banner Chemicals
Alternate or Multiple Optimal Solutions
• When the objective function is identical to a constraint
• There can be more than one optimal solution!
Ad
Ob
je
cti
ve
Fu
ctin
on
Addi t
ive B
Optimal Solutions
Pl a
nt
XH
27
Anomalies – Banner Chemicals
Redundant Constraints
• Suppose I have new constraint that I cannot produce more
than 100 barrels of Supreme grade a week.
Ad
XS ≤ 100 barrels
Addi t
Optimal Solution ive B
XH= 25 barrels
XS = 85 barrels Obje
Max Profit = 19,000 ctive
Func
t ion
Pl a
nt
XH
28
Anomalies – Banner Chemicals
Infeasibility
• Suppose I have new constraint that I MUST produce at least
100 barrels of Supreme grade a week.
Ad
XS ≥ 100 barrels
Addi t
Optimal Solution ive B
XH= 25 barrels
XS = 85 barrels Obje
Max Profit = 19,000 ctive
Func
t ion
Pl a
nt
XH
29
Special Cases in Math Programming Models
n Infeasibility
30
Key Points
31
Key Points from Lesson
• Constrained Optimization
• Formulate Linear Program (Practice This!)
n Decisions Variables – things you are deciding
n Objective Function – to minimize or maximize
n Constraints – define feasible regions
• Solution always occurs at a ‘corner’
• Analysis of the Results – (software output)
n Shadow Prices – the marginal value of a scarce resource
• Anomalies to be aware of
n Alternate or Multiple Optimal Solutions
n Redundant Constraints
n Infeasibility
32
Questions, Comments, Suggestions?
Use the Discussion Forum!
R = Real Numbers = all Rational and Irrational numbers, i.e, π, √2, e, . . . etc.
Add. B
di t
XS ≥ 0
What is the optimal solution
with 10 barrel lots?
Addi t
ive B
Obje
ctive
Func
t ion
Pl a
nt
XH
Notes:
• Feasible region becomes a collection of points, no longer a convex hull
• We cannot rely on “corner” solutions anymore – solution space is much bigger!
MIT Center for
Transportation & Logistics
6
Max z(XH, XS) = 80XH + 200XS
XH + 3XS ≤ 280
the closest acceptable integer values? Add. B
XH ≥ 0
n LP Solution: XS ≥ 0
w XH=25 barrels XS= 85 barrels
n Rounding to closest “10 barrel” solution for (XH, XS):
1. zLOT(30, 90) = $20,400 but it is infeasible (Plant constraint)
2. zLOT(30, 80) = $18,400 feasible
3. zLOT(20, 90) = $19,600 but it is infeasible (Additive B constraint)
n So, using this approach z*LOT= $18,400 with XH=30, XS=80
n But, is it the best?
• Let’s solve all of the points to make sure!
This approach is called Mass Enumeration.
MIT Center for
7
Transportation & Logistics
Mass Enumeration Max z(XH, XS) = 80XH + 200XS
s.t.
of Banner Chemical Plant XH + XS ≤ 110
Add. A 3XH + 2XS ≤ 300
Optimal IP Solution Optimal LP Solution Closest “rounded” XH + 3XS ≤ 280
Add. B
XH= 10 barrels XH= 25 barrels LP Solution
XS = 90 barrels XS = 85 barrels XH= 30 barrels XH ≥ 0
Max Profit = 18,800 Max Profit = 19,000 XS = 80 barrels
Max Profit = 18,400 XS ≥ 0
Notes:
• Rounding the optimal LP solution will not always lead to an optimal IP solution
• Mass enumeration is very time consuming – not always possible for real problems!
• IP solution can never be better than the LP solution!
MIT IPsforare much, much, much harder to solve than LPs!
• Center
Transportation & Logistics
8
Formulation Changes . . . not much!
Max z(XH, XS) = 80XH + 200XS • In order to solve in integer values of
s.t. “lots of ten”, we need to:
Plant XH + XS ≤ 110
n Convert Decision Variables
Add. A 3XH + 2XS ≤ 300
w XHL = XH/10 XSL = XS/10
XH + 3XS ≤ 280
Add. B n Scale the coefficients and constraint RHS
XH ≥ 0 w e.g. 110 barrels becomes 11 lots of ten
XS ≥ 0 n Indicate that the new DVs are Integers
GoNuts manufactures different juices made entirely of various exotic nuts. Their
primary market is China and they operate three plants located in Ethiopia,
Tanzania, and Nigeria. You have been asked to help them determine where to
manufacture the two newest juices they offer, Gingko Nut and Kola Nut. Each
plant has a different variable cost structure and capacity for manufacturing the
different juices. Also, each juice has an expected demand.
How much of each juice should be made at each plant in order to minimize total
cost while meeting demand and adhering to plant capacity?
Product Demand
∑ xij ≥ Di ∀i
j
where:
xij = Number of units of product i made in plant j
Di = Demand for product i in units
MIT Center for
13
Transportation & Logistics
Formulating GoNuts 1
s.t.
∑x ij
≤Cj ∀j Optimal Solution
i
∑x ≥ Di ∀i Ginko Kola
j ij
Ethiopia 0 425
xij ≥ 0 ∀ij Tanzania 375 25
where: Nigeria 175 0
xij = Number of units of product i made in plant j
cij = Cost per unit of product i made at plant j Total min cost = ¥ 22,637.50
Cj = Capacity in units at plant j
Di = Demand for product i in units
MIT Center for
Transportation & Logistics
14
2
GoNuts manufactures different juices made entirely of various exotic nuts. Their
primary market is China and they operate three plants located in Ethiopia,
Tanzania, and Nigeria. You have been asked to help them determine where to
manufacture the two newest juices they offer, Gingko Nut and Kola Nut. Each
plant has a different fixed and variable cost structure and capacity for
manufacturing the different juices. The fixed cost only applies if the plant
produces any juice. Also, each juice has an expected demand.
Cost/Unit Ginko Kola Capacity Units/Month Fixed (¥/Month)
Ethiopia ¥21.00 ¥22.50 Ethiopia 425 ¥1,500
Tanzania ¥22.50 ¥24.50 Tanzania 400 ¥2,000
Nigeria ¥23.00 ¥25.50 Nigeria 750 ¥3,000
Demand Units/Month
Ginko 550
Kola 450
How much of each juice should be made at each plant in order to minimize total
cost while meeting demand and adhering to plant capacity?
MIT Center for
Image CC0 Public Domain from https://pixabay.com 16
Transportation & Logistics
Formulating GoNuts 2 2
Feasible Values
Looking at the Nigeria Plant . . . 1
0 0 or 1 0 ≤ 750 yN
99 1 99 ≤ 750 yN
∑x i ij
≤ My j ∀j
where: 1 1 1 ≤ 750 yN
xij = Number of units of product i made in plant j
yj = 1 if plant j is opened; = 0 o.w.
M = a big number (such as Cj in this case) If the X values >0, then Y MUST be
equal to 1! Otherwise, it would
violate the constraint.
MIT Center for
20
Transportation & Logistics
Formulating GoNuts 2 2
Min z = 21xG,E + 22.5xK,E + 22.5xG,T + 24.5xK,T + 23xG,N + 25.5xK,N + 1500yE + 2000yT + 3000yN
subject to
xG,E + xK,E ≤ 425 Min z = ∑ ∑ cij xij + ∑ f j y j
i j j
xG,T + xK,T ≤ 400
xG,N + xK,N ≤ 750 s.t.
xG,E + xG,T + xG,N ≥ 550 ∑x ij
≤Cj ∀j
i
xK,E + xK,T + xK,N ≥ 450
xG,E + xK,E - 425yE ≤ 0 ∑x j ij
≥ Di ∀i
xG,T + xK,T - 400yT ≤ 0
xG,N + xK,N - 750yN ≤ 0
∑x i ij
− My j ≤ 0 ∀j
xG,E, xK,E, xG,T, xK,T, xG,N, xK,N ≥ 0 xij ≥ 0 ∀ij
yE, yT, yN = {0, 1} y = {0,1}
where: j
GoNuts manufactures different juices made entirely of various exotic nuts. Their
primary market is China and they operate three plants located in Ethiopia,
Tanzania, and Nigeria. You have been asked to help them determine where to
manufacture the two newest juices they offer, Gingko Nut and Kola Nut. Each
plant has a different fixed and variable cost structure and both minimum and
maximum capacities for manufacturing the different juices if the plant opens.
The fixed cost only applies if the plant produces any juice. Also, each juice has
an expected demand.
Capacity Max Min Fixed
Cost/Unit Ginko Kola (units/Month) Capacity Capacity (¥/Month)
Ethiopia ¥21.00 ¥22.50 Ethiopia 425 100 ¥1,500
Tanzania ¥22.50 ¥24.50 Tanzania 400 250 ¥2,000
Nigeria ¥23.00 ¥25.50 Nigeria 750 600 ¥3,000
Demand Units/Month
If the Nigeria plant opens, it
Ginko 550 must produce at least 600 units
Kola 450
How much of each juice should be made at each plant in order to minimize total
cost while meeting demand and adhering to plant capacity?
MIT Center for
Image CC0 Public Domain from https://pixabay.com 26
Transportation & Logistics
Formulating GoNuts 3 3
ij j
∀j
xG,T + xK,T ≤ 400 i
200 1 0
∑x i ij
≤ My j ∀j
600 1 0 or 1
∑x i ij
≥ Lj y j ∀j
where:
xij = Number of units of product i made in plant j If the X values >0, then they must be
yj = 1 if plant j is opened; = 0 o.w. ≥L, the lower limit, and ≤C, the
M = a big number (such as Cj in this case) maximum capacity!
Lj = Minimum
MIT Center for level of production at plant j
Transportation & Logistics
29
Formulating GoNuts 3 3
Min z = 21xG,E + 22.5xK,E + 22.5xG,T + 24.5xK,T + 23xG,N + 25.5xK,N + 1500yE + 2000yT + 3000yN
subject to
xG,E + xK,E ≤ 425 Min z = ∑ ∑ cij xij + ∑ f j y j
i j j
xG,T + xK,T ≤ 400 s.t.
xG,N + xK,N ≤ 750
xG,E + xG,T + xG,N ≥ 550
∑x i ij
≤Cj ∀j
GoNuts manufactures different juices made entirely of various exotic nuts. Their
primary market is China and they operate three plants located in Ethiopia,
Tanzania, and Nigeria. You have been asked to help them determine where to
manufacture the two newest juices they offer, Gingko Nut and Kola Nut. Each
plant has a different variable cost structure and a maximum capacity. GoNuts
can only operate 2 plants at a maximum. Also, each juice has an expected
demand.
How much of each juice should be made at each plant in order to minimize total
cost while meeting demand and adhering to plant capacity?
MIT Center for
Image CC0 Public Domain from https://pixabay.com 33
Transportation & Logistics
Formulating GoNuts 4 4
ij j
∀j
xG,T + xK,T ≤ 400 i
xG,N + xK,N ≤ 750 ∑ x ≥D ∀i
j ij i
xG,E + xG,T + xG,N ≥ 550
xK,E + xK,T + xK,N ≥ 450 ∑ x − My
i ij j
≤ 0 ∀j
yE + yT + yN ≤ 2
Cj = Maximum capacity in units at plant j
N = Number of plants allowed to be opened
Di = Demand for product i in units
We need to add a constraint that ensures that only N plants are used! We will use the
Binary Variables, yj, the Linking Constraints, and a new constraint that says the sum of the
Binary Variables must not exceed N. This is sometimes called an Select-From condition.
MIT Center for
Transportation & Logistics
35
Formulating GoNuts 4 4
Model 3 – with fixed plant costs Model 4 – only variable costs but
and minimum production levels with maximum number of plants allowed
z*= ¥ 27,425.00 z*= ¥ 22,850.00
Ginko Kola Ginko Kola
Ethiopia 0 400 Ethiopia 0 425
Tanzania 0 0 Tanzania 0 0
Nigeria 550 50 Nigeria 550 25
∑x i ij
− My j ≤ 0 ∀j ∑xi ij
− L j y j ≥ 0 ∀j
∑x i ij
− My j ≤ 0 ∀j ∑ j
yj ≤ N
• Network Models
• Non-Linear Optimization
• Tips on Optimization in Practice
1
6
14
3 7 i j
11
2 8 15
12
4 9 Arcs
16 xij = flow on arc from node i to node j
cij = per unit cost for arc i to j
5 13 Nodes:
10
yj = 1 if node j is used, =0 otherwise
fj = cost of opening node j
hj = unit cost for any flow through node j
MIT Center for 4
Transportation & Logistics
Distance/Connectivity Matrix
Washington DC
Morgantown
Indianapolis
Greensboro
Charleston
Harrisburg
Cincinnati
Columbus
Richmond
Lexington
Cleveland
Louisville
Nashville
Knoxville
St. Louis
Chicago
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16
1 Chicago - 300 201 362
2 St. Louis 300 - 245 263 312
3 Indianapolis 201 245 - 114 176 112
4 Louisville 263 114 - 175 86
5 Nashville 312 175 - 180
6 Cleveland 362 - 142 201 251 332
7 Columbus 176 142 - 105
8 Cincinnati 112 105 - 95 204
9 Lexington 86 95 - 170 177
10 Knoxville 180 170 - 299
11 Morgantown 201 - 157 213 209
12 Charleston 251 204 177 157 - 244 318
13 Greensboro 299 244 - 205
14 Harrisburg 332 213 - 120
Washington
15 DC 209 120 - 111
16 Richmond 318 205 111 -
∑ x =1
i ij
∀ j=t
3
2
7
xij ≥ 0 4
where: 3 4
1 5
xij = Number of units flowing from node i to node j 2
cij = Cost per unit for flow from node i to node j 5 1
4
s = Source node – where flow starts
t = terminalMIT node
Center for– where flow ends
Transportation & Logistics
9
Traveling Salesman Problem
14
7
3
11
8
2 15
12
4
9
16
5
13
10
14
7
3
11
8
2 15
12
4
9
16
5
13
10
R3
R1 B
P1 P2
R2
R3
Transshipment Problem
Min z = ∑ ∑ cij xij
P2 i j
s.t.
Transportation Problem
Min z =∑ ∑ cij xij ∑ x ≤ S ∀i ∈ S
j ij i
i j
s.t. ∑ x ≥ D ∀j ∈ D
i ij j
∑x ij
≤ Si ∀i ∈ S ∑ x − ∑ x = 0 ∀j ∉ D,∉ S
i ij i ji
j
xij ≥ 0 ∀ij
∑x i ij
≥ Dj ∀j ∈ D
xij ≥ 0 ∀ij Conservation of Flow Constraints
xij xji
j
The inbound flow must equal the
outbound flow at transshipment points,
cross-docks, mixing centers, etc.
Σi xij = Σi xji
MIT Center for
Transportation & Logistics 16
Non-Linear Programs (NLP)
0.12
0.10
Box Volume (cubic meters)
0.08
0.196
0.06
0.608 m
0.04
0.02 1.108 m
-
- 0.05 0.10 0.15 0.20 0.25 0.30 0.35 0.40 0.45 0.50
Size of corner cut-out (meters)
s.t.
Max z = xy ∑cx i i
≤B
i
Y labor hours
Feasible
Region
X units of ice
Y labor hours
Feasible
Region
z= xy = 1
X units of ice
Y labor hours
Feasible
Region
z= xy = 2
z= xy = 1
X units of ice
Y labor hours
Feasible
Region
z= xy = 3
z= xy = 2
z= xy = 1
X units of ice
Y labor hours
Optimal NLP Solution
x = 1 unit of ice
Feasible y = 4 labor hours
Max Production = 4 sculptures
Region
Things to Note:
• Optimal solution is no
longer in a corner!
• NLPs require different
solution techniques and z= xy = 4
tools
• Shape of objective function z= xy = 3
and constraints determine z= xy = 2
whether solution is local or z= xy = 1
global
• Convex Min - Global X units of ice
• Concave Max - Global