### Pitfalls with Linear Programming Optimization of Supply Chain

```Talk Title: Pitfalls with Linear Programming
Optimization of Supply chain Networks
Speaker Name: Robert Stawicki
Speaker Title: Assistant Professor Ramapo College of NJ
Background
• Based on 20 Years Experience Implementing
Supply Chain Models for Fortune 100
Companies
• Formulating Models from Scratch
Or
• Models Provided by Major Supply Chain
Solutions Vendors
Outline
• LP Formulation for Supply Chain Optimization
• Six Common Pitfalls and Their Work Arounds
– Using Full Costing
– Time Frame Too Short
– Production Levelling
– Inventory being “Reborn” (Product Aging Constraints)
– Honoring Safety Stocks while Stocking Out
Customers
– Starting Inventory is “Free”
Basic Formulation
• Minimize Total Cost
• Production Cost
• Inventory Carrying Cost
• Intra-Company Transportation Cost
• Transportation Cost to Customers
• Stock Out Costs
• Safety Stock Violation Cost
• Subject To:
• Material Balance Constraints
• Capacity Constraints
• Satisfy Demand Constraints
• Satisfy Safety Stock Constraints
Basic Formulation (Continued)
To Discuss:
 Maximize vs. Minimize
 Stockout vs. Backorder
 Other Constraints
 Model Size
 See Appendix
Using Full Costing
Plant A
Fixed Cost
Variable Cost / Unit
Total Cost / Unit
Plant B
\$2.00
\$5.00
\$7.00
Fixed Cost
Variable Cost / Unit
Total Cost / Unit
Assume Demand = 10,000 units
All Other Costs Equal
\$0.50
\$6.00
\$6.50
Using Full Costing (continued)
Full Costing Based Model
Plant B Produces all 10,000 Units
Plant A
Fixed Cost
Variable Cost
Total Cost
Plant B
\$20,000
Fixed Cost
0
Variable Cost
\$20,000
Total Cost
Total Cost \$85,000
\$5,000
60,000
\$65,000
___________________________________________________________________________________________________________________________________________________________________________________
Marginal Cost Based Model
Plant A Produces all 10,000 Units
Plant A
Fixed Cost
Variable Cost
Total Cost
Plant B
\$20,000
Fixed Cost
50,000
Variable Cost
\$70,000
Total Cost
Total Cost \$75,000
\$5,000
0
\$5,000
Time Frame Too Short
450
400
350
300
250
200
150
100
50
0
-50
12 Month Model Underestimates Production
Requirements
Demand
Produce
Inventory
1
2
3
4
5
6
7
8
9
10
11
12
13
14
___________________________________________________________________________________________________________________________________________________________________________________
450
A 24 Month Model Adequately Calculates the First 12 Months
400
350
300
250
Demand
200
Produce
150
Inventory
100
50
0
-50
1
2
3
4
5
6
7
8
9
10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25
Production Levelling
Loosely defined: “Minimize the change in production level from
period to period.”
A typical method is to add the following to the objective function:
∗ +, +
+
∈ ∈
∗ −,
∈ ∈
And the following set of constraints:
∀, ∈ ,
,,, ∗ ,,, −
∈ ∈
Where:
LEVELCOST = A large penalty
,,,+1 ∗ ,,,+1
∈ ∈
− −, + +, = 0
L+, L- = Change in Production Level
Production Levelling (Continued)
The problem with this formulation is LP
sees no difference between several small
changes and one large one. It may actually
prefer the large one as shown below.
Demand
Production
Level
Delta Level
Inventory
D0 D1 D2 D3 D4 D5 D6
5
5
8 10 10 10
5
8
3
3
8
0
6
8
0
6
8
0
4
8
0
2
8
0
0
Production Levelling (Continued)
A better formulation:
objective function:
Notice only one variable per location for all time periods:
+ +
+
∈
−
∈
following two sets of constraints:
∀, ∈ ,  +, ≤ +
∀, ∈ ,  −, ≤ −
Production Levelling (Continued)
For the same demand pattern, the change in
production level from period to period is
much smaller.
D0
Demand
Production
Level
Delta Level
Inventory
D1
5
D2
D3
D4
D5
D6
5
5
8
10
10
10
6
1
1
7
1
3
8
1
3
9
1
2
9
0
1
9
0
0
Note: A similar approach works well for minimizing the
change in other variables across multiple time periods.
Inventory Being Reborn
Loosely defined as, “Product must be <= k periods
old.”
Typically modeled as:
+
∀,, ∈ , ,  ,, −
+
,, ′ , −
′ ∈ ′ +1
,,, ≤ 0
∈ +1
Problem: LP will use the Tp,l,l’,t variables to bypass
this constraint by moving inventory between
locations. (see example next slide)
Inventory Being Reborn (continued)
Assume: Production Capacity at Locations 1&2 = 1
unit/period.
k=2
Period
Demand
1
0
2
0
3
0
4
7
Prod Loc (1)
T(1,2)
T(1,CUS)
Inventory (1)
1
1
1
1
1
1
2
2
Prod Loc (2)
Inventory (2)
T(2,CUS)
0
1
1
1
3
3
1
4
Inventory
is Re-bornI
Inventory Being Reborn (continued)
Solutions:
Easiest - Eliminate the Tp,l,l’,t variables.
• To discuss: “execution” vs. “planning”
Harder - Add an additional time based domain to most of the
variables and inventory balance rows.
• This is beyond the scope of this presentation.
Honoring Safety Stocks Over Customers
Refresher:
Min Z =
Where: SO= Stockout Amount SV= Safety Stock Violation Amount
Safety Stock
Constraint:
∀,, ∈ , ,
Standard Practice:
SOCOST = M
,, + ,, ≥ ,,
SVCOST = 0.5*M
Honoring Safety Stocks Over Customers
Scenario
Period
Demand
Capacity
SS Target
1
10
5
5
2
10
5
5
3
10
5
5
4
10
20
5
Honoring Safety Stocks Over Customers
Honor Safety Stock
Period
Production
Sales
Stockout
End. Inv.
SO Penalty
SS Penalty
1
2
5
5
0
5
10
5
5
5
10
5
0
0
Total Penalty--->
3
5
5
5
5
5
0
4
10
10
0
5
0
0
20
Note: There is an alternate solution with the same total penalty
cost in which you ship 10 in Period 3.
Honoring Safety Stocks Over Customers
Satisfy Customer Demand over Safety Stock
Period
Production
Sales
Stockout
End. Inv.
SO Penalty
SS Penalty
1
2
5
5
5
5
5
5
0
0
5
5
2.5
2.5
Total Penalty -->
3
5
5
5
0
5
2.5
4
15
10
0
5
0
0
22.5
Honoring Safety Stocks Over Customers
Solution
∀ ∈
= +1 +
= ≫ =
Honoring Safety Stocks Over Customers
Solution
Maintain Safety Stock
Period
SO Units
SV Units
SOCOST
SVCOST
SO Total
SV Total
1
10
0
2.5
0.5
25
0
2
5
0
2
0.5
10
0
Total Penalty -->
3
5
0
1.5
0.5
7.5
0
4
0
0
1
0.5
0
0
42.5
Honoring Safety Stocks Over Customers
Solution
Satisfy Customers
Period
SO Units
SV Units
SOCOST
SVCOST
SO Total
SV Total
1
5
5
2.5
0.5
12.5
2.5
2
5
5
2
0.5
10
2.5
Total Penalty -->
3
5
5
1.5
0.5
7.5
2.5
4
0
0
1
0.5
0
0
37.5
Starting Inventory is “Free”
Objective function does not account for
inventory consumption
•
•
LP may ship to inappropriate locations
Reporting Issues
Starting Inventory is “Free”
P= \$15
Plant A
T= \$15
P= \$10
Plant B
T= \$10
No issue if inventory is consumed elsewhere during the
model horizon.
Starting Inventory is “Free”
Solution
+
∗ ,
∈ ∈
Add a new set of constraints:
∀, ∈ ,
, + ,,= − ,,=1 ≥ 0
Note: Easily modified if you wish to capture increases in
inventory as well.
Questions?
Thank you!
Appendix
Basic Formulation
=
,,, ∗ ,,, +
∈ ∈ ∈ ∈
+
,, ∗ ,,
∈ ∈ ∈
,, ′ , ∗ ,, ′ , +
∈ ∈  ′ ∈ ′ ∈
+
,,, ∗ ,,,
∈ ∈ ∈ ∈
,, ∗ ,, +
∈ ∈ ∈
Where:
MAC = Set of All Machines
LOC = Set of All Locations
TIM = Set of All Time Periods
CUS = Set of All Customers
PCOST= Cost to Produce
ICOST = Cost to Hold Inventory
TCOST = Inter LOC Transportation Cost
SOCOST = Stockout Cost
TCCOST = LOC to CUS Transportation Cost
,, ∗ ,,
∈ ∈ ∈
SVCOST = Safety Stock Violation Cost
P = Amount to Produce
I = Inventory at the END of the Period
T = Amount to Move Between LOC’s
TC = Amount to Move Between LOC– CUS
SO = Demand not Fulfilled
SV = Amount of Safety Stock Violation
K = Capacity
SS = Safety Stock
D = Demand
Basic Formulation (Continued)
Subject To:
Capacity Constraint:
∀,, ∈ , ,
,,, ∗ ,,, ≤ ,,
∈
Material Balance:
∀,, ∈ , ,
,,, + ,,−1 − ,, +
′ ∈ ′
∈
−
,,′ , −
′ ∈ ′
Demand:
,′ ,,
∀,, ∈ , ,
,,, = 0
∈
,,, + ,, = ,,
∈
Safety Stock:
∀,, ∈ , ,
,, + ,, ≥ ,,
Model Size
Assumptions:





10 Plants
5 Machines / Plant
100 Products
100 Customers (Assume 3 Plants/Customer)
52 Periods
Variables:






P – 100 * 5* 10 * 52 =
260,000
I – 100 * 10 * 52 =
52,000
T – 100 * 10 * 9 * 52 =
468,000
TC – 100 * 3 * 100 *52 =
1,560,000
SO = 100 * 100 * 52 =
520,000
SV = 100 * 10 *52
52,000
Total 2,912,000
Model Size (continued)
Constraints:




Capacity – 10 * 5* 52 =
Balance – 100 * 10 * 52=
Demand – 100 * 100 * 52 =
Safety Stock - 100 * 10 * 52 =
Total
2,000
52,000
520,000
52,000
574,000
Note: Real Models tend to be smaller because not every combination exists.
```