M6: startDrain's cut (drainCut) as loops #
Each loop of drainCutP only changes locals; its result is a fold over the iterations, and the
lemmas here identify those folds with List.sum, cutLen, shiftR and shiftL.
The folds #
The procedure #
w := drainWt h e.
Equations
- One or more equations did not get rendered due to their size.
Instances For
t := the sum of the weights of the children of v``.
Equations
- One or more equations did not get rendered due to their size.
Instances For
Accumulate the weights of the first n children in local t.
Equations
Instances For
The greedy cut over the first n - 1 children, with budget t / 2.
Equations
- One or more equations did not get rendered due to their size.
Instances For
Find a weight-balanced cut before the last child.
Equations
- One or more equations did not get rendered due to their size.
Instances For
Read children k - 1 and k into a, e (for 0 < k < n).
Equations
- One or more equations did not get rendered due to their size.
Instances For
drainPr: children a, e are targets of one drain.
Equations
- One or more equations did not get rendered due to their size.
Instances For
shiftR: move the cut k right past pairs, at most n times.
Equations
- One or more equations did not get rendered due to their size.
Instances For
Advance a cut right by one while the adjacent children satisfy the pair restriction.
Equations
- One or more equations did not get rendered due to their size.
Instances For
Scan right for an admissible cut, stopping at the first rejected pair.
Equations
Instances For
shiftL from n - 1: move the cut left past pairs, at most n times.
Equations
- One or more equations did not get rendered due to their size.
Instances For
Advance a cut left by one while the adjacent children satisfy the pair restriction.
Equations
- One or more equations did not get rendered due to their size.
Instances For
Scan left from the last child for an admissible cut.
Equations
- One or more equations did not get rendered due to their size.
Instances For
startDrain's cut: k := drainCut (children of v) … for a node v of height h.
Equations
- One or more equations did not get rendered due to their size.