The traveling salesman problem is a problem in graph theory requiring the most efficient (i.e., least total distance) Hamiltonian
cycle a salesman can take through each of cities. The problem is NP-hard,
and no exact algorithm running in polynomial
time is known. The Held-Karp algorithm
solves finite instances exactly using dynamic
programming in
time, where
denotes big-O notation.
Heuristics trade the guarantee of a shortest tour for speed. The nearest neighbor algorithm
is a greedy algorithm that repeatedly visits
the closest unvisited city and finally returns to its starting city. It constructs
a tour in
distance comparisons, but can return a tour longer than the optimum. For symmetric
distances satisfying the triangle inequality,
its worst-case tour-length ratio grows logarithmically with
(Rosenkrantz et al. 1977). Trying different starting
cities can improve the result without certifying that it is optimal. Other heuristics,
such as the ant colony algorithm, search for
good tours rather than guaranteeing the shortest one.
The Wolfram Language command FindShortestTour[g]
attempts to find a shortest tour, which is a Hamiltonian
cycle (with initial vertex repeated at the end)
for a Hamiltonian graph if it returns a list with first element equal to the vertex
count of
.
The traveling salesman problem is mentioned by the character Larry Fleinhardt in the Season 2 episode "Rampage" (2006) of the television crime drama NUMB3RS.
In the Dantzig-Fulkerson-Johnson integer programming formulation, degree constraints enforce a spanning collection of cycles, while subtour
elimination constraints exclude disconnected collections. Vercesi and Buchanan (2026)
construct instances for which exponentially many of the latter constraints are necessary
merely to obtain the optimal tour cost, even with the integrality constraints retained.
For asymmetric instances on vertices, some families require
constraints, and symmetric metric instances require
, where
is the golden ratio. There
are also planar Euclidean, taxicab, and maximum-metric instances on
vertices requiring at least
constraints; in the last two metrics
may be any even integer at least 8, with coordinates and distances
integer and linear in
.
The lower bounds concern the smallest sufficient subset of these particular subtour constraints; they do not rule out more efficient alternative
inequalities or formulations. They also do not assert a general running-time lower
bound for TSP algorithms. For one of the symmetric -weighted families, the optimal tour cost is
and the full subtour linear relaxation has value
, so the integrality ratio tends to 1 despite the
exponentially many necessary constraints. The authors report developing and refining
the constructions with Claude; they wrote the statements and proofs themselves.
The asymmetric traveling salesman problem permits different costs in opposite directions. Hajiaghayi and Yun (2026) give a common constant-factor approximation guarantee for its tour and prescribed-endpoint path versions, measured against their respective subtour linear programming relaxations.