Why it matters

Held-Karp is exact TSP baseline. Understanding shapes exact vs approx choice.

Advertisement

The architecture

State: (subset visited, current city).

DP: min tour visiting subset ending at city.

Held-Karp DPSubset SbitmaskEndpoint citycurrentDP transitionsadd each unvisitedBitmask DP; memory 2^n * n makes n > 25 infeasible
Held-Karp.
Advertisement

How it works end to end

dp[S][j] = min over i in S \ {j} of dp[S\{j}][i] + w(i,j).

Answer: min dp[full][j] + w(j, start).

Bitmask representation.