Travelling salesman problem explained

The travelling salesman problem, also known as the travelling salesperson problem (TSP), asks the following question: "Given a list of cities and the distances between each pair of cities, what is the shortest possible route that visits each city exactly once and returns to the origin city?" It is an NP-hard problem in combinatorial optimization, important in theoretical computer science and operations research.

The travelling purchaser problem, the vehicle routing problem and the ring star problem[1] are three generalizations of TSP.

In the theory of computational complexity, the decision version of the TSP (where given a length L, the task is to decide whether the graph has a tour whose length is at most L) belongs to the class of NP-complete problems. Thus, it is possible that the worst-case running time for any algorithm for the TSP increases superpolynomially (but no more than exponentially) with the number of cities.

The problem was first formulated in 1930 and is one of the most intensively studied problems in optimization. It is used as a benchmark for many optimization methods. Even though the problem is computationally difficult, many heuristics and exact algorithms are known, so that some instances with tens of thousands of cities can be solved completely, and even problems with millions of cities can be approximated within a small fraction of 1%.[2]

The TSP has several applications even in its purest formulation, such as planning, logistics, and the manufacture of microchips. Slightly modified, it appears as a sub-problem in many areas, such as DNA sequencing. In these applications, the concept city represents, for example, customers, soldering points, or DNA fragments, and the concept distance represents travelling times or cost, or a similarity measure between DNA fragments. The TSP also appears in astronomy, as astronomers observing many sources want to minimize the time spent moving the telescope between the sources; in such problems, the TSP can be embedded inside an optimal control problem. In many applications, additional constraints such as limited resources or time windows may be imposed.

History

The origins of the travelling salesperson problem are unclear. A handbook for travelling salesmen from 1832 mentions the problem and includes example tours through Germany and Switzerland, but contains no mathematical treatment.[3]

The TSP was mathematically formulated in the 19th century by the Irish mathematician William Rowan Hamilton and by the British mathematician Thomas Kirkman. Hamilton's icosian game was a recreational puzzle based on finding a Hamiltonian cycle.[4] The general form of the TSP appears to have been first studied by mathematicians during the 1930s in Vienna and at Harvard, notably by Karl Menger, who defines the problem, considers the obvious brute-force algorithm, and observes the non-optimality of the nearest neighbour heuristic:

It was first considered mathematically in the 1930s by Merrill M. Flood who was looking to solve a school bus routing problem.[5] Hassler Whitney at Princeton University generated interest in the problem, which he called the "48 states problem". The earliest publication using the phrase "travelling [or traveling] salesman problem" was the 1949 RAND Corporation report by Julia Robinson, "On the Hamiltonian game (a traveling salesman problem)."[6] [7]

In the 1950s and 1960s, the problem became increasingly popular in scientific circles in Europe and the United States after the RAND Corporation in Santa Monica offered prizes for steps in solving the problem.[5] Notable contributions were made by George Dantzig, Delbert Ray Fulkerson, and Selmer M. Johnson from the RAND Corporation, who expressed the problem as an integer linear program and developed the cutting plane method for its solution. They wrote what is considered the seminal paper on the subject in which, with these new methods, they solved an instance with 49 cities to optimality by constructing a tour and proving that no other tour could be shorter. Dantzig, Fulkerson, and Johnson, however, speculated that, given a near-optimal solution, one may be able to find optimality or prove optimality by adding a small number of extra inequalities (cuts). They used this idea to solve their initial 49-city problem using a string model. They found they only needed 26 cuts to come to a solution for their 49 city problem. While this paper did not give an algorithmic approach to TSP problems, the ideas that lay within it were indispensable to later creating exact solution methods for the TSP, though it would take 15 years to find an algorithmic approach in creating these cuts.[5] As well as cutting plane methods, Dantzig, Fulkerson, and Johnson used branch-and-bound algorithms perhaps for the first time.[5]

In 1959, Jillian Beardwood, J.H. Halton, and John Hammersley published an article entitled "The Shortest Path Through Many Points" in the journal of the Cambridge Philosophical Society. The Beardwood–Halton–Hammersley theorem provides a practical solution to the travelling salesman problem. The authors derived an asymptotic formula to determine the length of the shortest route for a salesman who starts at a home or office and visits a fixed number of locations before returning to the start.

In the following decades, the problem was studied by many researchers from mathematics, computer science, chemistry, physics, and other sciences. In the 1960s, however, a new approach was created that, instead of seeking optimal solutions, would produce a solution whose length is provably bounded by a multiple of the optimal length, and in doing so would create lower bounds for the problem; these lower bounds would then be used with branch-and-bound approaches. One method of doing this was to create a minimum spanning tree of the graph and then double all its edges, which produces the bound that the length of an optimal tour is at most twice the weight of a minimum spanning tree.

In 1976, Christofides and Serdyukov (independently of each other) made a big advance in this direction:[8] the Christofides-Serdyukov algorithm yields a solution that, in the worst case, is at most 1.5 times longer than the optimal solution. As the algorithm was simple and quick, many hoped it would give way to a near-optimal solution method. However, this hope for improvement did not immediately materialize, and Christofides-Serdyukov remained the method with the best worst-case scenario until 2011, when a (very) slightly improved approximation algorithm was developed for the subset of "graphical" TSPs.[9] In 2020 this tiny improvement was extended to the full (metric) TSP.[10]

Richard M. Karp showed in 1972 that the Hamiltonian cycle problem was NP-complete, which implies the NP-hardness of TSP. This supplied a mathematical explanation for the apparent computational difficulty of finding optimal tours.

Great progress was made in the late 1970s and 1980, when Grötschel, Padberg, Rinaldi and others managed to exactly solve instances with up to 2,392 cities, using cutting planes and branch-and-bound.

