This document describes how to solve the traveling salesperson problem (TSP) using dynamic programming. It defines g(i,S) as the length of the shortest path from vertex i through all vertices in S to vertex 1. It shows that g(1,V-{1}) gives the optimal tour length, and that g(i,S) can be calculated using g values for smaller sets S via an equation. The complexity is O(n22n) time and O(n2n) space, which is better than brute force but still prohibitive for large n due to the exponential space needed.