Log in Sign up
Back to Discover
🔢

Travelling salesman problem

math Maturity 11-13

Imagine you must visit many towns.

Illustration of an unsolved travelling salesman problem.svg
Illustration of an unsolved travelling salesman problem.svg
You want to go fast. You need the shortest way. You must go to each town once. Then you go home. This helps us plan trips. It even helps make tiny chips.
GLPK solution of a travelling salesman problem.svg
GLPK solution of a travelling salesman problem.svg
Can you find the best way?

58 words

Imagine you have a list of cities.

Illustration of an unsolved travelling salesman problem.svg
Illustration of an unsolved travelling salesman problem.svg
You want to visit every city. You must go to each one just once. Then, you must go back to where you started. You want to find the shortest path. This saves time and money.
GLPK solution of a travelling salesman problem.svg
GLPK solution of a travelling salesman problem.svg
This is a hard puzzle to solve. People use it to plan bus routes. It also helps machines make tiny computer chips. Scientists even use it to study stars. Finding the best way is a big job for computers.

95 words

Imagine you have a list of cities.

Illustration of an unsolved travelling salesman problem.svg
Illustration of an unsolved travelling salesman problem.svg
You want to visit every city on that list. You must visit each city exactly once. Then, you must go back to where you started. Your goal is to find the shortest possible route. This is called the travelling salesman problem.
GLPK solution of a travelling salesman problem.svg
GLPK solution of a travelling salesman problem.svg

This is a very hard puzzle for computers to solve. As you add more cities, the math gets much harder. This is because there are so many ways to move between them. Mathematicians like William Rowan Hamilton studied these kinds of puzzles long ago.

William Rowan Hamilton painting.jpg
William Rowan Hamilton painting.jpg

We use this math in the real world every day. It helps plan bus routes to save time. It helps robots drill holes in tiny computer chips. It even helps astronomers move telescopes to see stars.

Weighted K4.svg
Weighted K4.svg
Some people use it to plan how to pick items in a big warehouse. Even with millions of cities, computers can find a path that is very close to the best one.

180 words

Imagine you are a salesperson on a long trip.

Illustration of an unsolved travelling salesman problem.svg
Illustration of an unsolved travelling salesman problem.svg
You have a list of different cities to visit. You must visit every single city on that list exactly one time. After your last stop, you have to travel back to your starting city. Your main goal is to find the shortest possible route to do this. This helps you save time and fuel. This puzzle is known as the travelling salesman problem.
GLPK solution of a travelling salesman problem.svg
GLPK solution of a travelling salesman problem.svg
It is a famous challenge in a field called combinatorial optimization.

To solve this, mathematicians use a special way to draw the problem. They treat cities as points called vertices. They draw lines between the cities called edges. Each line has a number on it called a weight. This weight might show the distance or the cost of travel.

Weighted K4.svg
Weighted K4.svg
In a symmetric problem, the distance is the same in both directions. However, in an asymmetric problem, the distance might change depending on which way you go. This happens with things like one-way streets or different airfares. Finding the best path is a very hard job for computers. As you add more cities, the number of possible routes grows very fast.

People have been curious about these paths for a long time.

William Rowan Hamilton painting.jpg
William Rowan Hamilton painting.jpg
In the 1800s, the mathematician William Rowan Hamilton studied similar puzzles. He created a game called the icosian game. Later, in the 1930s, mathematicians like Karl Menger began to study the problem more formally. In 1949, Julia Robinson wrote a report using the actual name for the problem. By the 1950s, the RAND Corporation offered prizes to help solve it. Researchers like George Dantzig, Delbert Ray Fulkerson, and Selmer M. Johnson made huge steps forward. They even solved a version with 49 cities.

Today, we use clever tricks to find answers for huge problems. We call these tricks heuristics or algorithms. Some methods can solve problems with tens of thousands of cities perfectly. For problems with millions of cities, we can find a route that is almost perfect.

Bruteforce.gif
Bruteforce.gif
For example, the TSP world tour problem was solved within 0.05% of the best possible answer. In 2006, researchers solved a version with 85,900 cities. This specific version was used to help plan microchip layouts. These big numbers show how much math has improved over the years.

This math is useful in many parts of our lives. It helps plan how school buses move through neighborhoods. It helps workers in warehouses pick items from shelves quickly.

Branchbound.gif
Branchbound.gif
Scientists even use it to sequence DNA fragments. In space, astronomers use it to move telescopes between stars efficiently. It even helps robots drill tiny holes in computer parts. Even though it started as a math puzzle, it helps our modern world run smoothly.

