The Travelling Salesman Problem: A Classic Puzzle Still Solving Modern Challenges

Srihari KodamSrihari Kodam
3 min read

Welcome to the Travelling Salesman Problem — one of the most studied, elegant, and applicable problems in computer science and operations research.


🧩 What is the Travelling Salesman Problem?

At its core, the Travelling Salesman Problem (TSP) is about finding the shortest possible route that visits a set of cities and returns to the origin city, with each city visited only once.

Formally, it’s defined on a complete weighted graph, where:

  • Nodes represent cities,

  • Edges represent paths between cities,

  • Weights on edges represent the cost/distance/time to travel between cities.

The goal: Minimize the total travel cost while visiting all cities exactly once and returning to the start.


💡 Why Is It Important?

TSP might sound like a math puzzle, but it’s deeply embedded in real-world applications, including:

  • Route planning for logistics and delivery companies (like FedEx, Amazon, or UPS),

  • Microchip manufacturing (minimizing wire paths),

  • DNA sequencing in bioinformatics,

  • Drone path optimization,

  • And even museum path layouts!


⚙️ Complexity and Challenges

TSP is an NP-hard problem. This means there is no known polynomial-time algorithm to solve it optimally for all instances.

As the number of cities (n) increases, the number of possible routes grows factorially:

  • For 4 cities: 3! = 6 routes

  • For 10 cities: 9! = 362,880 routes

  • For 20 cities: Over 10^18 routes

This combinatorial explosion is why solving large instances of TSP requires heuristics or approximation algorithms.


🛠️ Common Solutions & Algorithms

1. Brute-force Search:

Try all possible permutations — accurate but impractical for large n.

2. Dynamic Programming (Held-Karp Algorithm):

Reduces time complexity to O(n²·2ⁿ) — still exponential but better than brute-force.

3. Heuristics & Metaheuristics:

  • Nearest Neighbor: Always go to the nearest unvisited city.

  • Christofides’ Algorithm: Guarantees a solution within 1.5x the optimal.

  • Genetic Algorithms, Simulated Annealing, Ant Colony Optimization: Good for large datasets and practical use.

4. Linear Programming & Concorde TSP Solver:

For smaller instances (<100 cities), these solvers give exact solutions.


🧠 TSP Variants

Real-life problems often tweak TSP:

  • Multiple Travelling Salesmen Problem (mTSP)

  • Asymmetric TSP (ATSP) – where the distance from A to B ≠ B to A

  • Time-Window TSP

  • Capacitated Vehicle Routing Problem (CVRP)


🧳 TSP in the Age of AI

Modern TSP applications are being enhanced with:

  • Reinforcement Learning (RL) for adaptive routing

  • Graph Neural Networks (GNNs) for edge pattern learning

  • Quantum Computing (D-Wave’s Quantum Annealer has tackled small TSPs)


🧠 Thought Exercise: How Would You Solve It?

Next time you’re planning a road trip or optimizing a delivery route — think like a travelling salesman. Try solving a 5-city TSP on paper and feel the explosion of possibilities!


✍️ Final Thoughts

The Travelling Salesman Problem might be decades old, but its relevance is timeless. It embodies the intersection of theory, mathematics, and everyday optimization. Whether you’re a student, developer, or business leader — understanding TSP gives you a glimpse into the beauty (and challenge) of making things more efficient.

0
Subscribe to my newsletter

Read articles from Srihari Kodam directly inside your inbox. Subscribe to the newsletter, and don't miss out.

Written by

Srihari Kodam
Srihari Kodam