A linear-programming model that sets monthly order quantities and ending inventory to minimise cost under demand, inventory-balance and storage-capacity constraints.
- Try it in 30 seconds
- 1Choose a scenario
- 2Move one slider
- 3Compare the new order plan and cost
Product B: mid volume, mid value · Demand swings strongly around a peak season.
- Total modelled cost
- €13,423
- Purchase
- €13,249
- Holding
- €174
- vs. simple feasible rule
- −€738
12-month optimal plan
| Month | Demand | Order | € / unit | End stock | Capacity use | Cost |
|---|---|---|---|---|---|---|
| Jan | 35 | 36 | 16.50 | 41 | 23% | €639 |
| Feb | 41 | 0 | 17.60 | 0 | 0% | €0 |
| Mar | 58 | 58 | 18.00 | 0 | 0% | €1,044 |
| Apr | 80 | 85 | 17.60 | 5 | 3% | €1,502 |
| May | 102 | 115 | 16.50 | 18 | 10% | €1,917 |
| Jun | 119 | 115 | 15.00 | 14 | 8% | €1,740 |
| Jul | 125 | 115 | 13.50 | 4 | 2% | €1,557 |
| Aug | 119 | 115 | 12.40 | 0 | 0% | €1,426 |
| Sep | 102 | 102 | 12.00 | 0 | 0% | €1,224 |
| Oct | 80 | 115 | 12.40 | 35 | 19% | €1,465 |
| Nov | 58 | 64 | 13.50 | 41 | 23% | €909 |
| Dec | 41 | 0 | 15.00 | 0 | 0% | €0 |
| Total | 960 | 920 | €13,423 | |||
Simple feasible rule: €14,161 · purchase €13,752 · holding €409. Orders demand within limits; shortages are pre-built in the nearest earlier month with supplier and storage room.
Why this plan
- Supplier ceiling reached in May, Jun, Jul, Aug, Oct; no more can be ordered in those months.
- Ending stock stays below the storage cap in every month.
- Nov orders can cover 41 units of Dec demand at a lower purchase-plus-holding cost than buying in those later months.
- Orders exceed that month's demand in Jan, Apr, May, Oct, Nov, building stock for later use.
Cost vs. storage capacity
Only capacity changes · ring = current setting · × = infeasible
Replenishment flow
supplier → stock → demandJan · opening stock 40 → order 36 → ship 35 → ending 41
How to read this plan
Blue bars above the outlined demand bars mean the model buys early — cheaper purchase months or a coming ceiling make carrying stock worth its holding cost. Coral marks a limit that is binding. The comparison follows a price-blind rule while respecting the same demand, supplier and storage constraints.
Model
A 12-month linear program
For one product, the model picks a monthly order qt and an ending inventory It for each of 12 months. It is solved in the browser with the open-source javascript-lp-solver (simplex). When no plan can meet every constraint, the app says so and names the first month that breaks.
minimise Σₜ ( pₜ · qₜ + h · Iₜ )
subject to Iₜ = Iₜ₋₁ + qₜ − dₜ (balance)
0 ≤ Iₜ ≤ C (storage, no backorders)
0 ≤ qₜ ≤ Uₜ (supplier ceiling)
I₀ given, t = 1 … 12pₜ unit purchase rate · h holding cost per unit-month · dₜ demand · C capacity · Uₜ supplier ceiling.
Assumptions & limits
Orders and stock are continuous quantities. Inventory balance links each month's orders and demand to the next month's starting stock.
Demo extensions
Month-varying purchase rates and supplier order ceilings make the cost of buying early visible over the 12-month planning horizon.
What was learned
Inventory balance constraints couple every month, so a limit in one month (a ceiling drop, a full warehouse) changes orders months earlier. Holding cost is the price of flexibility: the model only buys ahead when the saving on purchase rate or a coming bottleneck outweighs it.
About & limitations
How can monthly replenishment meet demand while balancing ordering and holding cost within storage limits?
University project · SRH Hamburg · Nov–Dec 2024 — rebuilt as an independent interactive demo, 2026
Original project
The original university work (SRH Hamburg, Nov–Dec 2024) planned replenishment for four products over 100 months with a linear program minimising ordering and holding costs under demand, inventory-balance and storage-capacity constraints, using CVXPY and pandas. Coursework notebook: optimal-inventory-control-notebook.
Data & limitations
Synthetic Product A–D only; no original dataset, course materials or findings are reproduced. Known deterministic demand, no lead times, backorders, expiry or uncertainty; continuous quantities, one product at a time. The 12-month horizon and varying rates/ceilings are demo extensions, not original findings. Cost differences are not verified business savings; not deployed in a real business.
Credits
University coursework: SRH Hamburg (Nov–Dec 2024). Independent 2026 rebuild: Harsh Patil, assisted by Lovable (AI). Solver: javascript-lp-solver (MIT). Type: IBM Plex.