Linear-Time Approximation for Maximum Weight Matching: The Approximation Guarantee of the Scaling AlgorithmResearch Paper
Motivation
The maximum weight matching (MWM) problem asks, for a graph with edge weights, for a set of vertex-disjoint edges of largest total weight. It is a central problem of combinatorial optimization, with applications to transportation, assignment and scheduling, and as a subroutine for shortest paths, planar max cut, Chinese postman tours and metric TSP. Edmonds' blossom algorithm (1965) solves it on general graphs; the fastest implementation, due to Gabow, runs in time, and the scaling algorithm of Gabow and Tarjan (1991) runs in time on graphs with vertices, edges and integer weights of magnitude at most . Applications such as switch scheduling, graph clustering and sparse linear solvers accept a slightly suboptimal matching in exchange for speed. This motivates -approximate maximum weight matchings: matchings whose weight is at least a fraction of the optimum.
Timeline of linear and near-linear time approximation for general graphs (Section 1.3 and Table IV of the paper; the entries below are as the paper attributes them):
- Folklore: the greedy algorithm, which repeatedly takes the heaviest remaining edge, gives a -MWM in time.
- Preis (STACS 1999): a -MWM in linear time; Drake and Hougardy (2003) gave a simpler one.
- Drake and Hougardy (2003; journal version Vinkemeier and Hougardy, ACM Trans. Algorithms 2005): a -MWM in time; Pettie and Sanders (2004) improved this to .
- Duan and Pettie (FOCS 2010) and Hanke and Hougardy (2010): a -MWM in time.
- Duan and Pettie (2014): a -MWM in time, which is linear for every fixed .
Setting
Let be a finite simple graph with integer weights , . A matching is a set of vertex-disjoint edges, with weight ; a vertex is free if no edge of touches it. is a -MWM if for every matching .
A blossom is built recursively: a single vertex is a trivial blossom with ; an odd number of disjoint blossoms joined in a cycle by edges form the blossom with edge set . It is full if . The algorithm keeps a laminar set of full blossoms; a root blossom is a maximal one, and contracts each root blossom to a single vertex.
Dual values and on odd vertex sets give each edge the value
The scaling algorithm (Figure 2 of the paper) has parameters and . It runs scales with granularity and truncated weights . Each scale repeats four steps: augment along a maximal set of vertex-disjoint augmenting paths of the eligible graph , shrink a maximal set of new blossoms, adjust the duals by , and dissolve root blossoms whose -value has reached zero. It stops when the free vertices' -values reach a scale-dependent value, which is at scale . Eligibility is given by Definition 3.2; the linear-time variant keeps the algorithm unchanged and uses Definition 3.10, which additionally ignores an edge in scales unless it is a blossom edge.
Formalization targets
Goal: Theorem 3.12, approximation half
For every with , the algorithm of Figure 2 with Definition 3.10 eligibility has a terminating run, and every terminating run returns a matching with
Milestones, in attack order
- Lemma 2.3: approximate complementary slackness ( everywhere, on matched and blossom edges, zero free duals) gives a -MWM.
- Section 2 rescaling: rounding real weights to , , loses at most a factor .
- Lemma 3.5: with Definition 3.2 the algorithm preserves Property 3.1, which consists of granularity, active blossoms, near domination , near tightness for type- edges, and equal free duals.
- Lemma 3.6: eligible edges searched up to scale weigh at least , and matched edges satisfy .
- Lemma 3.7: the output under Definition 3.2 is a -MWM.
- Theorem 3.8: the approximation half of Theorem 3.8, with .
- Lemma 3.11: the invariants under Definition 3.10, including and once .
Significance
The result. Theorem 3.12 gives the first algorithm for -approximate maximum weight matching on general graphs that runs in linear time for every fixed ; earlier linear-time algorithms achieved only or . Its analysis is a relaxation of Edmonds' complementary slackness conditions that grows weaker over the scales, but not uniformly, and Lemma 2.3 certifies an approximate matching by approximately feasible duals.
Formalizing it. The result is proved in the paper. Mathlib (at the pinned revision) has matchings, alternating walks and Tutte's theorem, but no blossoms, contracted graphs or weighted matching algorithms. A complete development gives a Lean model of blossoms, contraction and augmenting paths through blossoms, a verified primal–dual invariant for a scaling algorithm, and a checked approximate-slackness certificate for matchings. Each of these can be reused to formalize Edmonds' exact algorithm or the Gabow–Tarjan scaling algorithm.
Difficulty
The two halves of the argument pull against each other. Lemma 2.3 needs near domination and near tightness as multiplicative bounds. The algorithm maintains only additive bounds whose slack for an edge of type is , and this slack does not shrink as the scales advance. Converting it into a factor requires a lower bound on the weight of every edge that ever became eligible, which in turn depends on the free vertices' duals following an exact schedule across scales.
For Definition 3.10 the obvious argument breaks down: an edge that is ignored after scale may violate near domination and near tightness by an amount that grows with every later dual adjustment. The claim is that the accumulated violation stays within an fraction of , and establishing this requires tracking every adjustment that can reach an ignored edge.
On the combinatorial side, the Augmentation and Blossom Shrinking steps work in the contracted graph . Their correctness uses the classical facts that augmenting paths lift through full blossoms and that blossoms stay full after augmentation (Lemma 2.1), which have to be formalized from scratch.
Formalization scope
Graphs are SimpleGraph V on a Fintype V with decidable equality; edges are Sym2 V; matchings are Finset (Sym2 V) with pairwise vertex-disjoint edges of ; weights are with on edges. Duals, and are real numbers. is a function on all finite vertex sets and sums it over the odd sets that contain the edge, as on the page. and , , are given through their exponents. uses the convention . The paper's standing assumption is used only for running time and is omitted.
The algorithm is a nondeterministic relation. A state holds , with its blossom edge sets, , , a ghost record of the scale in which each edge last entered , and the common free-vertex dual that drives the loop test. The maximal sets of augmenting paths and of new blossoms and the lifts of paths through blossoms are choices. Invariants are stated for states reachable by a run, and the goal asserts both that a terminating run exists and that every terminating run returns a -MWM.
The running times of Theorem 3.8 and of Theorem 3.12 are not formalized: the paper fixes no cost model, and its bounds rely on a modified depth-first search and on word-RAM table lookups. The explicit constants (Theorem 3.8) and (Theorem 3.12) are the ones the proofs supply.
The following trivializing formalizations are ruled out: a "matching" that may contain non-edges or repeated edges; a goal about a state only assumed to satisfy Property 3.1 rather than reached by the algorithm; a run relation with no terminating run, which the existence conjunct excludes; eligibility or blossoms chosen freely instead of by the page's rules; and comparison only against matchings of the contracted graph instead of all matchings of .
Welcome contributions include a Lean treatment of blossoms and their contraction (Lemma 2.1, which is not a milestone here), the lift of augmenting paths, Lemmas 3.3 and 3.4 as auxiliary results, and proofs of the milestones in the order listed.
Selected references
- R. Duan and S. Pettie, Linear-Time Approximation for Maximum Weight Matching, Journal of the ACM 61(1), Article 1, 2014. https://doi.org/10.1145/2529989
- J. Edmonds, Maximum matching and a polyhedron with 0,1-vertices, Journal of Research of the National Bureau of Standards 69B, 125–130, 1965. https://doi.org/10.6028/jres.069B.013
- H. N. Gabow and R. E. Tarjan, Faster scaling algorithms for general graph-matching problems, Journal of the ACM 38(4), 815–853, 1991. https://doi.org/10.1145/115234.115366
- R. Preis, Linear time 1/2-approximation algorithm for maximum weighted matching in general graphs, STACS 1999, LNCS 1563, 259–269 (cited from the bibliography of Duan and Pettie 2014).
- D. E. D. Vinkemeier and S. Hougardy, A linear-time approximation algorithm for weighted matchings in graphs, ACM Transactions on Algorithms 1(1), 107–122, 2005 (cited from the bibliography of Duan and Pettie 2014).
- S. Pettie and P. Sanders, A simpler linear time 2/3 − ϵ approximation to maximum weight matching, Information Processing Letters 91(6), 271–276, 2004 (cited from the bibliography of Duan and Pettie 2014).