How to use it
- 1. Type your demandsTwelve months, all editable. Lumpy demand is where lot-sizing gets interesting.
- 2. Set the economicsSetup cost K per order vs holding cost h per unit per month - the eternal trade-off.
- 3. Compare four policiesLot-for-lot, EOQ-style POQ, Silver–Meal, and the exact Wagner–Whitin optimum.
- 4. Read the DP matrixEach cell = cost of one ordering choice; the red path is the shortest route through the months.
Dynamic lot-sizing
Monthly demand
Economics
High K → batch months together. High h → order little and often. Wagner–Whitin finds the exact break-points.
Total cost
Swipe the chart and the matrix sideways to read the numbers.
The optimal plan: red bars = order quantities (annotated with the months they cover), navy steps = inventory carried.
The DP: cell (t,j) = setup + holding cost of ordering in month t to cover through month j. Red cells are the choices on the optimal path; W–W is a shortest path through this matrix.
Try these experiments
- Push K to $400: Wagner–Whitin merges months into big batches, and the gap to lot-for-lot explodes.
- Find a demand pattern where Silver–Meal picks a different plan than W–W - the heuristic is myopic; the DP looks all the way ahead.
- Note orders always equal a whole number of future months’ demand - the zero-inventory-ordering property, provable, and the reason the DP only needs 78 cells.
About this tool
The concept
When demand varies month to month, no fixed order quantity is right. Dynamic lot-sizing decides which months get an order - batching demand forward against holding cost.
How it works
Wagner–Whitin (1958) dynamic programming: F(j) = mint≤j [F(t−1) + K + holding(t..j)]. The ZIO property guarantees an order arrives only when inventory hits zero, so the search space collapses.
Winning strategy
Trust break-even months: batch another month in only while its added holding cost is below K. Silver–Meal does that greedily and is usually within 1–2%; W–W is exactly optimal.