Nepedia
Back to Discover
Fluent Reader
🔢

Travelling salesman problem

math Maturity 11-13 Next article →

Imagine you are a salesperson on a long trip.

Illustration of an unsolved travelling salesman problem
Illustration of an unsolved travelling salesman problem

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
GLPK solution of a travelling salesman problem

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
Weighted K4

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
William Rowan Hamilton painting

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
Bruteforce

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
Branchbound

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.

454 words

Where will your curiosity go next?

Keep exploring at your chosen reading level.

🖼️ 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
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.