In the 1990s, Applegate, Bixby, Chvátal, and Cook developed the program Concorde that has been used in many recent record solutions. Gerhard Reinelt published the TSPLIB in 1991, a collection of benchmark instances of varying difficulty, which has been used by many research groups for comparing results. In 2006, Cook and others computed an optimal tour through an 85,900-city instance given by a microchip layout problem, currently the largest solved TSPLIB instance. For many other instances with millions of cities, solutions can be found that are guaranteed to be within 2–3% of an optimal tour.[11]

Description

As a graph problem

TSP can be modeled as an undirected weighted graph, such that cities are the graph's vertices, paths are the graph's edges, and a path's distance is the edge's weight. It is a minimization problem starting and finishing at a specified vertex after having visited each other vertex exactly once. Often, the model is a complete graph (i.e., each pair of vertices is connected by an edge). If no path exists between two cities, then adding a sufficiently long edge will complete the graph without affecting the optimal tour.

Asymmetric and symmetric

In the symmetric TSP, the distance between two cities is the same in each opposite direction, forming an undirected graph. This symmetry halves the number of possible solutions. In the asymmetric TSP, paths may not exist in both directions or the distances might be different, forming a directed graph. Traffic congestion, one-way streets, and airfares for cities with different departure and arrival fees are real-world considerations that could yield a TSP problem in asymmetric form.

Related problems

Integer linear programming formulations

The TSP can be formulated as an integer linear program.[13] [14] [15] Several formulations are known. Two notable formulations are the Miller–Tucker–Zemlin (MTZ) formulation and the Dantzig–Fulkerson–Johnson (DFJ) formulation. The DFJ formulation is stronger, though the MTZ formulation is still useful in certain settings.[16] [17]

Common to both these formulations is that one labels the cities with the numbers

1,\ldots,n

and takes

cij>0

to be the cost (distance) from city

i

to city

j

. The main variables in the formulations are:

xij=\begin{cases}1&thepathgoesfromcityitocityj\ 0&otherwise.\end{cases}

It is because these are 0/1 variables that the formulations become integer programs; all other constraints are purely linear. In particular, the objective in the program is to minimize the tour length

n
\sum
i=1
n
\sum
j\nei,j=1

cijxij.

Without further constraints, the

\{xij\}i,j

will effectively range over all subsets of the set of edges, which is very far from the sets of edges in a tour, and allows for a trivial minimum where all

xij=0

. Therefore, both formulations also have the constraints that, at each vertex, there is exactly one incoming edge and one outgoing edge, which may be expressed as the

2n

linear equations
n
\sum
i=1,i\nej

xij=1

for

j=1,\ldots,n

and
n
\sum
j=1,j\nei

xij=1

for

i=1,\ldots,n.

These ensure that the chosen set of edges locally looks like that of a tour, but still allow for solutions violating the global requirement that there is one tour which visits all vertices, as the edges chosen could make up several tours, each visiting only a subset of the vertices; arguably, it is this global requirement that makes TSP a hard problem. The MTZ and DFJ formulations differ in how they express this final requirement as linear constraints.

Miller–Tucker–Zemlin formulation

In addition to the

xij

variables as above, there is for each

i=1,\ldots,n

a dummy variable

ui

that keeps track of the order in which the cities are visited, counting from city the interpretation is that

ui<uj

implies city

i

is visited before city

j.

For a given tour (as encoded into values of the

xij

variables), one may find satisfying values for the

ui

variables by making

ui

equal to the number of edges along that tour, when going from city

1

to city

i.

[18]

Because linear programming favors non-strict inequalities (

\ge

) over strict we would like to impose constraints to the effect that

uj\geui+1

if

xij=1.

Merely requiring

uj\gequi+xij

would not achieve that, because this also requires

uj\gequi

when

xij=0,

which is not correct. Instead MTZ use the

n(n-1)

linear constraints

ui-uj+1\le(n-1)(1-xij)

for all distinct

i,j\in\{2,...c,n\},

where the constant term

n-1

provides sufficient slack that

xij=0

does not impose a relation between

uj

and

ui.

The way that the

ui

variables then enforce that a single tour visits all cities is that they increase by at least

1

for each step along a tour, with a decrease only allowed where the tour passes through city 

1.

That constraint would be violated by every tour which does not pass through city 

1,

so the only way to satisfy it is that the tour passing city 

1

also passes through all other cities.

The MTZ formulation of TSP is thus the following integer linear programming problem:

\begin{align} min

n
\sum
i=1
nc
\sum
ij

xij&\colon&&\\ xij\in{}&\{0,1\}&&i,j=1,\ldots,n;\\

n
\sum
i=1,i\nej

xij={}&1&&j=1,\ldots,n;\\

n
\sum
j=1,j\nei

xij={}&1&&i=1,\ldots,n;\\ ui-uj+1\le{}&(n-1)(1-xij)&&2\lei\nej\len;\\ 2\leui\le{}&n&&2\lei\len. \end{align}

The first set of equalities requires that each city is arrived at from exactly one other city, and the second set of equalities requires that from each city there is a departure to exactly one other city. The last constraint enforces that there is only a single tour covering all cities, and not two or more disjointed tours that only collectively cover all cities.

Dantzig–Fulkerson–Johnson formulation

Label the cities with the numbers 1, ..., n and define:

xij=\begin{cases}1&thepathgoesfromcityitocityj\ 0&otherwise.\end{cases}

Take

cij>0

to be the distance from city i to city j. Then TSP can be written as the following integer linear programming problem:

\begin{align} min

n
&\sum
i=1
nc
\sum
ij

xij\colon&&\\ &

n
\sum
i=1,i\nej

xij=1&&j=1,\ldots,n;\\ &

n
\sum
j=1,j\nei

xij=1&&i=1,\ldots,n;\\ &\sumi{\sumj{xij

}} \leq |Q|-1 && \forall Q \subsetneq \, |Q| \geq 2. \\\end

