Dynamic programming for symmetric traveling salesman problem