2. The Dynamic-Programming
Algorithm
The idea of solving TSPs by dynamic programming is not new. For any TSP, the cost of an optimal tour segment visiting the cities of a subset M ⊂ N in posi- tions 1 through i−1 and visiting city j in position i, can be calculated recursively as