The last constraint of the DFJ formulation—called a subtour elimination constraint—ensures that no proper subset Q can form a sub-tour, so the solution returned is a single tour and not the union of smaller tours. Because this leads to an exponential number of possible constraints, in practice it is solved with row generation.[19]

Computing a solution

The traditional lines of attack for the NP-hard problems are the following:

Exact algorithms

The most direct solution would be to try all permutations (ordered combinations) and see which one is cheapest (using brute-force search). The running time for this approach lies within a polynomial factor of

O(n!)

, the factorial of the number of cities, so this solution becomes impractical even for only 20 cities.

One of the earliest applications of dynamic programming is the Held - Karp algorithm, which solves the problem in time

O(n22n)

.[20] This bound has also been reached by Exclusion-Inclusion in an attempt preceding the dynamic programming approach.

Improving these time bounds seems to be difficult. For example, it has not been determined whether a classical exact algorithm for TSP that runs in time

O(1.9999n)

exists. The currently best quantum exact algorithm for TSP due to Ambainis et al. runs in time

O(1.728n)

.[21]

Other approaches include:

An exact solution for 15,112 German towns from TSPLIB was found in 2001 using the cutting-plane method proposed by George Dantzig, Ray Fulkerson, and Selmer M. Johnson in 1954, based on linear programming. The computations were performed on a network of 110 processors located at Rice University and Princeton University. The total computation time was equivalent to 22.6 years on a single 500 MHz Alpha processor. In May 2004, the travelling salesman problem of visiting all 24,978 towns in Sweden was solved: a tour of length approximately 72,500 kilometres was found, and it was proven that no shorter tour exists.[23] In March 2005, the travelling salesman problem of visiting all 33,810 points in a circuit board was solved using Concorde TSP Solver: a tour of length 66,048,945 units was found, and it was proven that no shorter tour exists. The computation took approximately 15.7 CPU-years (Cook et al. 2006). In April 2006 an instance with 85,900 points was solved using Concorde TSP Solver, taking over 136 CPU-years; see .

Heuristic and approximation algorithms

Various heuristics and approximation algorithms, which quickly yield good solutions, have been devised. These include the multi-fragment algorithm. Modern methods can find solutions for extremely large problems (millions of cities) within a reasonable time which are, with a high probability, just 2–3% away from the optimal solution.[11]

Several categories of heuristics are recognized.

Constructive heuristics

The nearest neighbour (NN) algorithm (a greedy algorithm) lets the salesman choose the nearest unvisited city as his next move. This algorithm quickly yields an effectively short route. For N cities randomly distributed on a plane, the algorithm on average yields a path 25% longer than the shortest possible path; however, there exist many specially-arranged city distributions which make the NN algorithm give the worst route.[24] This is true for both asymmetric and symmetric TSPs. Rosenkrantz et al.[25] showed that the NN algorithm has the approximation factor

\Theta(log|V|)

for instances satisfying the triangle inequality. A variation of the NN algorithm, called nearest fragment (NF) operator, which connects a group (fragment) of nearest unvisited cities, can find shorter routes with successive iterations.[26] The NF operator can also be applied on an initial solution obtained by the NN algorithm for further improvement in an elitist model, where only better solutions are accepted.

The bitonic tour of a set of points is the minimum-perimeter monotone polygon that has the points as its vertices; it can be computed efficiently with dynamic programming.

Another constructive heuristic, Match Twice and Stitch (MTS), performs two sequential matchings, where the second matching is executed after deleting all the edges of the first matching, to yield a set of cycles. The cycles are then stitched to produce the final tour.[27]

The Algorithm of Christofides and Serdyukov

The algorithm of Christofides and Serdyukov follows a similar outline but combines the minimum spanning tree with a solution of another problem, minimum-weight perfect matching. This gives a TSP tour which is at most 1.5 times the optimal. It was one of the first approximation algorithms, and was in part responsible for drawing attention to approximation algorithms as a practical approach to intractable problems. As a matter of fact, the term "algorithm" was not commonly extended to approximation algorithms until later; the Christofides algorithm was initially referred to as the Christofides heuristic.

This algorithm looks at things differently by using a result from graph theory which helps improve on the lower bound of the TSP which originated from doubling the cost of the minimum spanning tree. Given an Eulerian graph, we can find an Eulerian tour in time,[5] so if we had an Eulerian graph with cities from a TSP as vertices, then we can easily see that we could use such a method for finding an Eulerian tour to find a TSP solution. By the triangle inequality, we know that the TSP tour can be no longer than the Eulerian tour, and we therefore have a lower bound for the TSP. Such a method is described below.

  1. Find a minimum spanning tree for the problem.
  2. Create duplicates for every edge to create an Eulerian graph.
  3. Find an Eulerian tour for this graph.
  4. Convert to TSP: if a city is visited twice, then create a shortcut from the city before this in the tour to the one after this.

To improve the lower bound, a better way of creating an Eulerian graph is needed. By the triangle inequality, the best Eulerian graph must have the same cost as the best travelling salesman tour; hence, finding optimal Eulerian graphs is at least as hard as TSP. One way of doing this is by minimum weight matching using algorithms with a complexity of

O(n3)

.[5]

Making a graph into an Eulerian graph starts with the minimum spanning tree; all the vertices of odd order must then be made even, so a matching for the odd-degree vertices must be added, which increases the order of every odd-degree vertex by 1.[5] This leaves us with a graph where every vertex is of even order, which is thus Eulerian. Adapting the above method gives the algorithm of Christofides and Serdyukov:

  1. Find a minimum spanning tree for the problem.
  2. Create a matching for the problem with the set of cities of odd order.
  3. Find an Eulerian tour for this graph.
  4. Convert to TSP using shortcuts.

Pairwise exchange

The pairwise exchange or 2-opt technique involves iteratively removing two edges and replacing them with two different edges that reconnect the fragments created by edge removal into a new and shorter tour. Similarly, the 3-opt technique removes 3 edges and reconnects them to form a shorter tour. These are special cases of the k-opt method. The label Lin–Kernighan is an often heard misnomer for 2-opt; Lin–Kernighan is actually the more general k-opt method.

