An optimal algorithm exists, it runs in \(O(N^2)\), and it fits on half a page. So why is almost every planning system in the field running something else?
Recall the recursion: \(V(u) = \min_t\{V(t-1) + w(t,u)\}\). \(V(N)\) depends on every window cost, and every window cost depends on the requirements out to period \(N\). That is, the decision for period 1 has been made to depend on a number \(N\) periods out.
It is assumption 2: the requirements are known. They are a forecast, and nobody believes month 12’s. A heuristic that looks only a few periods ahead makes the period 1 decision from data the planner can believe.
That is the case for heuristics here, and it is not an argument about running time.
Start an order in period \(t\) and extend the window one period at a time. At each step compute a figure of merit for the window so far, and stop when it stops improving. The next order starts in the period after the window ends.
| Rule | Figure of merit for the window \([t,u]\) | Stop when |
|---|---|---|
| Silver-Meal | \(w(t,u) / (u - t + 1)\), cost per period | it rises |
| Least unit cost | \(w(t,u) / d[t,u]\), cost per unit | it rises |
| Part-period balancing | \(w(t,u) - k_t\), what the window carries | it passes \(k_t\) |
All three read the same window costs the recursion used. That is what makes comparing them a comparison and not an accident of arithmetic.
Silver-Meal minimizes cost per period. Recall that the economic order quantity minimizes cost per unit time because every cycle is identical. Here the cycles are not, so this is a local imitation of that argument and not a consequence of it.
Least unit cost minimizes cost per unit, as a buyer thinks in dollars per piece. Adding a period always adds units to the denominator, so a long window is flattered by the arithmetic.
Part-period balancing recalls that the economic order quantity sets setup equal to holding, and extends the window until its carrying is as close as it can get to \(k_t\). Dividing by \(h\) counts part-periods: for the belt, about \(k/h = 300\) belt-months.
Silver-Meal and least unit cost walk a number to a minimum and keep the period before the first rise. Part-period balancing walks a number past a target, then keeps whichever of the last two came closer. It can step back.
Start in month 1 and extend, reading \(w(1,u)\) from the window table.
| \(u\) | \(w(1,u)\) | \(d[1,u]\) | Silver-Meal, \(w/u\) | Least unit cost, \(w/d[1,u]\) | Part-period, \(w - k\) |
|---|---|---|---|---|---|
| 1 | 300 | 40 | 300.00 | 7.500 | 0 |
| 2 | 360 | 100 | 180.00 | 3.600 | 60 |
| 3 | 600 | 220 | 200.00, rises | 2.727 | 300, at \(k\) |
| 4 | 1,500 | 520 | 375.00 | 2.885, rises | 1,200, past \(k\) |
Silver-Meal stops at \(u = 2\): the cost per period rises from $180.00 to $200.00. It orders \(d[1,2] = 100\) belts.
Least unit cost stops at \(u = 3\): $2.727 a belt is least, and $2.885 is a rise. It orders 220.
Part-period balancing carries exactly $300 at \(u = 3\). Nothing can come closer, so it also orders 220.
Continuing each rule to the end of the horizon:
| \(t\) | 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | 12 |
|---|---|---|---|---|---|---|---|---|---|---|---|---|
| \(d_t\) | 40 | 60 | 120 | 300 | 420 | 260 | 120 | 40 | 0 | 80 | 180 | 220 |
| Silver-Meal | 100 | 0 | 420 | 0 | 840 | 0 | 0 | 0 | 0 | 260 | 0 | 220 |
| Least unit cost | 220 | 0 | 0 | 720 | 0 | 380 | 0 | 300 | 0 | 0 | 0 | 220 |
| Part-period balancing | 220 | 0 | 0 | 720 | 0 | 420 | 0 | 0 | 0 | 260 | 0 | 220 |
| Optimal | 220 | 0 | 0 | 300 | 420 | 420 | 0 | 0 | 0 | 260 | 0 | 220 |
All three place five orders, and the optimum places six. That is the first surprise.
The heuristics are not ordering too often. They are ordering too seldom, and the carrying that buys is what costs them.
Extend from month 5. Each step adds \(h(u - 5)\,d_u\) to the window cost:
| \(u\) | \(d_u\) | Step \(h(u-5)d_u\) | \(w(5,u)\) | Length | Cost per period |
|---|---|---|---|---|---|
| 5 | 420 | 300 | 1 | 300.00 | |
| 6 | 260 | \(1 \times 260 = 260\) | 560 | 2 | 280.00 |
| 7 | 120 | \(2 \times 120 = 240\) | 800 | 3 | 266.67 |
| 8 | 40 | \(3 \times 40 = 120\) | 920 | 4 | 230.00 |
| 9 | 0 | \(4 \times 0 = 0\) | 920 | 5 | 184.00 |
| 10 | 80 | \(5 \times 80 = 400\) | 1,320 | 6 | 220.00, rises |
It never rises until month 10, so one order covers five months: 840 belts. Months 6 to 8 have falling requirements and month 9 has none, so each step adds little to the numerator and a full period to the denominator. The average falls because the window is longer, not because the plan is better.
| Method | Orders | Setup | Carrying | Relevant cost | Penalty |
|---|---|---|---|---|---|
| Lot-for-lot | 11 | $3,300 | $0 | $3,300 | +33.06% |
| Least unit cost | 5 | $1,500 | $1,540 | $3,040 | +22.58% |
| Periodic order quantity, \(T = 2\) | 6 | $1,800 | $960 | $2,760 | +11.29% |
| Silver-Meal | 5 | $1,500 | $1,160 | $2,660 | +7.26% |
| Adjusted economic order quantity | 6 | $1,800 | $800 | $2,600 | +4.84% |
| Part-period balancing | 5 | $1,500 | $1,100 | $2,600 | +4.84% |
| Wagner-Whitin | 6 | $1,800 | $680 | $2,480 | optimal |
The penalty is measured against the optimum: for example, \((2{,}660 - 2{,}480)/2{,}480 = 180/2{,}480 = 7.26\%\).
Silver-Meal, usually the best heuristic on average, is beaten here by two others. One instance settles nothing. What it shows is how far apart the methods land on one item: the choice among the three heuristics is worth almost eighteen points.
If the requirements barely vary, the economic order quantity already has the answer. Let the variability coefficient be the variance of the requirements over the square of their mean:
\[ \begin{aligned} VC &= \frac{\frac{1}{N}\sum_t (d_t - \bar{d})^2}{\bar{d}^2} = \frac{\overline{d^2} - \bar{d}^2}{\bar{d}^2} &&\text{expand the square}\\ \overline{d^2} &= \tfrac{1}{12}(40^2 + 60^2 + \cdots + 220^2) = \tfrac{456{,}800}{12} = 38{,}066.67 &&\text{the mean of the squares}\\ VC &= \frac{38{,}066.67 - 153.33^2}{153.33^2} = \frac{14{,}555.56}{23{,}511.11} = 0.6191 &&\text{dimensionless: belts or pallets alike} \end{aligned} \]
The rule of thumb: \(VC < 0.2\) calls for an economic order quantity, \(VC \ge 0.2\) for the methods of this chapter. The belt is well past it.
It is a rule of thumb and not a theorem. The adjusted economic order quantity is within 4.84% of optimal at \(VC = 0.6191\), better than the rule would lead you to expect.
Solve the belt with a ratio \(k/h\) that is wrong by a factor \(m\), then charge the plan at the true costs.
| \(m\) | 0.25 | 0.5 | 0.75 | 1 | 1.5 | 2 | 4 |
|---|---|---|---|---|---|---|---|
| Orders | 9 | 9 | 7 | 6 | 4 | 4 | 3 |
| Cost at true costs | $2,800 | $2,800 | $2,540 | $2,480 | $2,660 | $2,660 | $3,280 |
| Penalty | 12.90% | 12.90% | 2.42% | 0% | 7.26% | 7.26% | 32.26% |
A factor of two either way costs less than 13%: the flatness of the economic order quantity survives the move to discrete periods. The curve is a staircase, since the plan does not change over a range of \(m\). Ordering too often is the more expensive mistake here: every extra order costs a full $300, while the carrying it saves is spread thin.
Silver-Meal’s penalty is 7.26%. Getting \(k/h\) wrong by a factor of two also costs 7.26%. An organization that has not measured \(k\) to within a factor of two, and most have not, is not in a position to care which method it uses.
No item is planned over a horizon that ends. The planner solves over the next \(N\) periods, places only the current period’s order, waits a period, and solves again over a horizon that has moved forward and gained a new last period.
Two things follow immediately.
Only the first decision matters. The quality of a method is the quality of the sequence of first decisions it produces, not of the plans.
Wagner-Whitin is no longer optimal. It is optimal for the problem it was handed, and that problem is a truncation of the real one.
Roll the belt: at each month solve over the next \(W\) months, place that month’s order, move on. The realized cost of the twelve months of orders actually placed:
| Planning window \(W\) | 2 | 3 | 4 | 5 | 6 |
|---|---|---|---|---|---|
| Silver-Meal | $2,640 | $2,840 | $2,660 | $2,660 | $2,660 |
| Wagner-Whitin | $2,640 | $2,480 | $2,480 | $2,480 | $2,480 |
Wagner-Whitin reaches the full-horizon optimum at \(W = 3\) and stays there. That is the forced order at work: month 5 must order, so the decision for month 4 cannot be improved by anything beyond month 5, and a three-month window already sees far enough.
Silver-Meal never reaches it, and is not even monotone in the window. A three-month window costs it $200 more than a two-month window. More periods to average over is what drives its cost per period down and its windows too long.
It is often said that under a rolling horizon a heuristic can beat the optimal algorithm. Settle it by measurement: 2,000 random twelve-period schedules, \(k = \$200\), \(c = \$50\), \(i = 0.02\), each rolled under both rules.
| Window \(W\) | Silver-Meal cheaper | Wagner-Whitin cheaper | Tied | Mean, Silver-Meal | Mean, Wagner-Whitin |
|---|---|---|---|---|---|
| 3 | 360 | 704 | 936 | $1,440.91 | $1,429.90 |
| 4 | 246 | 886 | 868 | $1,395.74 | $1,375.08 |
| 6 | 71 | 1,062 | 867 | $1,383.20 | $1,350.14 |
Silver-Meal does win: 360 times in 2,000 at \(W = 3\), so the claim is not empty. The two tie about 45% of the time. When they differ the algorithm is ahead about two to one at \(W = 3\) and about fifteen to one at \(W = 6\), and it is cheaper on average at every window.
The rolling horizon does not rescue the heuristic. It removes the guarantee, which turns a proof into an empirical question, and the empirical answer still favors the algorithm.
Each period the plan is recomputed, and the new plan may disagree with the old one about orders not yet placed. Suppliers were told to expect 300 belts in month 7, and now the plan says 0. That instability is nervousness.
Part of it comes from the method. What each rule commits to in month 1:
| Window \(W\) | 2 | 3 | 4 | 5 | 6 |
|---|---|---|---|---|---|
| Silver-Meal | 100 | 100 | 100 | 100 | 100 |
| Wagner-Whitin | 100 | 220 | 220 | 220 | 220 |
The heuristic is steadier here, because it never looks far enough ahead for a distant period to change its mind.
A freeze fence fixes the plan for the first several periods and forbids the next solve from changing them. It converts instability into inflexibility, which is sometimes the better problem. Committing \(F\) periods at a time is the same idea.
A time fence is softer: inside it, changes need approval; outside it, the plan may move freely.
A change penalty adds a cost for every order that differs from the previous plan, so the previous plan becomes part of the data. It is the most direct treatment and the least used, for that reason.
The requirements planning chapter returns to all three, because nervousness at one level of a bill of material propagates downward and multiplies.
Heuristics answer assumption 2, not running time: the recursion makes period 1 depend on a forecast \(N\) periods out.
Three rules are one procedure with three figures of merit, all reading the same window costs.
On the belt the heuristics order too seldom, and Silver-Meal’s 840 in month 5 is a cost-per-period rule fooled by a declining tail and a dead period.
The penalties run from 4.84% to 22.58%, the same order as getting \(k/h\) wrong by a factor of two; \(VC = 0.6191\) says lot sizing is worth doing at all.
The rolling horizon removes Wagner-Whitin’s guarantee without handing the advantage to the heuristic, and the heuristic’s steadiness is its real argument.
Read before next session: Building These Models in a Worksheet and Designing the Software.
Today’s material was Three Heuristics and One Shape, What a Heuristic Costs and The Rolling Horizon.
Next session:
Chapter5Models.xlsx, and the cells that carry the window costs, the recursion and the tracebackThe worksheet cannot roll a horizon. Next session says why, and shows the class that exists because of it.