473 words

The travelling salesman problem, or TSP, is a famous puzzle in combinatorial optimization.

Illustration of an unsolved travelling salesman problem.svg
Illustration of an unsolved travelling salesman problem.svg
It asks a simple question about efficiency. Given a list of cities and the distances between every pair, what is the shortest route? This route must visit every city exactly once. Finally, the traveler must return to the original starting city. This creates a closed loop known as a Hamiltonian cycle.
GLPK solution of a travelling salesman problem.svg
GLPK solution of a travelling salesman problem.svg
Solving this helps save time, fuel, and money in many industries.

To solve this, mathematicians use a model called a weighted graph.

Weighted K4.svg
Weighted K4.svg
In this model, cities are called vertices. The paths between them are called edges. Each edge has a weight, which represents a cost like distance or time. There are two main types of TSP. In a symmetric TSP, the distance is the same in both directions. This halves the number of possible solutions. In an asymmetric TSP, the distances change based on direction. This happens because of one-way streets, traffic, or different airfares.

Finding the perfect answer is computationally difficult. In 1972, Richard M. Karp proved the Hamiltonian cycle problem is NP-complete. This means the TSP is NP-hard. As you add more cities, the time needed to find the best route grows superpolynomially. This makes it much harder than simple math problems. Because of this, researchers often use heuristics. These are clever strategies that find a very good answer quickly, even if it is not the absolute shortest.

Bruteforce.gif
Bruteforce.gif
Nearestneighbor.gif
Nearestneighbor.gif

History shows a long journey of discovery for this problem. While a 1832 handbook mentioned tours through Germany, formal math came later. In the 19th century, William Rowan Hamilton studied similar ideas through his icosian game.

William Rowan Hamilton painting.jpg
William Rowan Hamilton painting.jpg
In the 1930s, Karl Menger helped define the problem. Later, Merrill M. Flood studied it to solve school bus routing. The name "travelling salesman problem" first appeared in a 1949 RAND Corporation report by Julia Robinson. The problem became very popular in scientific circles during the 1950s and 1960s.

Major breakthroughs happened at the RAND Corporation. Researchers George Dantzig, Delbert Ray Fulkerson, and Selmer M. Johnson developed the cutting plane method. They expressed the problem as an integer linear program. Using these new methods, they solved an instance with 49 cities perfectly. They used only 26 cuts to find the optimal tour. They also used branch-and-bound algorithms for the first time.

Branchbound.gif
Branchbound.gif
In 1976, Christofides and Serdyukov independently created a new algorithm. Their method ensures the solution is at most 1.5 times the optimal length.

Modern technology allows us to tackle massive versions of this puzzle. In the 1990s, the Concorde program was developed for high-level solutions. In 2006, researchers solved a version with 85,900 cities. This specific problem involved a microchip layout. Today, we can find solutions for millions of cities within a 2% to 3% margin of error. One famous "world tour" problem was solved within 0.05% of the best possible answer. This shows how much computing power has grown.

This math is essential for many modern systems. In warehouses, it helps workers pick orders from shelves efficiently. In manufacturing, it guides robots that drill holes in microchips. It even helps scientists sequence DNA fragments. Astronomers use it to move telescopes between stars quickly. Even Google uses versions of this to route data between processing nodes. What began as a simple travel puzzle now powers much of our high-tech world.

574 words
🖼️ Images & Media (11)
File:Illustration of an unsolved travelling salesman problem.svg
Illustration of an unsolved travelling...
File:GLPK solution of a travelling salesman problem.svg
GLPK solution of a travelling salesman problem.svg
File:William Rowan Hamilton painting.jpg
William Rowan Hamilton painting.jpg
File:Weighted K4.svg
Weighted K4.svg
File:Bruteforce.gif
Bruteforce.gif
File:Branchbound.gif
Branchbound.gif
File:Nearestneighbor.gif
Nearestneighbor.gif
File:Creating a matching.svg
Creating a matching.svg
File:UbMjAyAmQrSwtP0gdeKe matchingshortcut.svg
UbMjAyAmQrSwtP0gdeKe matchingshortcut.svg
File:Showing a step of the two-opt heuristic.svg
Showing a step of the two-opt heuristic.svg
File:AntColony.gif
AntColony.gif
Up Next
🔢
Held–Karp algorithm
Math
More to explore

What is Nepedia?

A free, ad-free encyclopedia for children. Every article is written at five reading levels, so the same page works for a five-year-old and a fifteen-year-old — use the level switcher above to see this one change. No account needed to read.