The fold that minimises the path length is not the fold that minimises the bill
The fold that minimises the path length is not the fold that minimises the bill
Misra-Gries over 32 shards whose loads span 17.6-fold, folded four ways. The weighted external path length is the quantity Huffman's construction minimises by proof, and the size-ordered fold does minimise it — 123,134 against the balanced tree's 147,365. The damage does not follow it: the tree leaves 148 and the size-ordered fold 183. The middle column is the quantity that does track — the sum of the cuts the fold took, whose least is balanced, the same shape as the least damage. A level is not a fixed charge; the cut at a merge grows with the mass under it.
Drawn at 700 × 348, wide on the page.
Everything above is what fold-order returns with no arguments; the caption is the
generator's own, computed from the numbers in the drawing rather than written beside it.
6 essays call
fold-order. The drawing above is what it returns with no arguments at all; every
call below passes it something, because a placement that passes nothing draws whichever
member of the family the generator happens to default to rather than the one its essay
argues about — which is what optcheck and figfill exist to catch.
Where it is called
Changing this generator changes every one of these figures.