Katana VentraIP

Travelling salesman problem

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 and the vehicle routing problem are both 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%.[1]


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.

An equivalent formulation in terms of is: Given a complete weighted graph (where the vertices would represent the cities, the edges would represent the roads, and the weights would be the cost or distance of that road), find a Hamiltonian cycle with the least weight. This is more general than the Hamiltonian path problem, which only asks if a Hamiltonian path (or cycle) exists in a non-complete unweighted graph.

graph theory

The requirement of returning to the starting city does not change the of the problem; see Hamiltonian path problem.

computational complexity

Another related problem is the : Find a Hamiltonian cycle in a weighted graph with the minimal weight of the weightiest edge. A real-world example is avoiding narrow streets with big buses.[14] The problem is of considerable practical importance, apart from evident transportation and logistics areas. A classic example is in printed circuit manufacturing: scheduling of a route of the drill machine to drill holes in a PCB. In robotic machining or drilling applications, the "cities" are parts to machine or holes (of different sizes) to drill, and the "cost of travel" includes time for retooling the robot (single-machine job sequencing problem).[15]

bottleneck travelling salesman problem

The , also known as the "travelling politician problem", deals with "states" that have (one or more) "cities", and the salesman must visit exactly one city from each state. One application is encountered in ordering a solution to the cutting stock problem in order to minimize knife changes. Another is concerned with drilling in semiconductor manufacturing; see e.g., U.S. patent 7,054,798. Noon and Bean demonstrated that the generalized travelling salesman problem can be transformed into a standard TSP with the same number of cities, but a modified distance matrix.

generalized travelling salesman problem

The sequential ordering problem deals with the problem of visiting a set of cities, where precedence relations between the cities exist.

A common interview question at is how to route data among data processing nodes; routes vary by time to transfer the data, but nodes also differ by their computing power and storage, compounding the problem of where to send data.

Google

The deals with a purchaser who is charged with purchasing a set of products. He can purchase these products in several cities, but at different prices, and not all cities offer the same products. The objective is to find a route between a subset of the cities that minimizes total cost (travel cost + purchasing cost) and enables the purchase of all required products.

travelling purchaser problem

Devising , which work reasonably fast only for small problem sizes.

exact algorithms

Devising "suboptimal" or , i.e., algorithms that deliver approximated solutions in a reasonable time.

heuristic algorithms

Finding special cases for the problem ("subproblems") for which either better or exact heuristics are possible.

Special cases[edit]

Metric[edit]

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:

Human and animal performance[edit]

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.[63][64] 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.[65][66][67] 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.[68][69][70] Nevertheless, results suggest that computer performance on the TSP may be improved by understanding and emulating the methods used by humans for these problems,[71] and have also led to new insights into the mechanisms of human thought.[72] The first issue of the Journal of Problem Solving was devoted to the topic of human performance on TSP,[73] and a 2011 review listed dozens of papers on the subject.[72]


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."[74] 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[edit]

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.[75]

Benchmarks[edit]

For benchmarking of TSP algorithms, TSPLIB[76] 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.

, by director Timothy Lanzone, is the story of four mathematicians hired by the U.S. government to solve the most elusive problem in computer-science history: P vs. NP.[77]

Travelling Salesman

Solutions to the problem are used by mathematician in a subgenre called TSP art.[78]

Robert A. Bosch

Canadian traveller problem

Exact algorithm

(also known as "Chinese postman problem")

Route inspection problem

Set TSP problem

Seven Bridges of Königsberg

Steiner travelling salesman problem

Subway Challenge

Tube Challenge

Vehicle routing problem

Graph exploration

Mixed Chinese postman problem

Arc routing

Snow plow routing problem

Monge array

at the Wayback Machine (archived 17 December 2013) at University of Waterloo

Traveling Salesman Problem

at the University of Heidelberg

TSPLIB, Sample instances for the TSP

by Jon McLoone at the Wolfram Demonstrations Project

Traveling Salesman Problem

TSP visualization tool