Capacitated plant location - case study P2

Supply Chain Analytics in Python

Aaren Stubberfield

SuSupply Chain Analytics Mgr.

Capacitated plant location model

Modeling

  • Production at regional facilities
    • Two plant sizes (low / high)
  • Exporting production to other regions
  • Production facilities open / close

image of globe with regional production

Supply Chain Analytics in Python

Decision variables

What we can control:

  • x$_{\text{ij}}$ = quantity produced at location _i_ and shipped to _j_
  • y$_{\text{is}}$ = 1 if the plant at location _i_ of capacity _s_ is open, 0 if closed
    • s = low or high capacity plant
Supply Chain Analytics in Python

Constraints

  • Total Production = Total Demand
    • $\sum_{i=1}^{n}$ x$_{ij}$ = D$_{\text{j}}$ for $j = 1, ..., m$
    • $n$ = number of production facilities
    • $m$ = number of markets or regional demand points
Supply Chain Analytics in Python

Constraints

  • Total Production ? Total Production Capacity
    • $\sum_{j=1}^{m}$ x$_{ij}$ ? $\sum_{s=1}$ K$_{is}$y$_{is}$
    • K$_{is}$ = potential production capacity of plant _i_ of size _s_
Supply Chain Analytics in Python
from pulp import *

# Initialize Class
model = LpProblem("Capacitated Plant Location Model", LpMinimize)

# Define Decision Variables
loc = ['A', 'B', 'C', 'D', 'E']
size = ['Low_Cap','High_Cap']
x = LpVariable.dicts("production_", [(i,j) for i in loc for j in loc], 
                      lowBound=0, upBound=None, cat='Continuous')
y = LpVariable.dicts("plant_", [(i,s) for s in size for i in loc], cat='Binary')

# Define Objective Function
model += (lpSum([fix_cost.loc[i,s]*y[(i,s)] for s in size for i in loc])
          + lpSum([var_cost.loc[i,j]*x[(i,j)] for i in loc for j in loc]))
Supply Chain Analytics in Python

Code example continued

# Define the Constraints
for j in loc:
   model += lpSum([x[(i, j)] for i in loc]) == demand.loc[j,'Dmd']

for i in loc: model += lpSum([x[(i, j)] for j in loc]) <= lpSum([cap.loc[i,s]*y[(i,s)] for s in size])
Supply Chain Analytics in Python

Summary

Capacitated Plant Location Model:

  • Constraints
    • Total Production = Total Demand
    • Total Production ≤ Total Production Capacity
Supply Chain Analytics in Python

Review time

Supply Chain Analytics in Python

Preparing Video For Download...