Overview
Held-Karp fixes a start city and stores the cheapest path that visits a subset of cities and ends at a chosen last city, then adds the closing edge back to the start.
Solves exact TSP by dynamic programming over visited-city subsets and the current last city.
Compact metadata for implementation and discovery.
Held-Karp fixes a start city and stores the cheapest path that visits a subset of cities and ends at a chosen last city, then adds the closing edge back to the start.
Quick facts
Runtime and memory behavior at a glance.
Best
O(n)
Average
O(2^n)
Worst
O(2^n)
Space
O(2^n)
dp[S][j] = min(dp[S - {j}][i] + dist(i,j)) for i in SBuilds the cheapest partial tour ending at city j after visiting subset S.
Show building shortest partial tours by subset and ending city on a small traveling salesperson problem example.
Held-Karp is exact but exponential; it is best treated as a small-instance solver or reference point.
What each reference supports for this entry.
Textbook support for Held-Karp TSP's algorithm family, complexity framing, and standard implementation concepts.
Open sourceAlgorithm catalog support for exact TSP dynamic programming and related combinatorial optimization tradeoffs.
Open sourceGood next jumps from the relationship graph, ranked for useful discovery.
Optimization · Core
Held-Karp searches subset states exactly, while 2-opt improves an existing tour locally.
Compare with thisOptimization · Core
Held-Karp is exact and exponential; Christofides is polynomial-time with a metric approximation guarantee.
Compare with thisHeld-Karp is exact and exponential; Christofides is polynomial-time with a metric approximation guarantee.
Held-Karp optimizes globally, while nearest-neighbor chooses a fast greedy tour.
Held-Karp searches subset states exactly, while 2-opt improves an existing tour locally.