314. TSP

The Traveling Salesman Problem: visit 𝑛 cities exactly once and return to start, minimizing total distance.

Famous for being easy to state, hard to solve: NP-hard, no known polynomial-time exact algorithm. But also one of the most-studied problems in combinatorial optimization.

314.1. Formulation (DFJ — Dantzig-Fulkerson-Johnson, 1954)

Decision variable 𝑥𝑖𝑗{0,1}: 1 if the tour uses edge (𝑖,𝑗), else 0.

min𝑖,𝑗𝑐𝑖𝑗𝑥𝑖𝑗

s.t.:

𝑗𝑥𝑖𝑗=1,𝑖(leave each city once)𝑖𝑥𝑖𝑗=1,𝑗(enter each city once)𝑖𝑆,𝑗𝑆𝑥𝑖𝑗1,𝑆𝑉,2|𝑆|𝑛1(subtour elimination)𝑥𝑖𝑗{0,1}

The subtour-elimination constraints are exponential in number (2𝑛2 subsets). In practice, add them lazily as cutting planes when violated.

314.2. Alternative formulation (MTZ — Miller-Tucker-Zemlin)

Polynomially many constraints using node potentials 𝑢𝑖:

𝑢𝑖𝑢𝑗+𝑛𝑥𝑖𝑗𝑛1,𝑖,𝑗{2,,𝑛},𝑖𝑗

Forces a single tour without exponentially many cuts. LP relaxation is weaker than DFJ, so fewer cuts needed but worse bounds.

314.3. Computational reality

314.4. Lower bounds (for branch-and-bound)

314.5. Heuristics

314.6. Variants

314.7. See also