Nepedia
Back to Discover
Independent Reader
🔢

Travelling salesman problem

math Maturity 11-13 Next article →

Imagine you have a list of cities.

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

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

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

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

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.

160 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.