# The Traveling Salesman Problem

> Find the shortest route that visits every city once and returns home; it is easy to state and famously hard to solve.

**Field:** Software & systems · **Reliability:** Empirical

*Also known as: TSP; The shortest-tour problem*

## What it means

The traveling salesman problem asks, given a list of cities and the pairwise distances between them, for the shortest possible route that visits each city exactly once and returns to the starting city, a minimum-weight Hamiltonian cycle. Simple to state, it is one of the most intensively studied problems in combinatorial optimization and a canonical example of computational hardness: its decision form is NP-complete and its optimization form NP-hard, so no polynomial-time exact algorithm is known, and finding one would resolve P versus NP. Despite this worst-case difficulty, sophisticated methods and heuristics solve enormous real instances in practice.

## How it works

Brute force checks every ordering of the cities, taking time on the order of n factorial, hopelessly slow beyond small sizes. The Held-Karp dynamic-programming algorithm solves it exactly in time proportional to n squared times two to the n, better than n factorial but still exponential. Because the general problem cannot be approximated within any constant factor unless P equals NP, practical guarantees rely on structure: for metric instances, where distances satisfy the triangle inequality, the Christofides-Serdyukov algorithm guarantees a tour at most one and a half times the optimal, and a 2020 result nudged that ratio slightly below three-halves. In everyday use, heuristics like nearest-neighbour, 2-opt, and Lin-Kernighan produce near-optimal tours quickly.

## Examples

- **In the wild · Nov 2026:** On 25 November 2026 Masayuki Miyamoto of the University of Tsukuba posted a preprint claiming a quantum algorithm that finds the shortest tour in O*(1.70961^n) time, down from the O*(1.7274^n) bound Ambainis and colleagues set in 2018; it has not yet been peer reviewed. Even if it holds, every added city still multiplies the work by about 1.71, the exponential growth the problem is known for.
- **In the wild · Nov 2026:** In November 2026 a Biological Cybernetics paper by Kazuhiro Sakamoto and colleagues in Sendai gave each city its own oscillator, set them repelling each other by distance, and read the tour off the order the oscillators settled into; small and specially built instances, up to 50 cities, settled on the shortest tour. The hard part showed up exactly where the problem says it should: convergence got slower as cities were added, map-like 8 and 9 city layouts settled on very good tours rather than always the best one, and 50 cities with random distances did not settle on the shortest tour in the time simulated.
- **Christofides:** For metric instances the Christofides-Serdyukov algorithm of 1976 guarantees a tour no more than one and a half times the shortest, the classic approximation result.
- **Solving huge instances exactly:** The Concorde solver, using cutting planes and branch-and-bound, has found provably optimal tours through tens of thousands of cities, including an instance of 85,900 points.
- **Karp's reduction:** The traveling salesman problem was among the twenty-one problems Richard Karp proved NP-complete in 1972 by reduction from Boolean satisfiability.

## Why it matters

The traveling salesman problem is the archetypal NP-hard optimization problem and a central benchmark for the entire field of combinatorial optimization, spurring the development of cutting-plane methods, branch-and-bound, approximation algorithms, and metaheuristics. Its applications are everywhere routes and orderings matter, from logistics and vehicle routing to drilling circuit boards, sequencing DNA, and scheduling telescope observations.

## Where it breaks down

NP-hardness is a worst-case statement, so it does not mean every instance is hard, and large instances are routinely solved, exactly with methods like the Concorde solver and approximately with heuristics on millions of nodes. The strong approximation results apply only to structured cases: the general problem cannot be approximated within any constant factor unless P equals NP, and Christofides's guarantee requires the triangle inequality. Exact algorithms remain exponential in the worst case, so scaling depends on instance structure rather than a universal fast method, and the P-versus-NP question the problem embodies is still open.

## Common misreadings

NP-hard does not mean unsolvable; it means no polynomial-time exact algorithm is known, while instances are still solved, just at exponential worst-case cost. Large instances are solved in practice, both exactly and approximately, so the problem is not hopeless. The one-and-a-half approximation applies only to metric instances with the triangle inequality, not to the general problem, which resists any constant-factor approximation unless P equals NP. And the earliest documented use of the phrase traveling salesman problem is a 1949 report, though the problem was studied earlier by Menger and others.

## Origin

Brought to mathematicians by Karl Menger around 1930 as the messenger problem, formulated as an integer program with the cutting-plane method by Dantzig, Fulkerson, and Johnson in 1954, and proved NP-complete via Karp's 1972 reductions.

## Related

- [The P versus NP Problem](https://conyso.com/lawtome/laws/the-p-versus-np-problem/) — kindred
- [The Cook-Levin Theorem](https://conyso.com/lawtome/laws/the-cook-levin-theorem/) — cause

## Sources

- [Travelling salesman problem, Wikipedia. — the definition, NP-hardness, Held-Karp, and the heuristics and exact solvers.](<https://en.wikipedia.org/wiki/Travelling_salesman_problem>)
- [Christofides algorithm, Wikipedia. — the one-and-a-half approximation for metric TSP.](<https://en.wikipedia.org/wiki/Christofides_algorithm>)

---
Source: https://conyso.com/lawtome/laws/the-traveling-salesman-problem/ · The Law Tome — a sourced index of named laws.
