A delivery van has to visit a dozen stops and come home. What's the shortest route? This is the travelling salesman problem (TSP), and finding the exact shortest tour is NP-hard — for a real city map, the number of possible routes explodes faster than any computer can check.
So we change the question. Instead of "what is the best route?", we ask: "can we quickly find a route that is guaranteed to be close to the best?" In 1976 Nicos Christofides answered with a beautiful yes — for the common case where distances obey the triangle inequality (going direct is never longer than a detour), his algorithm always returns a tour at most 1.5 times the optimum.
The trick is to never search through routes at all. Instead it stitches a tour together out of two classic ingredients — a spanning tree and a matching — each of which we can compute quickly. That combination is one of the most elegant results in all of algorithm design.
Comments
Loading comments...