Combinatorial 3/2-ratio step and exhaustive-matching Christofides prototype for metric TSP #
This module formalizes the combinatorial 3/2-approximation ratio step after Christofides'
construction ([Chr76]; [WS11], Section 2.4, Theorem 2.13), together
with an exponential-time prototype (christofidesExhaustive) that substitutes exhaustive search
over all (2k - 1)!! perfect matchings (minPerfectMatching) for Edmonds' polynomial-time
weighted matching algorithm. It does not formalize Christofides' polynomial-time algorithm
([Chr76]; [WS11], Theorem 2.13): formalizing Edmonds' weighted blossom
algorithm ([Edm65]) and certifying polynomial running time remain open in #2869 and
#3337.
Given a minimum spanning tree T and a minimum-weight perfect matching M on the odd-degree
vertices of T, the construction builds a tour as follows:
- compute a minimum spanning tree
Tof the complete graph (Kruskal's algorithm,kruskalEdges); - supply a minimum-weight perfect matching
MonoddVertices T(instantiated in the prototypechristofidesExhaustiveby super-exponential exhaustive searchminPerfectMatching); - compute an Euler circuit of the multigraph
T ⊎ M(Hierholzer's algorithm,eulerCircuit); - shortcut it to a tour visiting every vertex once (
List.dedup).
The resulting tour costs at most c(T) + c(M) ≤ OPT + OPT / 2.
Model #
Vertices are Fin n and δ : Fin n → Fin n → ℕ is an arbitrary cost function; the cost of a tour
is cycleCost δ, as for the minimum-spanning-tree 2-approximation mstTour. The approximation
bound assumes that δ is symmetric and satisfies the triangle inequality for all triples; diagonal
entries need not be zero. The multigraph T ⊎ M is the edge list
T.map WeightedEdge.endpoints ++ M, so an edge of T that M repeats appears twice.
Source mapping #
Combinatorial steps after [WS11], Section 2.4 (not the polynomial-time algorithm
of Theorem 2.13; see #2869 and #3337):
- the handshake argument before Theorem 2.13 (
Ohas even cardinality) iseven_length_oddVertices, fromCslib.Algorithms.Lean.Euler.even_length_filter_odd_degree; - "it is connected (since the spanning tree is connected) and has even degree" is
shortcutTour_perm(viaCslib.Algorithms.Lean.Euler.isEulerCircuit_eulerCircuit); - shortcutting (proof of Theorem 2.12) is
cycleCost_shortcutTour_le; - Lemma 2.10 (the tree costs at most
OPT) istotalWeight_kruskalEdges_le_cycleCost; - the matching costs at most
OPT / 2(proof of Theorem 2.13) istwo_mul_sum_le_cycleCost; - the combinatorial ratio step after Theorem 2.13 is
two_mul_cycleCost_shortcutTour_le_three_mulfor any supplied minimum spanning tree and minimum-weight perfect matching;two_mul_cycleCost_christofidesExhaustive_le_three_mulinstantiates it with(2k - 1)!!exhaustive matching (minPerfectMatching) and is a prototype step rather than the cited polynomial-time theorem.
The textbook shortcut keeps the first visit to each city; List.dedup keeps the last. Both are
subsequences of the Euler circuit, which is all the bound uses.
Limitations #
The concrete tour christofidesExhaustive replaces Edmonds' polynomial-time weighted matching
algorithm ([Edm65]) with exhaustive search (minPerfectMatching), which examines
(2k - 1)!! matchings on 2k odd-degree vertices (super-exponential in n, e.g. on even-order
star metrics where all n = 2k vertices have odd degree in the MST). Neither Edmonds' weighted
blossom algorithm nor a machine-level polynomial-time certificate is formalized; both remain open
in #2869 and #3337.
Main definitions #
Cslib.Algorithms.Lean.TSP.oddVertices: the odd-degree vertices of an edge list.Cslib.Algorithms.Lean.TSP.shortcutTour: the shortcut Euler circuit of a tree and a matching.Cslib.Algorithms.Lean.TSP.christofidesExhaustive: exhaustive-matching prototype tour (not the polynomial-time Christofides algorithm; see#2869and#3337).
Main results #
even_length_oddVertices: an edge list has an even number of odd-degree vertices.shortcutTour_perm: given a spanning edge list and a perfect matching on its odd-degree vertices,shortcutTourvisits every vertex exactly once.cycleCost_shortcutTour_le: the shortcut tour costs at most the tree plus the matching.numComponents_edgePartition_completeEdges: the complete graph is connected.two_mul_cycleCost_shortcutTour_le_three_mul: combinatorial3/2-ratio step (after [Chr76]; [WS11], Theorem 2.13) for any supplied minimum spanning tree and minimum-weight perfect matching on its odd-degree vertices.christofidesExhaustive_perm,two_mul_cycleCost_christofidesExhaustive_le_three_mul: feasibility and combinatorial3/2-ratio bound for the(2k - 1)!!exhaustive-matching prototype (not the cited polynomial-time algorithm;#2869,#3337).
References #
Odd-degree vertices #
The vertices of odd degree in the multigraph of the edges of T, in increasing order.
The handshake lemma for T: it has an even number of odd-degree vertices.
The shortcut tour and exhaustive-matching prototype #
The shortcut Euler tour of T and M: Hierholzer's Euler circuit of the multigraph with
the edges of T and of M, from vertex 0, keeping only the last visit to each vertex
(List.dedup).
Exhaustive-matching prototype after Christofides' construction ([Chr76];
[WS11], Section 2.4): not the cited polynomial-time algorithm. It computes
Kruskal's minimum spanning tree T of the complete graph weighted by δ, finds a minimum-weight
perfect matching M on oddVertices T via super-exponential (2k - 1)!! exhaustive search
(minPerfectMatching), and shortcuts an Euler circuit of T together with M. Replacing
exhaustive search with Edmonds' polynomial-time weighted matching ([Edm65]) and certifying
polynomial running time remain open in #2869 and #3337.
Feasibility and cost of the shortcut tour #
Feasibility. If the edges of T connect all vertices and M is a perfect matching on the
odd-degree vertices of T, the shortcut Euler tour visits every vertex exactly once.
Combinatorial shortcutting bound (a step after [WS11], proof of Theorem 2.13):
for symmetric δ with the triangle inequality and at least two vertices, if the edges of T
connect all vertices and are weighted by δ, and M is a perfect matching on the odd-degree
vertices of T, the shortcut Euler tour costs at most T and M together.
Combinatorial 3/2-ratio step and exhaustive-matching bound #
Intermediate feasibility step for the (2k - 1)!! exhaustive-matching prototype
christofidesExhaustive (not the polynomial-time algorithm of [Chr76];
[WS11], Theorem 2.13; see #2869 and #3337): the prototype tour visits every
vertex exactly once.
Combinatorial 3/2-ratio step (after [Chr76]; [WS11],
Theorem 2.13) for any supplied minimum spanning tree T and any supplied minimum-weight perfect
matching M on oddVertices T; this is not the cited polynomial-time algorithm (Edmonds'
polynomial-time weighted matching [Edm65] and machine-level polynomial-time certification
remain open in #2869 and #3337). For symmetric δ with the triangle inequality, the shortcut
Euler tour of T and M costs at most 3/2 times any closed walk visiting every vertex exactly
once, in particular an optimal tour.
Prototype combinatorial 3/2-ratio step instantiating
two_mul_cycleCost_shortcutTour_le_three_mul with (2k - 1)!! exhaustive matching
(minPerfectMatching); this is not the polynomial-time algorithm of [Chr76] /
[WS11], Theorem 2.13 (Edmonds' polynomial-time weighted matching [Edm65]
and a polynomial-time certificate remain open in #2869 and #3337). For symmetric δ with the
triangle inequality, christofidesExhaustive δ costs at most 3/2 times any closed walk visiting
every vertex exactly once, in particular an optimal tour.