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: Instead of the previous change, add the following to the objective function: Notice only one variable per location for all time periods: 𝐿𝐸𝑉𝐸𝐿𝐶𝑂𝑆𝑇 𝐿𝐿+𝑙 + + 𝑙∈𝐿𝑂𝐶 𝐿𝐸𝑉𝐸𝐿𝐶𝑂𝑆𝑇 𝐿𝐿−𝑙 𝑙∈𝐿𝑂𝐶 In addition to the previous set of constraints, add the 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 to the objective function: + 𝑃𝐶𝑂𝑆𝑇 ∗ 𝐼𝐶𝑝,𝑙 𝑝∈𝑃𝑅𝑂 𝑙∈𝐿𝑂𝐶 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: PRO = Set of All Products 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.