Michel Goemans Created 2026-10-14 Updated 2026-11-05
Michel Goemans authored notes on matroid optimization. Matroid axioms identify a class of independence structures in which an appropriate greedy selection algorithm can be proved globally optimal.[ref]
Matroid optimization by Michel Goemans. author attribution and the described mathematical development
Portrait of Michel Goemans
. Martin Böhm; MAPSP 2015, 12 June 2015. CC BY-SA 4.0, via Wikimedia Commons. Source.Assume . Use bottom-up heap construction to make a max-heap of the first input items. For each subsequent input value , compare it with the root. If is at least the root, discard it; otherwise replace the root by and apply heapify down. Return the final root.
The loop invariant says the heap contains a multiset of the smallest values seen so far. It holds after initialization. If is at least the current largest retained value, the already retained items are no larger, so discarding preserves the invariant. If is smaller, remove one largest retained value and keep instead; precisely the smallest values remain. This argument handles equal integers by treating repeated occurrences as separate items. At the end,Construction costs ; each remaining value uses one comparison and at most one logarithmic repair. Thus the selection algorithm has time complexityFor , the heap is a single running minimum and the time is . The uniform expression covers that boundary; interpreting the printed literally at would incorrectly make it zero.
Let . After each linear-time selection algorithm and partition, exactly elements are removed, so the successive input sizes are . Thus the standard efficient implementation takesHere selection can use median of medians for worst-case linear time; a suitable randomised linear-time selection routine gives the same bound in expectation. Merely sorting each remaining array would introduce an avoidable logarithmic factor.
Recursively partition into equal halves by rank, keeping the selected median in the lower half:All elements are distinct, so both halves have exactly elements. Since remains a power of two, every internal split occurs at a rank divisible by .
quantiles(A,k):
if length(A) == k:
return [maximum(A)]
p = select the (length(A)/2)-th smallest element of A
L = all elements of A at most p
R = all elements of A greater than p
return quantiles(L,k) followed by quantiles(R,k)For correctness, the desired ranks in the lower half are . In the upper half they are the same local multiples of , shifted by . These are exactly all desired global ranks. At a leaf of size , its maximum is its sole requested local rank. Induction therefore proves that the output contains every requested order statistic, in increasing order, including the original maximum. There is no separate internal-node output of
p, which would duplicate a rank already supplied by the lower subtree.Use a worst-case linear-time selection algorithm and linear partitioning. The divide-and-conquer algorithm hasThere are internal levels, each with total work , and leaves with total work . Since the source assumes , the running time isThis is multiselection by balanced rank partitioning. In-place selection and partitioning can use the original array; the output has values. The multiselection recursion has depth ; the selection routine contributes its own auxiliary storage.
Quickselect Created 2026-10-24 Updated 2026-10-31
A selection algorithm that uses array partitioning around a pivot and recursively searches only the side containing the desired order statistic. If there are entries before the placed pivot, an earlier rank is unchanged and a later rank is reduced by . Segment length strictly decreases, proving algorithm termination. The same reduction can update local bounds in a loop, using constant auxiliary space.
Balanced reductions give linear work by a geometric series, while repeatedly discarding only a constant number of entries can give quadratic work. For distinct entries and independent uniform random pivots, a pivot in the middle half has probability at least one half and reduces the retained length to at most three quarters, up to rounding. The expected number of attempts for each such reduction is bounded, so summing expected work over geometric size scales gives expected time. This random-pivot guarantee is not a worst-case guarantee for a deterministic median-of-three heuristic. With duplicates and a strict two-way partition, random pivot choice alone can also fail to shrink an all-equal segment; a three-way partition treats equal keys together.
