Imagine you must visit many towns.
Imagine you have a list of cities.
Imagine you have a list of cities.
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. 
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.
Imagine you are a salesperson on a long trip.
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.
People have been curious about these paths for a long time. 
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. 
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. 
The travelling salesman problem, or TSP, is a famous puzzle in combinatorial optimization.
To solve this, mathematicians use a model called a weighted graph.
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. 

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. 
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. 
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.
🖼️ Images & Media (11)
More to explore
✨ What else?
Related topics you might enjoy
🔬 Go deeper
More advanced topics to explore
🪜 Step back
Simpler topics to build understanding
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.