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.

300 SKUs3 Warehouses93,600 Observations54% Cost Reduction
01The Problem

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.

44
SKUs in chronic unmet-demand state
30%
Higher demand variance in East vs Central
$83K
Weekly penalty exposure in Electronics
02Approach

From historical data to a decision engine, in three phases.

PHASE 01

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.

PHASE 02

Probabilistic profiling

Monte Carlo simulation generates P50, P95, and P99 demand intervals per SKU. Replaces averages with quantified uncertainty and true penalty exposure.

PHASE 03

LP optimization

Linear programming minimizes total inventory cost under warehouse capacity and service-level constraints. Output: a mathematically optimal allocation.

03Data Architecture

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

  1. 01Data collection / cleaning · Pandas
  2. 02Exploratory analysis / feature engineering
  3. 03Volatility / risk assessment · NumPy + Seaborn
  4. 04Demand pattern profiling · Statistical analysis
  5. 05Optimization input preparation
04Key Findings

Volatility is not uniform / SKU portfolio CV distribution

Fig. 0144 SKUs sit in the high-volatility tier (gold) and demand a buffered allocation strategy. A single 'average' service level across the catalog leaves money on the table.

Regional demand trends / East vs Central, 52 weeks

Fig. 02East shows ~30% greater week-over-week variance than Central despite similar seasonal means. The optimizer treats them as structurally different problems, not interchangeable buckets.

Probabilistic demand profile / Monte Carlo, example SKU

Fig. 03P50 covers the median week. P95 sets the safety stock target. P99 quantifies tail-risk exposure. Allocation decisions move from a point estimate to a confidence-aware policy.
05Optimization Model

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.

Decision variables
x[sku, warehouse] ∈ ℝ⁺
Objective
min Σ (holding · x + penalty · shortfall)
Subject to
Σ x[·, w] ≤ capacity[w]
Σ x[s, ·] ≥ P95_demand[s]
x ≥ 0
06Business Impact

$142K to $65K weekly / a 54% reduction, sustained.

Before / manual allocation
$142K
Weekly inventory + penalty cost
After / decision engine
$65K
Weekly inventory + penalty cost
$76,644
Weekly savings
$4,000,000
Annual savings
54%
Cost reduction
07Stack / Contact

Tools

  • Python
  • Pandas
  • NumPy
  • SciPy
  • PuLP
  • Matplotlib
  • Seaborn
  • Plotly
  • Jupyter