Memra

TSP, set cover & the general techniques

◈ 7 cards

Metric-TSP 2-approximation via MST + preorder shortcut, the inapproximability of general TSP, greedy set cover’s H(n) ratio, and LP rounding.

Metric TSP: a 2-approximation from an MST

In the traveling-salesperson problem (TSP) you are given a complete undirected graph with edge costs , and you want a minimum-cost Hamiltonian cycle (a tour visiting every vertex once). General TSP is NP-hard. But when the costs satisfy the triangle inequality — true for any distances in a metric space, e.g. points on a plane — there is a clean 2-approximation:

APPROX-TSP-TOUR(G, c)
  pick a root r
  T = MST-PRIM(G, c, r)          // minimum spanning tree
  H = preorder walk of T from r   // vertices in first-visit order
  return the cycle H

Why it is a 2-approximation. Three inequalities chain together. Let be an optimal tour and the MST.

  1. — deleting any one edge from the optimal tour leaves a spanning tree, so the minimum spanning tree is no costlier than the tour. The MST is the lower bound.
  2. A full walk of (down and back up every branch) traverses each tree edge exactly twice: .
  3. The preorder walk is with repeated vertices skipped. Each skip replaces a path by the direct edge ; by the triangle inequality this never increases cost: .

Chaining: .

Worked example. Five points: , , , , with Euclidean distance. Prim from builds an MST of cost . Its preorder walk is , a tour of cost . The guarantee holds comfortably (and since ).

General TSP has no constant-ratio approximation

Drop the triangle inequality and the picture collapses. Theorem 35.3: if , then for no constant does a polynomial-time -approximation for general TSP exist.

Sketch (gap amplification). Reduce HAM-CYCLE: given , build a complete graph with if , else . If has a Hamiltonian cycle, the optimal tour costs ; if not, every tour uses a heavy edge and costs . A -approximation would distinguish the two cases, solving HAM-CYCLE in polynomial time — so . The trick is to manufacture a gap of factor that any -approximation must respect.

Greedy set cover: an -approximation

Set cover: given a universe of elements and a family of subsets whose union is , find the smallest subfamily covering . GREEDY-SET-COVER repeatedly takes the set covering the most still-uncovered elements.

Theorem 35.4: greedy is an -approximation (where ). Why: if the optimum uses sets, then at any moment sets cover all uncovered elements, so by averaging some set covers . Greedy takes at least that many, so . This drops below once , giving . The ratio is logarithmic, not a constant — and that is essentially unavoidable for set cover.

LP rounding: weighted vertex cover, 2-approximation

For weighted vertex cover the matching trick breaks (a heavy vertex may anchor a light edge). Instead, write the integer program — minimize subject to per edge, — then relax to a linear program (solvable in polynomial time). Solve the LP for fractional , then round: put in the cover iff .

This is a 2-approximation (Theorem 35.6). Feasibility: each edge has , so at least one endpoint has and is taken. Cost: for every chosen , , so — the LP optimum is a lower bound on the integer optimum. Rounding up to is exactly where the factor 2 comes from.

And when would not even help: the FPTAS for subset sum

Subset sum (NP-complete) admits an FPTAS: keep a list of achievable subset sums, but trim values within a factor of each other, with . Trimming keeps the list polynomial, , while the compounded error stays . So you get a -approximation in time polynomial in and — the best you can hope for short of solving it exactly.

33.613.6134bcearoot rdMST cost 13.21; closing b-a gives the tour 17.21 ≤ 2 × 13.21.
The MST is the lower bound; the preorder walk shortcuts it into a tour at most twice optimal.
techniqueproblemlower boundratiomaximal matchingvertex cover|A| picked edges2MST + shortcutmetric TSPc(T) ≤ c(H*)2greedyset coveraveraging |Ui|/kH(n) = Θ(lg n)LP roundingweighted VCLP optimum z_LP2trim + scalesubset sumexact sum list1+ε (FPTAS)gap reductiongeneral TSP— none survivesno constant ρEvery ratio proof bounds the answer against a computable lower bound on OPT.
Different lower bounds, one proof skeleton — and general TSP, where none exists.
NORMAL ~/memra/learn/comp-372/tsp-set-cover-and-rounding utf-8 LF