Read this lesson as text

Traveling Salesman Analysis

Discrete Math · Axiom Academy

EXAMPLE Traveling Salesman Problem Analysis Explore why TSP is computationally hard and compare different solution approaches 20 cities: 121 quintillion tours 25 cities: 310 septillion tours! Always go to the nearest unvisited city No known polynomial-time algorithm exists Verifying a solution is easy (polynomial) Finding the best solution is hard (exponential) Used as benchmark for algorithm efficiency Excellent work! You've analyzed the computational complexity of the Traveling Salesman Problem. Here's what we learned: TSP is NP-Complete: No known polynomial-time algorithm exists to solve it optimally Brute Force is O(n!): Checking all permutations becomes impossible even for small inputs (20+ cities) Dynamic Programming improves to O(n² · 2ⁿ): Still exponential, but better than factorial Greedy Approximations are O(n²): Much faster, often finding good (but not always optimal) solutions Trade-offs Matter: In real applications, fast approximations often beat slow exact algorithms Approximation Guarantees: Some approximation algorithms (like 2-opt) guarantee solutions within a certain percentage of optimal TSP demonstrates fundamental concepts in computational complexity theory and shows why algorithm choice matters in practical computing. The same principles apply to many real-world optimization problems in logistics, manufacturing, and network design!

This is the written version of the interactive lesson above. See the full Discrete Math course.