Optimal Inventory Control

Linear programming for 12-month replenishment

Learning prototype · synthetic data · independent 2026 rebuild of SRH Hamburg coursework (Nov–Dec 2024) · built with Lovable and AI assistance

A linear-programming model that sets monthly order quantities and ending inventory to minimise cost under demand, inventory-balance and storage-capacity constraints.

  1. Try it in 30 seconds
  2. 1Choose a scenario
  3. 2Move one slider
  4. 3Compare the new order plan and cost
Product
Scenario — loads sample inputs; adjust them freely

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
Demand vs. optimal order demand order ceiling
050100150200JanFebMarAprMayJunJulAugSepOctNovDecJanDemand 35Order 36Ceiling 115
Ending inventory trajectory stock capacity
050100150200JanFebMarAprMayJunJulAugSepOctNovDeccapacity 180JanEnd stock 41Capacity 23%

12-month optimal plan

MonthDemandOrder€ / unitEnd stockCapacity useCost
Jan353616.504123%€639
Feb41017.6000%€0
Mar585818.0000%€1,044
Apr808517.6053%€1,502
May10211516.501810%€1,917
Jun11911515.00148%€1,740
Jul12511513.5042%€1,557
Aug11911512.4000%€1,426
Sep10210212.0000%€1,224
Oct8011512.403519%€1,465
Nov586413.504123%€909
Dec41015.0000%€0
Total960920€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

€13,42345 units: €13422.804590 units: €13422.8090135 units: €13422.80135180 units: €13422.80180225 units: €13422.80225270 units: €13422.80270315 units: €13422.80315360 units: €13422.80360Storage capacity (units)

Replenishment flow

Jan · opening stock 40 → order 36 → ship 35 → ending 41

Supplier
ceiling 115
+36
Stock
41
23% of 180
−35
Demand
met in full

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 … 12

pₜ 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.