For Euclidean instances, 2-opt heuristics give on average solutions that are about 5% better than those yielded by Christofides' algorithm. If we start with an initial solution made with a greedy algorithm, then the average number of moves greatly decreases again and is ; however, for random starts, the average number of moves is . While this is a small increase in size, the initial number of moves for small problems is 10 times as big for a random start compared to one made from a greedy heuristic. This is because such 2-opt heuristics exploit 'bad' parts of a solution such as crossings. These types of heuristics are often used within vehicle routing problem heuristics to re-optimize route solutions.[28]

k-opt heuristic, or Lin–Kernighan heuristics

The Lin–Kernighan heuristic is a special case of the V-opt or variable-opt technique. It involves the following steps:

  1. Given a tour, delete k mutually disjoint edges.
  2. Reassemble the remaining fragments into a tour, leaving no disjoint subtours (that is, do not connect a fragment's endpoints together). This in effect simplifies the TSP under consideration into a much simpler problem.
  3. Each fragment endpoint can be connected to other possibilities: of 2k total fragment endpoints available, the two endpoints of the fragment under consideration are disallowed. Such a constrained 2k-city TSP can then be solved with brute-force methods to find the least-cost recombination of the original fragments.

The most popular of the k-opt methods are 3-opt, as introduced by Shen Lin of Bell Labs in 1965. A special case of 3-opt is where the edges are not disjoint (two of the edges are adjacent to one another). In practice, it is often possible to achieve substantial improvement over 2-opt without the combinatorial cost of the general 3-opt by restricting the 3-changes to this special subset where two of the removed edges are adjacent. This so-called two-and-a-half-opt typically falls roughly midway between 2-opt and 3-opt, both in terms of the quality of tours achieved and the time required to achieve those tours.

V-opt heuristic

The variable-opt method is related to, and a generalization of, the k-opt method. Whereas the k-opt methods remove a fixed number (k) of edges from the original tour, the variable-opt methods do not fix the size of the edge set to remove. Instead, they grow the set as the search process continues. The best-known method in this family is the Lin–Kernighan method (mentioned above as a misnomer for 2-opt). Shen Lin and Brian Kernighan first published their method in 1972, and it was the most reliable heuristic for solving travelling salesman problems for nearly two decades. More advanced variable-opt methods were developed at Bell Labs in the late 1980s by David Johnson and his research team. These methods (sometimes called Lin–Kernighan–Johnson) build on the Lin–Kernighan method, adding ideas from tabu search and evolutionary computing. The basic Lin–Kernighan technique gives results that are guaranteed to be at least 3-opt. The Lin–Kernighan–Johnson methods compute a Lin–Kernighan tour, and then perturb the tour by what has been described as a mutation that removes at least four edges and reconnects the tour in a different way, then V-opting the new tour. The mutation is often enough to move the tour from the local minimum identified by Lin–Kernighan. V-opt methods are widely considered the most powerful heuristics for the problem, and are able to address special cases, such as the Hamilton Cycle Problem and other non-metric TSPs that other heuristics fail on. For many years, Lin–Kernighan–Johnson had identified optimal solutions for all TSPs where an optimal solution was known and had identified the best-known solutions for all other TSPs on which the method had been tried.

Randomized improvement

Optimized Markov chain algorithms which use local searching heuristic sub-algorithms can find a route extremely close to the optimal route for 700 to 800 cities.

TSP is a touchstone for many general heuristics devised for combinatorial optimization such as genetic algorithms, simulated annealing, tabu search, ant colony optimization, river formation dynamics (see swarm intelligence), and the cross entropy method.

Constricting Insertion Heuristic

This starts with a sub-tour such as the convex hull and then inserts other vertices.[29]

Ant colony optimization

See main article: Ant colony optimization algorithms. Artificial intelligence researcher Marco Dorigo described in 1993 a method of heuristically generating "good solutions" to the TSP using a simulation of an ant colony called ACS (ant colony system).[30] It models behavior observed in real ants to find short paths between food sources and their nest, an emergent behavior resulting from each ant's preference to follow trail pheromones deposited by other ants.

ACS sends out a large number of virtual ant agents to explore many possible routes on the map. Each ant probabilistically chooses the next city to visit based on a heuristic combining the distance to the city and the amount of virtual pheromone deposited on the edge to the city. The ants explore, depositing pheromone on each edge that they cross, until they have all completed a tour. At this point the ant which completed the shortest tour deposits virtual pheromone along its complete tour route (global trail updating). The amount of pheromone deposited is inversely proportional to the tour length: the shorter the tour, the more it deposits.

Special cases

Metric

In the metric TSP, also known as delta-TSP or Δ-TSP, the intercity distances satisfy the triangle inequality.

A very natural restriction of the TSP is to require that the distances between cities form a metric to satisfy the triangle inequality; that is, the direct connection from A to B is never farther than the route via intermediate C:

dAB\ledAC+dCB

.

The edges then build a metric on the set of vertices. When the cities are viewed as points in the plane, many natural distance functions are metrics, and so many natural instances of TSP satisfy this constraint.

The following are some examples of metric TSPs for various metrics.

The last two metrics appear, for example, in routing a machine that drills a given set of holes in a printed circuit board. The Manhattan metric corresponds to a machine that adjusts first one coordinate, and then the other, so the time to move to a new point is the sum of both movements. The maximum metric corresponds to a machine that adjusts both coordinates simultaneously, so the time to move to a new point is the slower of the two movements.

In its definition, the TSP does not allow cities to be visited twice, but many applications do not need this constraint. In such cases, a symmetric, non-metric instance can be reduced to a metric one. This replaces the original graph with a complete graph in which the inter-city distance

dAB

is replaced by the shortest path length between A and B in the original graph.

Euclidean

For points in the Euclidean plane, the optimal solution to the travelling salesman problem forms a simple polygon through all of the points, a polygonalization of the points.[31] Any non-optimal solution with crossings can be made into a shorter solution without crossings by local optimizations. The Euclidean distance obeys the triangle inequality, so the Euclidean TSP forms a special case of metric TSP. However, even when the input points have integer coordinates, their distances generally take the form of square roots, and the length of a tour is a sum of radicals, making it difficult to perform the symbolic computation needed to perform exact comparisons of the lengths of different tours.

Like the general TSP, the exact Euclidean TSP is NP-hard, but the issue with sums of radicals is an obstacle to proving that its decision version is in NP, and therefore NP-complete. A discretized version of the problem with distances rounded to integers is NP-complete. With rational coordinates and the actual Euclidean metric, Euclidean TSP is known to be in the Counting Hierarchy, a subclass of PSPACE. With arbitrary real coordinates, Euclidean TSP cannot be in such classes, since there are uncountably many possible inputs. Despite these complications, Euclidean TSP is much easier than the general metric case for approximation. For example, the minimum spanning tree of the graph associated with an instance of the Euclidean TSP is a Euclidean minimum spanning tree, and so can be computed in expected O(n log n) time for n points (considerably less than the number of edges). This enables the simple 2-approximation algorithm for TSP with triangle inequality above to operate more quickly.

In general, for any c > 0, where d is the number of dimensions in the Euclidean space, there is a polynomial-time algorithm that finds a tour of length at most (1 + 1/c) times the optimal for geometric instances of TSP in

O{\left(n(logn)O(c)d-1

}\right)}

