Traveling Salesman Problem
Traveling Salesman Problem
Traveling Salesman Problem
Given
A directed graph G = (V,E)
Finding a Solution
There are a few general methods for finding solutions for the TSP: Brute Force Dynamic Programming Approximation
Dynamic Programming
It is an algorithm design method that can used when the solution to a problem can be viewed as
Contd
Clearly, g(i, )= c , 1 i n
So we can find all values of g(i, S) for all S of size 1. Then we find g(i,S) for S with |S|=2 and so on,
Example
0 10 15 5 0 9 6 13 0 8 8 9 20 10 12 0
0 5 6 8
10 15 20 0 9 10 13 0 12 8 9 0
0 5 6 8
10 15 20 0 9 10 13 0 12 8 9 0
g(2,{3,4}) = min{c + g(3,{4}),c + g(4,{3})} = min{29,25} =25 g(3,{2,4}) = min{c + g(2,{4}),c + g(4,{2})} =25 g(4,{2,3}) = min{c + g(2,{3}),c + g(3,{2})} =23
0 5 6 8
10 15 20 0 9 10 13 0 12 8 9 0
Result
Minimum cost = 35 Optimal tour is 1-2-4-3-1
Applications
Transportation
Technology
THANK YOU