Notice that if we consider the path (in order):
(1,2,3,4,6,0,5,7)
and the path
(1,2,3,5,0,6,7,4)
The cost of going from vertex 1 to vertex 2 to vertex 3 remains the same, so why must it be recalculated? This result can be saved for later use.
Let dp[bitmask][vertex] represent the minimum c...