Online bipartite matching: model, greedy 1/2-competitiveness, and deterministic hardness #
This module formalizes the online bipartite matching model of Karp, Vazirani, and Vazirani
[KVV90]. A finite set L of offline vertices is known in advance; online
vertices arrive sequentially, each revealing its neighborhood N : Finset L upon arrival. An
online algorithm must irrevocably match the arriving vertex to an unmatched neighbor or leave it
unmatched, without seeing future arrivals.
Model and conventions #
- Arrival sequences (
arrivals : List (Finset L)): thej-th arriving online vertex (j : Fin arrivals.length) has offline neighborhoodarrivals[j], inducing the bipartite graphgraphOfArrivals arrivals : L × Fin arrivals.length → Bool, reusing the matching predicateCslib.Algorithms.Lean.MaxFlow.IsMatching. - Deterministic online algorithms (
DetAlg L): a rulechoose hist matched N : Option Ldepending only on the prefix of revealed neighborhoodshist, the already-matched offline verticesmatched, and the current neighborhoodN. Admissibility is enforced byonlineStep(an invalid choice leaves the arriving vertex unmatched), so everyA : DetAlg Lproduces a valid matching (DetAlg.isMatching_runMatching) whose prefix decisions are independent of future arrivals (DetAlg.runChoices_append). - Randomized online algorithms against an oblivious adversary (
RandAlg L): discrete (countably supported) probability distributionsPMF (DetAlg L)over deterministic online algorithms, evaluated by expected matching sizeRandAlg.expectedMatchingSizeon a fixed arrival sequence.
Main definitions #
Cslib.Algorithms.Online.BipartiteMatching.graphOfArrivals: bipartite graph indicator induced by an arrival sequence.Cslib.Algorithms.Online.BipartiteMatching.IsMaximalMatching: maximal matchings in a bipartite graph.Cslib.Algorithms.Online.BipartiteMatching.onlineStep,DetAlg,DetAlg.runChoices,DetAlg.matchedLeft,DetAlg.runMatching: deterministic online matching algorithms and their executions.Cslib.Algorithms.Online.BipartiteMatching.DetAlg.IsGreedy: greedy deterministic online matching algorithms.Cslib.Algorithms.Online.BipartiteMatching.RandAlg,RandAlg.expectedMatchingSize: randomized online matching algorithms against an oblivious adversary.
Main results #
Cslib.Algorithms.Online.BipartiteMatching.card_le_two_mul_of_isMaximalMatching: every maximal matching has cardinality at least half of every matching (|M'| ≤ 2 |M|).Cslib.Algorithms.Online.BipartiteMatching.DetAlg.isMaximalMatching_runMatching_of_isGreedyandDetAlg.card_le_two_mul_runMatching_of_isGreedy: every greedy deterministic online algorithm produces a maximal matching and achieves competitive ratio1/2.Cslib.Algorithms.Online.BipartiteMatching.exists_det_half_witness,exists_det_half_witness_mul, andnot_det_competitive_of_gt_half: no deterministic online matching algorithm beats ratio1/2(even with an arbitrary additive slack), witnessed on an adaptive2 + 2graph and itsk-fold disjoint union.Cslib.Algorithms.Online.BipartiteMatching.RandAlg.exists_expectedMatchingSize_le: the easy direction of Yao's minimax principle [Yao77] for expected matching size.
References #
Arrival sequences and maximal matchings #
Every maximal matching in a bipartite graph has size at least half of every matching.
Deterministic online matching algorithms #
Admissible online matching step: match the arriving vertex to u if choice = some u with
u ∈ N and u ∉ matched; otherwise leave it unmatched.
Update the set of matched offline vertices after an admissible step choice c.
A deterministic online bipartite matching algorithm on offline vertex set L. At each step,
given the list hist of previously revealed neighborhoods, the set matched of already-matched
offline vertices, and the newly arrived vertex's neighborhood N, choose hist matched N selects
an offline vertex to match (or none to leave the arriving vertex unmatched).
Choice rule for the newly arrived online vertex.
Execute A from history hist and already-matched offline set matched on the remaining
arrival sequence, returning the per-arrival match choices (some u or none).
The list of per-arrival match choices made by A on arrivals.
The set of offline vertices matched by A on arrivals.
Online causality: the choices of A on a₁ ++ a₂ extend its choices on a₁ without
depending on a₂.
Matched offline vertices grow monotonically with prefixes of the arrival sequence.
The i-th match choice of A on arrivals is the admissible online step from the state
after arrivals.take i.
Every deterministic online matching algorithm produces a valid matching on every arrival sequence.
The cardinality of A.runMatching arrivals equals the number of matched offline vertices.
The cardinality of A.runMatching arrivals equals the sum of match indicators over arrivals.
The cardinality of A.runMatching arrivals equals the number of online vertices matched.
A deterministic online matching algorithm is greedy if it matches every arriving vertex that has at least one unmatched neighbor.
Every greedy deterministic online matching algorithm produces a maximal matching.
Greedy 1/2-competitiveness: every greedy deterministic online matching algorithm
produces a matching of size at least half of every matching in the graph.
Deterministic 1/2 impossibility #
2k + 2k deterministic lower bound: for every k and every deterministic online algorithm
on Fin (2 * k), there is an arrival sequence admitting a perfect matching of size 2 * k on
which the algorithm matches at most k edges.
Tight 1/2 deterministic lower bound on a 2 + 2 graph [KVV90]:
for every deterministic online matching algorithm on Fin 2, there is a 2-arrival sequence
admitting a perfect matching of size 2 on which the algorithm matches at most 1 edge.
No deterministic online matching algorithm achieves competitive ratio strictly above 1/2,
even with an arbitrary additive slack b.
Randomized online matching algorithms and Yao's principle #
A randomized online matching algorithm against an oblivious adversary: a discrete (countably supported) probability distribution over deterministic online matching algorithms.
Expected matching size of μ : RandAlg L on a fixed arrival sequence arrivals.
Expected matching size of a randomized algorithm drawn by mapping a finite distribution ν.
Expected matching size of a uniformly sampled finite family of deterministic algorithms.
Yao's principle [Yao77] for expected matching size: if under an input distribution ν
over arrival sequences, every deterministic online algorithm has expected matching size at most
B, then every randomized online algorithm has some instance in the support of ν on which its
expected matching size is at most B.