tsp dynamic programming
tsp dynamic programming
Suppose we have started at city 1 and after visiting some cities now
we are in city j. Hence, this is a partial tour. We certainly need to
know j, since this will determine which cities are most convenient to
visit next. We also need to know all the cities visited so far, so that
we don't repeat any of them. Hence, this is an appropriate sub-
problem.