Definition · Approximation scheme, and the fully polynomial kindA polynomial-time approximation scheme is a family of algorithms, one per ε > 0, each running in time polynomial in the input size and returning a value within 1 + ε of the optimum. It is fully polynomial when the running time is also polynomial in 1/ε, so that halving the error does not square the cost.
The algorithm
- Let vmax be the largest value and n the number of items. Set K = ε · vmax / n.
- Replace each value v by the integer part of v / K.
- Solve the scaled instance exactly with the value-indexed table, which is now much smaller.
- Return the set of items the scaled table chose, valued at their ORIGINAL prices.
The last step is the one to get right. The answer is the set, not the scaled number: reporting the scaled optimum would report a value in the wrong units and it is the standard way an approximation scheme comes out looking wrong. The guarantee is about the original value of the chosen set.
Theorem · The scheme loses at most ε times the optimumLet S be the set the scaled table chooses and S* an optimal set for the original instance. Then the original value of S is at least OPT - ε · OPT.
Write v' for the scaled values. For any item, K · v'(i) ≤ v(i) < K · v'(i) + K, so scaling then rescaling loses less than K per item.
S is optimal for the scaled instance, so v'(S) ≥ v'(S*). Multiplying by K and using the two inequalities, the original value of S is at least K · v'(S) ≥ K · v'(S*) > v(S*) - |S*| · K ≥ OPT - n · K.
Now n · K = ε · vmax, and vmax ≤ OPT because the single most valuable item is a feasible solution on its own — assuming it fits, which items too heavy to fit are discarded first to ensure. So the loss is at most ε · OPT.
□
What the lab measured
The instance is six items 3:520, 4:610, 5:805, 2:311, 6:902, 4:455 with capacity 12, and epsilon at 1/10. The largest value is 902 and there are six items, so K = 902/60 = 451/30, about 15.033. The scaled values are 34, 40, 53, 20, 60 and 30. The scaled table chooses the first three items, whose original value is 1935 — exactly the optimum. The promised loss is ε · OPT = 387/2, that is 193.5, and the realised loss is 0.
The cost side is the other column. The exact table is indexed by value from 0 to the sum of the values, which is 3603, so 3604 cells. The scaled table needs 238. That is the whole trade: a promise of losing up to a tenth of the optimum, bought with a table one fifteenth the size, and on this instance the promise was not called in at all.
Example · The epsilon sweep, as two columnsThe panel sweeps ε = 1, 1/2, 1/4, 1/8, 1/16 and 1/32 and prints the cells and the loss at each: 24, 47, 95, 190, 382 and 765 cells, with a realised loss of 0 at every one. The cells roughly double as epsilon halves, which is what “polynomial in 1/ε” looks like as integers, and the loss column stays at zero because this instance is kind. A promise is an upper bound on the loss and this one is never reached.
Where the scheme costs more than it saves
Switch to the five small items 3:5, 4:6, 5:8, 2:3, 6:9 with capacity 10 — the instance the branch-and-bound page used. The exact table has 32 cells. At epsilon one tenth, K = 9/50, which is less than 1, so dividing by it makes the values BIGGER: the scaled values are 27, 33, 44, 16, 50 and the scaled table needs 171 cells. The scheme is a fivefold loss, and the answer is the exact optimum either way.
This is worth more than a footnote. An approximation scheme is an asymptotic device: its saving comes from large values, and on small ones the scaling is counterproductive rather than merely useless. The cell counts say so, and nothing about the complexity class does. It is also a clean instance of the hazard this Subject is built around, in the direction people do not expect — the asymptotically better method losing on the instance on screen.
One more reading from the same sweep, on that small instance: at ε = 1 the scheme returns 15 against an optimum of 16, a loss of 1 inside a promise of 16, and at every smaller epsilon it returns 16 exactly. So the only epsilon at which the promise was ever needed is the one nobody would choose.