The document describes the travelling salesman problem and its solution using dynamic programming. It defines a journey J(k,S) as starting at node k, passing through nodes in set S at most once, and terminating at node 1. It calculates the costs of all possible journeys, starting with direct paths to node 1, then paths with one node in S, then two nodes, and finally three nodes to find the overall minimum cost tour. The minimum cost tours for the sample graph are listed as 1-2-4-3-1, 1-3-2-4-1, 1-4-2-3-1, or 1-3-4-2-1.
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
0 ratings0% found this document useful (0 votes)
83 views
Travelling Salesman Problem Dynamic Programming
The document describes the travelling salesman problem and its solution using dynamic programming. It defines a journey J(k,S) as starting at node k, passing through nodes in set S at most once, and terminating at node 1. It calculates the costs of all possible journeys, starting with direct paths to node 1, then paths with one node in S, then two nodes, and finally three nodes to find the overall minimum cost tour. The minimum cost tours for the sample graph are listed as 1-2-4-3-1, 1-3-2-4-1, 1-4-2-3-1, or 1-3-4-2-1.
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
You are on page 1/ 2
TRAVELLING SALESMAN PROBLEM
DYNAMIC PROGRAMMING SOLUTION
SAMPLE GRAPH COST(k,l) = 10(k+l)
30
3 50
30
70
50 2
60
THE TRAVELLING SALESMAN PROBLEM
In a complete weighted graph find a tour of minimum cost. Let a journey be defined as follows. A journey J(k,S) starts at a node k, passes through all the nodes in S at most once and terminates at node 1. S is a subset of the nodes of the graph excluding node 1. S is the null set J(2,) = 30, J(3,) = 40, J(4,) = 50---direct paths to node 1. S has one element J(2, {3}) = cost(2,3) + J(3, ) = 50 + 30 = 80 J(2, {4}) = cost(2,4) + J(4, ) = 60 + 40 = 100 J(3, {2}) = cost(3,2) + J(3, ) = 50 + 30 = 80 J(3, {4}) = cost(3,4) + J(4, ) = 70 + 40 = 110 J(4, {2}) = cost(4,2) + J(2, ) = 60 + 20 = 80