441. Wagner–Whitin
441.1. Wagner-Whitin (finite horizon, time-varying demand)
Relax two dimensions from basic EOQ at once: planning horizon is now finite, and demand is no longer constant — it varies period by period (still known and deterministic). No closed-form ; the answer is a schedule of when to order, found by dynamic programming.
441.1.1. Setup
- Periods (e.g., months in a finite production plan).
- Known demand in each period.
- Order cost per order placed (independent of size).
- Holding cost per unit carried one period forward.
- Decision: in which periods to place orders, and how much each order covers.
441.1.2. Zero-inventory ordering (ZIO) property
Claim: In an optimal Wagner-Whitin schedule, an order is placed only when starting inventory is zero.
Proof sketch: If you start a period with leftover stock and then order more, you could have ordered less the previous time and placed the same total order one period later — saving holding cost without changing the order count. So orders always coincide with the inventory hitting zero.
Consequence: each order covers a consecutive block of periods (for some ). The decision space collapses from “how much in each period” to “which blocks to use” — a much smaller problem solvable by DP.
441.1.3. Cost of a single order block
If we order in period to cover demands :
- Order cost: (one order).
- Holding cost: each unit consumed in period () sat in inventory for periods. Total holding for the block:
Block cost:
441.1.4. DP recursion
Let = minimum cost to cover demand for periods . Boundary: .
For each , the last order block ends at and starts at some :
Solve forward: . Track the argmin at each step to reconstruct the schedule.
441.1.5. Algorithm
- Compute “Cost” for all pairs .
- Forward pass: for each , compute and store .
- Backtrack from : order in covering , then recurse on .
Complexity: in the number of periods.
Example
Given (small 4-period example):
- 4 periods with demands
- Order cost: = $50 / order
- Holding cost: = $1 / unit / period
Step 1 — block costs
:
| \ | 1 | 2 | 3 | 4 |
| 1 | 50 | 50 + 20 = 70 | 70 + 10 = 80 | 80 + 45 = 125 |
| 2 | — | 50 | 50 + 5 = 55 | 55 + 30 = 85 |
| 3 | — | — | 50 | 50 + 15 = 65 |
| 4 | — | — | — | 50 |
Each cell is the cost of one order placed in period that covers demand through period .
Step 2 — DP forward pass
.
. ()
. ()
. ()
. ()
Step 3 — reconstruct schedule
→ order in period 1, covers periods 1–4. Total cost = .
Step 4 — compare to basic EOQ on the average demand
Total demand over 4 periods → average per period (or 50/year if months year, /year). EOQ would give a single and a stationary cycle — but this problem’s demand is not stationary (period 4 is 3× period 3), so a stationary order cycle wastes either order cost or holding cost.
Wagner-Whitin’s answer (one big order in period 1) is cheaper than any stationary EOQ schedule because it adapts to the lumpy demand profile.
This is the value of dropping the “infinite horizon, stationary demand” assumption: when demand has structure, the optimal policy reflects that structure, not a one-size-fits-all .