time; this is called a polynomial-time approximation scheme (PTAS). Sanjeev Arora and Joseph S. B. Mitchell were awarded the Gödel Prize in 2010 for their concurrent discovery of a PTAS for the Euclidean TSP.

In practice, simpler heuristics with weaker guarantees continue to be used.

Asymmetric

In most cases, the distance between two nodes in the TSP network is the same in both directions. The case where the distance from A to B is not equal to the distance from B to A is called asymmetric TSP. A practical application of an asymmetric TSP is route optimization using street-level routing (which is made asymmetric by one-way streets, slip-roads, motorways, etc.).

Conversion to symmetric

Solving an asymmetric TSP graph can be somewhat complex. The following is a 3×3 matrix containing all possible path weights between the nodes A, B and C. One option is to turn an asymmetric matrix of size N into a symmetric matrix of size 2N.[32]

+ Asymmetric path weightsA B C
A1 2
B6 3
C5 4

To double the size, each of the nodes in the graph is duplicated, creating a second ghost node, linked to the original node with a "ghost" edge of very low (possibly negative) weight, here denoted −w. (Alternatively, the ghost edges have weight 0, and weight w is added to all other edges.) The original 3×3 matrix shown above is visible in the bottom left and the transpose of the original in the top-right. Both copies of the matrix have had their diagonals replaced by the low-cost hop paths, represented by −w. In the new graph, no edge directly links original nodes and no edge directly links ghost nodes.

+ Symmetric path weightsA B C A′ B′ C′
Aw 6 5
B1 w 4
C2 3 w
A′w 1 2
B′6 w 3
C′5 4 w

The weight −w of the "ghost" edges linking the ghost nodes to the corresponding original nodes must be low enough to ensure that all ghost edges must belong to any optimal symmetric TSP solution on the new graph (w = 0 is not always low enough). As a consequence, in the optimal symmetric tour, each original node appears next to its ghost node (e.g. a possible path is

A\toA'\toC\toC'\toB\toB'\toA

), and by merging the original and ghost nodes again we get an (optimal) solution of the original asymmetric problem (in our example,

A\toC\toB\toA

).

Analyst's problem

There is an analogous problem in geometric measure theory which asks the following: under what conditions may a subset E of Euclidean space be contained in a rectifiable curve (that is, when is there a curve with finite length that visits every point in E)? This problem is known as the analyst's travelling salesman problem.

Path length for random sets of points in a square

Suppose

X1,\ldots,Xn

are

n

independent random variables with uniform distribution in the square

[0,1]2

, and let
\ast
L
n
be the shortest path length (i.e. TSP solution) for this set of points, according to the usual Euclidean distance. It is known that, almost surely,
*
L
n
\sqrtn

\beta    whenn\toinfty,

where

\beta

is a positive constant that is not known explicitly. Since
*
L
n\le2\sqrt

n+2

(see below), it follows from bounded convergence theorem that

\beta=\limn\toinfty

*
E[L
n]/\sqrt

n

, hence lower and upper bounds on

\beta

follow from bounds on
*
E[L
n]
.

The almost-sure limit

*
L
n
\sqrtn

\beta

as

n\toinfty

may not exist if the independent locations

X1,\ldots,Xn

are replaced with observations from a stationary ergodic process with uniform marginals.

Upper bound

L*\le2\sqrt{n}+2

, and therefore

\beta\leq2

, by using a naïve path which visits monotonically the points inside each of

\sqrtn

slices of width

1/\sqrt{n}

in the square.
*
L
n\le\sqrt{2n}+1.75
, hence

\beta\le\sqrt2

, later improved by Karloff (1987):

\beta\le0.984\sqrt2

.

\beta\le0.73...

.

Lower bound

*
E[L
n]
is greater than

n

times the distance between

X0

and the closest point

Xi\neX0

, one gets (after a short computation)
*
E[L
n]\ge\tfrac{1}{2}

\sqrt{n}.

*
E[L
n]
is greater than

n/2

times the sum of the distances between

X0

and the closest and second closest points

Xi,Xj\neX0

, which gives
*
E[L
n]\ge

l(\tfrac14+\tfrac38r)\sqrt{n}=\tfrac{5}{8}\sqrt{n},

*
E[L
n]\ge

l(\tfrac58+\tfrac{19}{5184}r)\sqrt{n},

