The Wagner-Whitin recurrence solves lot-sizing by dynamic programming. Each F entry is a minimum over possible order periods for the last replenishment.
highlighted = computed this step
DP State
F(t) is the minimum exact cost to cover periods up through t. Motivation: each state remembers the best plan for a prefix before the next decision is made.
F(t)=imin{F(i−1)+K+holding(i,t)}
Computed F Row
The computed F row is 0, 5, 8, 10, and 15. Why: every entry is the exact minimum over possible last order periods.
F=0,5,8,10,15
Final Cell
For the last period, the candidate costs are 22, 19, 17, and 15; the minimum is 15. Interpretation: the final order-period choice closes the full horizon and points traceback to the last block.
F(4)=min{22,19,17,15}=15
Diagram note
Honesty note: Wagner-Whitin is exact for this pinned finite discrete demand instance. Pixel positions are rounded for layout; every number shown is exact.