Documentation

CslibFrontier.Computability.Complexity.Problems.TSP.Approximation

A 2-approximation for metric TSP #

The minimum-spanning-tree tour Cslib.Algorithms.Lean.TSP.mstTour, run on the distance matrix of a TSP instance, visits every city exactly once, and on metric matrices its length is at most twice the length of every tour, in particular an optimal one ([WS11], Section 2.4).

Model #

The cities, distances and tour lengths are those of Cslib.Complexity.TSP: the cities are the row indices 0, …, D.length - 1, distances are TSP.dist D, and TSP.tourLength D p is the length of the closed tour p. A matrix is metric (TSP.IsMetric) when the distances between cities are symmetric and satisfy the triangle inequality. The triangle inequality is required for all triples of cities, including those with i = k, so each diagonal entry is at most twice any distance from its city. Diagonal entries need not be zero ([WS11] assumes they are); the bound does not need that. Entries outside the city range are irrelevant.

Main definitions #

Main results #

Limitations #

No machine-level running time is certified for approxTour; that requires a polynomial-time certificate for Kruskal's algorithm on encoded matrices.

References #

A distance matrix is metric when the distances between its cities are symmetric and satisfy the triangle inequality. The triangle inequality covers all triples, including i = k, so each diagonal entry is at most twice any distance from its city; diagonal entries need not be zero.

Instances For

    The distances between the cities of D, indexed by Fin D.length.

    Instances For

      The MST tour of the cities of D: grow a tour from city 0 along Kruskal's minimum spanning tree of the complete graph on the cities.

      Instances For

        Tour lengths of city lists are closed-walk costs.

        Feasibility. The MST tour visits every city exactly once.

        theorem Cslib.Complexity.TSP.exists_map_val_eq_of_perm_range {n : ℕ} {p : List ℕ} (hp : p.Perm (List.range n)) :
        ∃ (q : List (Fin n)), List.map Fin.val q = p ∧ q.Nodup ∧ ∀ (x : Fin n), x ∈ q

        A tour given as a permutation of the cities 0, …, n - 1 lists every element of Fin n exactly once.

        The 2-approximation for metric TSP ([WS11], Section 2.4): on a metric matrix, the MST tour has length at most twice the length of any tour, in particular an optimal one.

        The 2-approximation against the decision problem: if a metric instance x belongs to TSP, the MST tour has length at most 2 * x.bound.