*
L
n
, and thus for

\beta(\simeq

*
L
n/{\sqrt

n})

, which seem to be good up to more or less 1%.[35] [36] In particular, David S. Johnson obtained a lower bound by computer experiment:[37]
*
L
n\gtrsim

0.7080\sqrt{n}+0.522,

where 0.522 comes from the points near the square boundary which have fewer neighbours, and Christine L. Valenzuela and Antonia J. Jones obtained the following other numerical lower bound:[38]

*
L
n\gtrsim

0.7078\sqrt{n}+0.551

.

Computational complexity

The problem has been shown to be NP-hard (more precisely, it is complete for the complexity class FPNP; see function problem), and the decision problem version ("given the costs and a number x, decide whether there is a round-trip route cheaper than x") is NP-complete. The bottleneck travelling salesman problem is also NP-hard. The problem remains NP-hard even for the case when the cities are in the plane with Euclidean distances, as well as in a number of other restrictive cases. Removing the condition of visiting each city "only once" does not remove the NP-hardness, since in the planar case there is an optimal tour that visits each city only once (otherwise, by the triangle inequality, a shortcut that skips a repeated visit would not increase the tour length).

Complexity of approximation

In the general case, finding a shortest travelling salesman tour is NPO-complete.[39] If the distance measure is a metric (and thus symmetric), the problem becomes APX-complete, and the algorithm of Christofides and Serdyukov approximates it within 1.5.

If the distances are restricted to 1 and 2 (but still are a metric), then the approximation ratio becomes 8/7. In the asymmetric case with triangle inequality, in 2018, a constant factor approximation was developed by Svensson, Tarnawski, and Végh.[40] An algorithm by Vera Traub and achieves a performance ratio of

22+\varepsilon

.[41] The best known inapproximability bound is 75/74.

The corresponding maximization problem of finding the longest travelling salesman tour is approximable within 63/38. If the distance function is symmetric, then the longest tour can be approximated within 4/3 by a deterministic algorithm and within

(33+\varepsilon)/25

by a randomized algorithm.

Human and animal performance

The TSP, in particular the Euclidean variant of the problem, has attracted the attention of researchers in cognitive psychology. It has been observed that humans are able to produce near-optimal solutions quickly, in a close-to-linear fashion, with performance that ranges from 1% less efficient, for graphs with 10–20 nodes, to 11% less efficient for graphs with 120 nodes.[42] [43] The apparent ease with which humans accurately generate near-optimal solutions to the problem has led researchers to hypothesize that humans use one or more heuristics, with the two most popular theories arguably being the convex-hull hypothesis and the crossing-avoidance heuristic.[44] [45] [46] However, additional evidence suggests that human performance is quite varied, and individual differences as well as graph geometry appear to affect performance in the task.[47] [48] [49] Nevertheless, results suggest that computer performance on the TSP may be improved by understanding and emulating the methods used by humans for these problems,[50] and have also led to new insights into the mechanisms of human thought.[51] The first issue of the Journal of Problem Solving was devoted to the topic of human performance on TSP,[52] and a 2011 review listed dozens of papers on the subject.[51]

A 2011 study in animal cognition titled "Let the Pigeon Drive the Bus," named after the children's book Don't Let the Pigeon Drive the Bus!, examined spatial cognition in pigeons by studying their flight patterns between multiple feeders in a laboratory in relation to the travelling salesman problem. In the first experiment, pigeons were placed in the corner of a lab room and allowed to fly to nearby feeders containing peas. The researchers found that pigeons largely used proximity to determine which feeder they would select next. In the second experiment, the feeders were arranged in such a way that flying to the nearest feeder at every opportunity would be largely inefficient if the pigeons needed to visit every feeder. The results of the second experiment indicate that pigeons, while still favoring proximity-based solutions, "can plan several steps ahead along the route when the differences in travel costs between efficient and less efficient routes based on proximity become larger."[53] These results are consistent with other experiments done with non-primates, which have proven that some non-primates were able to plan complex travel routes. This suggests non-primates may possess a relatively sophisticated spatial cognitive ability.

Natural computation

When presented with a spatial configuration of food sources, the amoeboid Physarum polycephalum adapts its morphology to create an efficient path between the food sources, which can also be viewed as an approximate solution to TSP.

Benchmarks

For benchmarking of TSP algorithms, TSPLIB[54] is a library of sample instances of the TSP and related problems is maintained; see the TSPLIB external reference. Many of them are lists of actual cities and layouts of actual printed circuits.

Popular culture

See also

References

Further reading

External links

