Round Trip of the Salesman — Solution & Editorial
Held–Karp bitmask DP: dp[mask][u] = cheapest path visiting exactly 'mask' cities ending at u. Transition to unvisited v; close the tour back to city 1 at the end.
Complexity: O(2N · N2)
Held–Karp bitmask DP: dp[mask][u] = cheapest path visiting exactly 'mask' cities ending at u. Transition to unvisited v; close the tour back to city 1 at the end.
Complexity: O(2N · N2)