Greedy rounds and pessimistic estimators #
The method of conditional expectations makes a sequence of binary choices one round at a time.
In each round it computes an estimate of the final cost after each of the two branches and takes
the branch with the smaller estimate (Cslib.PessimisticEstimator.greedyStep; ties go to
true) Williamson and Shmoys, Section 5.2. If the smaller branch
estimate is always at most the current estimate, the estimate never increases
(Cslib.PessimisticEstimator.estimate_greedyStep_le). This is all that is used of the estimate:
it need not be an exact conditional expectation, only a pessimistic estimator [Rag88]
Alon and Spencer, Chapter 16. The usual way to verify the premise is
averaging: if the two branch estimates sum to at most twice the current estimate, the smaller one
is at most the current estimate (Cslib.PessimisticEstimator.greedy_spec_of_add_le).
The premise is usually needed only on the states that the process can reach. The general
statement (Cslib.PessimisticEstimator.greedy_spec) assumes an invariant indexed by the rounds
still to come, which passes from a round to the rest along both branches, and asserts the premise
only where the invariant holds. It also returns the invariant for the final state, which is how
clients identify the final estimate with the cost of the constructed object.
Estimates take values in any linear order; the averaging form needs a linearly ordered
cancellative additive monoid, such as ℕ, ℚ or ℝ. Maximizing an estimate is minimizing its
negation.
Main definitions #
Cslib.PessimisticEstimator.greedyStep: one round, choosing the branch with the smaller estimate.Cslib.PessimisticEstimator.greedy: the rounds of a list, in order.
Main results #
Cslib.PessimisticEstimator.estimate_greedyStep: a round attains the smaller branch estimate.Cslib.PessimisticEstimator.estimate_greedyStep_le: a round does not increase the estimate if the smaller branch estimate is at most the current one.Cslib.PessimisticEstimator.greedy_spec: the method of conditional expectations with a pessimistic estimator, under an invariant indexed by the remaining rounds.Cslib.PessimisticEstimator.estimate_greedy_le: the special case of a fixed invariant.Cslib.PessimisticEstimator.greedy_spec_of_add_le: the averaging form ofgreedy_spec.
References #
One greedy round r from state s: take the branch true unless the branch false has a
strictly smaller estimate.
The greedy rounds of a list, in order.
A greedy round takes one of the two branches.
A greedy round attains the smaller of the two branch estimates.
A greedy round whose smaller branch estimate is at most the current estimate does not increase the estimate.
The method of conditional expectations, with a pessimistic estimator. Suppose an
invariant Inv, indexed by the rounds still to come, holds initially and passes from each round
to the remaining ones along both branches, and that wherever it holds the smaller of the two
branch estimates of the next round is at most the current estimate. Then the greedy rounds end in
a state satisfying the invariant for no remaining rounds, with an estimate at most the initial
one.
greedy_spec for an invariant that does not depend on the remaining rounds.
Averaging: greedy_spec when the two branch estimates sum to at most twice the current
estimate, as when the estimate is a conditional expectation over a fair coin.