Notes and References

  1. Labbé . Martine . Laporte . Gilbert . Martín . Inmaculada Rodríguez . González . Juan José Salazar . The Ring Star Problem: Polyhedral analysis and exact algorithm . Networks . May 2004 . 43 . 3 . 177–189 . 10.1002/net.10114 . en . 0028-3045.
  2. See the TSP world tour problem which has already been solved to within 0.05% of the optimal solution. http://www.math.uwaterloo.ca/tsp/world/
  3. https://zs.thulb.uni-jena.de/receive/jportal_jparticle_00248075 "Der Handlungsreisende – wie er sein soll und was er zu tun hat, um Aufträge zu erhalten und eines glücklichen Erfolgs in seinen Geschäften gewiß zu sein – von einem alten Commis-Voyageur"
  4. A discussion of the early work of Hamilton and Kirkman can be found in Graph Theory, 1736–1936 by Biggs, Lloyd, and Wilson (Clarendon Press, 1986).
  5. Book: Lawler, E. L.. [{{google books |plainurl=y |id=qbFlMwEACAAJ}} The Travelling Salesman Problem: A Guided Tour of Combinatorial Optimization]. 1985. John Wiley & sons. 978-0-471-90413-7. Repr. with corrections..
  6. Robinson . Julia . On the Hamiltonian game (a traveling salesman problem) . 5 December 1949 . RM-303 . 2 May 2020 . The RAND Corporation . Santa Monica, CA . en . Defense Technical Information Center.
  7. A detailed treatment of the connection between Menger and Whitney as well as the growth in the study of TSP can be found in .
  8. van Bevern. René. Slugina. Viktoriia A.. 2020. A historical note on the 3/2-approximation algorithm for the metric traveling salesman problem. Historia Mathematica. 53. 118–127. 10.1016/j.hm.2020.04.003. 2004.02437. 214803097.
  9. Klarreich. Erica. Computer Scientists Find New Shortcuts for Infamous Traveling Salesman Problem. WIRED. 2015-06-14. 2013-01-30.
  10. Web site: Klarreich . Erica . Erica Klarreich . Computer Scientists Break Traveling Salesperson Record . Quanta Magazine . 13 October 2020 . en . 8 October 2020.
  11. .
  12. Web site: How Do You Fix School Bus Routes? Call MIT in Wall street Journal.
  13. , pp.308-309.
  14. Tucker, A. W. (1960), "On Directed Graphs and Integer Programs", IBM Mathematical research Project (Princeton University)
  15. Dantzig, George B. (1963), Linear Programming and Extensions, Princeton, NJ: PrincetonUP, pp. 545–7,, sixth printing, 1974.
  16. Short combinatorial proof that the DFJ polytope is contained in the MTZ polytope for the Asymmetric Traveling Salesman Problem . Operations Research Letters. 45 . 4. 323–324. 10.1016/j.orl.2017.04.010. 2017. Velednitsky. Mark . 1805.06997. 6941484.
  17. Requiem for the Miller–Tucker–Zemlin subtour elimination constraints? . European Journal of Operational Research. 236. 3 . 820–832 . 10.1016/j.ejor.2013.07.038. 2014. Bektaş. Tolga. Gouveia. Luis.
  18. C. E. Miller, A. W. Tucker, and R. A. Zemlin. 1960. Integer Programming Formulation of Traveling Salesman Problems. J. ACM 7, 4 (Oct. 1960), 326–329. DOI:https://doi.org/10.1145/321043.321046
  19. Dantzig. G.. Fulkerson. R.. Johnson. S.. November 1954. Solution of a Large-Scale Traveling-Salesman Problem. Journal of the Operations Research Society of America. 2. 4. 393–410. 10.1287/opre.2.4.393.
  20. ,,
  21. Book: https://epubs.siam.org/doi/10.1137/1.9781611975482.107 . 10.1137/1.9781611975482.107 . Quantum Speedups for Exponential-Time Dynamic Programming Algorithms . Proceedings of the Thirtieth Annual ACM-SIAM Symposium on Discrete Algorithms . 2019 . Ambainis . Andris . Balodis . Kaspars . Iraids . Jānis . Kokainis . Martins . Prūsis . Krišjānis . Vihrovs . Jevgēnijs . 1783–1793 . 978-1-61197-548-2 . 49743824 .
  22. . How to cut unfruitful branches using reduced rows and columns as in Hungarian matrix algorithm
  23. Web site: David . Applegate . Robert . Bixby . Vašek . Chvátal . William . Cook . Keld . Helsgaun . Optimal Tour of Sweden . June 2004 . 2020-11-11 .
  24. Gutina . Gregory . Yeob . Anders . Zverovich . Alexey . 15 March 2002 . Traveling salesman should not be greedy: domination analysis of greedy-type heuristics for the TSP . Discrete Applied Mathematics . 117 . 1–3 . 81–86 . 10.1016/S0166-218X(01)00195-0. free . >
  25. D. J. . Rosenkrantz . R. E. . Stearns . P. M. . Lewis . Approximate algorithms for the traveling salesperson problem . 15th Annual Symposium on Switching and Automata Theory (swat 1974) . 14–16 October 1974 . 10.1109/SWAT.1974.4.
  26. Ray . S. S. . Bandyopadhyay . S. . Pal . S. K. . 2007 . Genetic Operators for Combinatorial Optimization in TSP and Microarray Gene Ordering . Applied Intelligence . 26 . 3. 183–195 . 10.1007/s10489-006-0018-y. 10.1.1.151.132 . 8130854 .
  27. Kahng . A. B. . Reda . S. . 2004 . Match Twice and Stitch: A New TSP Tour Construction Heuristic . Operations Research Letters . 32 . 6. 499–509 . 10.1016/j.orl.2004.04.001 .
  28. Book: Johnson. D. S.. David S. Johnson. McGeoch. L. A.. The Traveling Salesman Problem: A Case Study in Local Optimization. Local Search in Combinatorial Optimisation. E. H. L.. Aarts. J. K.. Lenstra. Jan Karel Lenstra. John Wiley and Sons Ltd.. 1997 . London. 215–310 . https://www.cs.ubc.ca/~hutter/previous-earg/EmpAlgReadingGroup/TSP-JohMcg97.pdf.
  29. Alatartsev . Sergey . Augustine . Marcus . Ortmeier . Frank . 2013-06-02 . Constricting Insertion Heuristic for Traveling Salesman Problem with Neighborhoods . Proceedings of the International Conference on Automated Planning and Scheduling . en . 23 . 2–10 . 10.1609/icaps.v23i1.13539 . 18691261 . 2334-0843.
  30. 10.1016/S0303-2647(97)01708-5. 8243011 . Ant Colonies for the Traveling Salesman Problem. 1997. 10.1.1.54.7734. Dorigo . Marco. Gambardella. Luca Maria . Biosystems. 43. 2. 73–81 . 9231906. 1997BiSys..43...73D .
  31. Quintas . L. V. . Supnick . Fred . 10.2307/2313333 . . 2313333 . 188872 . 977–980 . On some properties of shortest Hamiltonian circuits . 72 . 1965. 9 .
  32. Jonker . Roy . Volgenant . Ton . Transforming asymmetric into symmetric traveling salesman problems . . 2 . 161–163. 1983 . 10.1016/0167-6377(83)90048-2 . 1983 .
  33. Few. L.. The shortest path and the shortest road through n points. Mathematika. 1955. 2. 2. 141–144. 10.1112/s0025579300000784 .
  34. Fiechter. C.-N.. A parallel tabu search algorithm for large traveling salesman problems. Disc. Applied Math.. 1994. 51. 3. 243–267 . 10.1016/0166-218X(92)00033-I. free.
  35. Held. M.. Karp. R.M.. The Traveling Salesman Problem and Minimum Spanning Trees. Operations Research. 1970. 18. 6. 1138–1162 . 10.1287/opre.18.6.1138 .
  36. Goemans . Michel X. . Michel Goemans. Bertsimas . Dimitris J. . Dimitris Bertsimas. Probabilistic analysis of the Held and Karp lower bound for the Euclidean traveling salesman problem. Mathematics of Operations Research. 1991. 16. 1. 72–89. 10.1287/moor.16.1.72.
  37. Web site: error . about.att.com.
  38. http://users.cs.cf.ac.uk/Antonia.J.Jones/Papers/EJORHeldKarp/HeldKarp.pdf Christine L. Valenzuela and Antonia J. Jones
  39. Orponen. P. . Mannila . H. . Heikki Mannila . 1987 . On approximation preserving reductions: Complete problems and robust measures' . Technical Report C-1987–28 . Department of Computer Science, University of Helsinki.
  40. Book: Svensson. Ola . Tarnawski. Jakub. Végh. László A.. Proceedings of the 50th Annual ACM SIGACT Symposium on Theory of Computing . A constant-factor approximation algorithm for the asymmetric traveling salesman problem . 2018 . http://dl.acm.org/citation.cfm?doid=3188745.3188824 . Stoc 2018 . en. Los Angeles, CA, USA. ACM Press. 204–213. 10.1145/3188745.3188824. 978-1-4503-5559-9 . 12391033 .
  41. Book: Traub. Vera. Vera Traub. Vygen. Jens. Proceedings of the 52nd Annual ACM SIGACT Symposium on Theory of Computing . An improved approximation algorithm for ATSP . 2020-06-08. https://dl.acm.org/doi/10.1145/3357713.3384233. Stoc 2020. Chicago, IL. ACM. 1–13 . 10.1145/3357713.3384233. 978-1-4503-6979-4. 1912.00670. 208527125.
  42. .
  43. Dry. Matthew. Lee. Michael D.. Vickers. Douglas. Hughes. Peter. 2006. Human Performance on Visually Presented Traveling Salesperson Problems with Varying Numbers of Nodes . The Journal of Problem Solving. 1. 1. 10.7771/1932-6246.1004. 1932-6246. 10.1.1.360.9763.
  44. Rooij . Iris Van. Stege. Ulrike. Schactman. Alissa. 2003-03-01. Convex hull and tour crossings in the Euclidean traveling salesperson problem: Implications for human performance studies. Memory & Cognition . 31. 2. 215–220. 10.3758/bf03194380. 12749463. 0090-502X. 10.1.1.12.6117. 18989303.
  45. MacGregor. James N.. Chu. Yun . 2011 . Human Performance on the Traveling Salesman and Related Problems: A Review. The Journal of Problem Solving. 3. 2. 10.7771/1932-6246.1090. 1932-6246. free.
  46. MacGregor . James N.. Chronicle. Edward P.. Ormerod. Thomas C.. 2004-03-01. Convex hull or crossing avoidance? Solution heuristics in the traveling salesperson problem. Memory & Cognition . 32. 2. 260–270. 10.3758/bf03196857. 15190718. 0090-502X. free.
  47. Vickers. Douglas. Mayo. Therese. Heitmann. Megan. Lee. Michael D. Hughes. Peter . Intelligence and individual differences in performance on three types of visually presented optimisation problems. Personality and Individual Differences. 36. 5. 1059–1071. 10.1016/s0191-8869(03)00200-9. 2004.
  48. Kyritsis. Markos. Gulliver. Stephen R.. Feredoes. Eva. 2017-06-12. Acknowledging crossing-avoidance heuristic violations when solving the Euclidean travelling salesperson problem. Psychological Research. 82. 5. 997–1009. 10.1007/s00426-017-0881-7. 28608230. 3959429. 0340-0727.
  49. Kyritsis . Markos. Blathras . George. Gulliver. Stephen. Varela. Vasiliki-Alexia. Sense of direction and conscientiousness as predictors of performance in the Euclidean travelling salesman problem . Heliyon. 3 . 11. e00461. 10.1016/j.heliyon.2017.e00461. 29264418. 5727545. 2017-01-11. free . 2017Heliy...300461K .
  50. Kyritsis. Markos. Gulliver. Stephen R.. Feredoes. Eva. Din. Shahab Ud. December 2018 . Human behaviour in the Euclidean Travelling Salesperson Problem: Computational modelling of heuristics and figural effects. Cognitive Systems Research. 52. 387–399. 10.1016/j.cogsys.2018.07.027 . 53761995.
  51. .
  52. https://docs.lib.purdue.edu/jps/vol1/iss1/ Journal of Problem Solving 1(1)
  53. Gibson. Brett. Wilkinson. Matthew. Kelly. Debbie. 2012-05-01. Let the pigeon drive the bus: pigeons can plan future routes in a room. Animal Cognition. en. 15. 3. 379–391. 10.1007/s10071-011-0463-9. 1435-9456. 21965161. 14994429.
  54. Web site: TSPLIB. 2020-10-10. comopt.ifi.uni-heidelberg.de.
  55. Geere. Duncan. 'Travelling Salesman' movie considers the repercussions if P equals NP. Wired UK . 2012-04-26 . 26 April 2012.
  56. When the Mona Lisa is NP-HardBy Evelyn Lamb, Scientific American, 31 April 2015