John Kirima / Case Study← Back to portfolio
01Opening
A Decision Intelligence Engine for Supply Chain Allocation

Rebuilding Inventory Allocation to Protect Margin Under Demand Uncertainty.

Three warehouses. Three regions. Three hundred SKUs. One legacy allocation logic that looked reasonable on average and leaked margin every single week. I rebuilt the allocation engine and recovered roughly four million dollars a year, with no new inventory and no increase in warehouse capacity — just a smarter planning decision built on probabilistic demand modeling.

Role

I engineered the entire case study from the ground up — designed the data architecture, built the simulation pipelines, analyzed the risk vectors, implemented the Monte Carlo simulation, and formulated the linear programming model.

Strategy A · Baseline

Naive Mean Strategy

$142,224.92
Weekly cost / planned to average demand

Plans to an average week. Overstocks slow movers, starves the volatile lines, and gives back margin the moment one region runs hot.

Strategy B · DI Engine

Optimized Plan

$65,580.72
Weekly cost / optimized allocation

Plans against the bad week, not the average week. Absorbs a +30% East region surge with no manual replan.

Weekly delta
−$76,644.20

A 54% reduction in weekly operating cost. Roughly $3.98M annualized, recovered from the same data by making a smarter decision against it.

02The Problem

Mid-market operators do not lose margin because demand is unknowable. They lose it because decisions are made against averages that hide risk.

A forecast that looked right on average, and was wrong every single week.

The legacy plan took one average week of demand per product, split it across warehouses by historical share, and shipped whatever the orders called for. On paper it balanced. In the real business it never did.

Margin leaked through dead stock in the West, expedited freight into the East, write-downs on slow movers, and lost sales on the volatile lines. No single failure was loud. Hundreds of small mismatches compounded every week.

The fix was never a sharper forecast. It was a sharper decision.

03Diagnosis

Two broken assumptions the old plan was quietly absorbing.

The legacy plan prepared for an average week, completely missing the fact that a handful of highly volatile products were causing the largest stockouts in the catalog.

At the same time, a +30% demand surge was silently bleeding money in the East region. Averaged across the whole network, the signal vanished. On the ground, it was the story.

In plain terms

A small group of products swung so widely week to week that any single average was meaningless. The cost of getting them wrong dominated the entire plan.

Fig. 03.AVolatility by product
Products above the threshold swing too widely week to week for an average to be a safe planning target.
Fig. 03.BEast region demand surge
The rest of the network holds flat. East climbs +30% over six weeks. Any credible plan has to absorb that.
04Probabilistic Plan

Stop planning for one week. Plan for ten thousand of them.

Instead of planning against one expected number, the engine simulates ten thousand realistic versions of next week, built from historical demand patterns and the modeled East region surge.

The output is not a prediction. It is the honest range of weeks the business will actually live through, expressed in dollars and risk instead of a single point estimate.

Three numbers matter. A normal week. A bad week the business should plan against. And the rare week it must survive.

P50 / normal
$65.6k
P95 / plan to
$78.2k
P99 / survive
$84.1k
Fig. 04Simulated weekly cost distribution
Costs in thousands of dollars. The accented markers flag the bad-week (P95) and survive-week (P99) thresholds.
05Optimization

The decision logic is straightforward.

This engine answers one core question: How much of each SKU should be positioned in each warehouse so total weekly cost is minimized under real operating constraints?

What the model optimized
  • • Inventory holding cost across terminal nodes.
  • • Stockout penalty exposure in volatile regions.
  • • Shipping costs across multi-lane warehouse-region transit paths.
  • • Physical warehouse capacity utilization.
What constraints the plan had to respect
  • Capacity Ceilings: Each warehouse has a hard, physical volume limit that cannot be exceeded.
  • Service Floors: Every region must be protected for a bad-week demand threshold, not just an average week.
  • Operational Reality: Product allocations must remain feasible and non-negative.
  • Network Optimization: The model makes trade-offs across the full network simultaneously, not SKU by SKU in isolation.
Why this matters

The optimization engine did not just produce a cheaper answer. It produced a more realistic allocation policy — one that respected physical limits, protected high-risk demand, and converted uncertainty into an operational decision.

06Business Impact

Same data. Same constraints. A different decision.

On the same data and the same warehouse limits, the optimized plan lands at $65,580.72 a week against $142,224.92 for the baseline. The gap is not a better forecast. It is the value of allocating against the right picture of demand.

Weekly cost delta
−$76,644
A 54% reduction, roughly $3.98M recovered every year, with the plan holding through a +30% East region surge without a replan.
What changed operationally
  • Inventory moved closer to the specific regions where volatility actually lived.
  • High-penalty SKUs received capacity protection first when warehouse limits were tight.
  • Network planning shifted from single average-week logic to robust bad-week boundaries.
  • The +30% East region surge became a pre-modeled constraint instead of a costly operational surprise.
07Data & Methods

A compact decision system engineered around real operational constraints.

Scope
  • 300 SKUs
  • 3 Warehouses
  • 3 Regions
  • 104 Weeks of historical demand
Methodology
  • Exploratory demand analysis to surface network-wide volatility and geographic imbalance.
  • Coefficient of Variation mapping to isolate unstable, high-risk product lines.
  • Vectorized Monte Carlo simulation generating 10,000 unique demand scenarios.
  • P50, P95, and P99 planning thresholds to translate probabilistic risk into concrete numbers.
  • Linear programming via PuLP and the COIN-OR CBC solver to optimize allocation under strict constraints.
What the engine optimized
  • Holding costs across terminal nodes.
  • Localized stockout penalty exposure.
  • Multi-lane transit and logistics shipping costs.
  • Physical warehouse volumetric capacity usage.
08Engineering

A small toolkit. Sharp where it counts.

The infrastructure stays boring on purpose, so the decision layer can carry the weight. Statistics on NumPy and SciPy. Simulation on a vectorized Monte Carlo pipeline. Allocation solved with PuLP and CBC.

Python
Pandas / NumPy
SciPy
Monte Carlo
PuLP / CBC
Jupyter
09 · Conclusion

Better Planning Logic Recovered the Margin.

On the same network, with the same warehouse limits and the same demand patterns, the difference was not more inventory or a more complicated forecast. It was a better decision framework. By translating volatility into probabilistic planning thresholds and optimizing allocation under real operating constraints, I turned a fragile weekly planning process into a robust decision system that recovered roughly $3.98M in annualized margin.

10Close

The engine, the repository, or a direct conversation.

Every figure, every constraint, and every line of the optimization lives in the repository, written to be read.

Note: This is a standalone portfolio case study engineered using synthetic, highly realistic supply chain transactional data to simulate enterprise-scale network constraints.
© 2026 John Kirimasupplychain.johnkirima.com / Case study v1