Case Study
№ 02
Turning supply chain uncertainty into $4M in annual savings.
A Python decision engine that replaces intuition with probabilistic forecasting and linear programming / allocating inventory across warehouses under real-world demand uncertainty.
Mid-market e-commerce allocates inventory the same way they did a decade ago: by feel.
When demand is uncertain and warehouses span regions with very different volatility profiles, manual allocation breaks down: stockouts on one coast, deadweight inventory on the other.
The baseline cost of getting this wrong, for the dataset analyzed here, was $142,000 per week in penalty exposure and excess holding cost.
From historical data to a decision engine, in three phases.
Data exploration
Two years of weekly demand across 300 SKUs and 3 warehouses / 93,600 observations. Surfaces regional volatility differences, seasonality, and category-specific risk profiles.
Probabilistic profiling
Monte Carlo simulation generates P50, P95, and P99 demand intervals per SKU. Replaces averages with quantified uncertainty and true penalty exposure.
LP optimization
Linear programming minimizes total inventory cost under warehouse capacity and service-level constraints. Output: a mathematically optimal allocation.
The dataset.
- Observations
- 93,600 weekly rows
- SKUs
- 300 distinct products
- Warehouses
- 3 facilities · 3 regions
- Window
- 2 years of history
- Grain
- Weekly demand
Pipeline
- 01Data collection / cleaning · Pandas
- 02Exploratory analysis / feature engineering
- 03Volatility / risk assessment · NumPy + Seaborn
- 04Demand pattern profiling · Statistical analysis
- 05Optimization input preparation
Volatility is not uniform / SKU portfolio CV distribution
Regional demand trends / East vs Central, 52 weeks
Probabilistic demand profile / Monte Carlo, example SKU
Linear programming, plainly stated.
With demand uncertainty quantified, the question becomes mathematical: what allocation minimizes total cost while meeting service levels? LP finds the provably best answer inside the real constraints of capacity and demand.
$142K to $65K weekly / a 54% reduction, sustained.
Tools
- Python
- Pandas
- NumPy
- SciPy
- PuLP
- Matplotlib
- Seaborn
- Plotly
- Jupyter