Post on 04-Jun-2018
8/13/2019 TSP Presentation
1/15
Data Structure and Algorithms
Presentation on
Travelling Salesman Problem Using Dynamic
Programing
Submitted To: Submitted By:
Ms. Smriti Sehgal Nawneet a!" Amit #umar Atul
Tyagi
8/13/2019 TSP Presentation
2/15
$ntroduction:
Definition: Given a set of cities and the distance
between each possible pair, the Travelling
Salesman Problem is to find the best possibleway of visiting all the cities exactly once and
returning to the starting point
In terms of graph theory, it means finding
the shortestHamiltonian cycleof a graph G.
8/13/2019 TSP Presentation
3/15
A Brie% &istory: The problem was first defined in the 1800s by
the Irish mathematician W.R. Hamilton and theBritish mathematicianThomas Kirkman.
The name Travelling Salesman Problem wasintroduced by mericanHassler Whiteney.
!esearchers from !"# $orporation create a
method to optimally sol%e T&' for () cities. In 1)*+, arp pro%es that T&' is "' complete.
8/13/2019 TSP Presentation
4/15
A''lications: Transportation
&chool Bus !outes Tra%eling &alesman
Technology -icrochip -anufacturing "etwor /ngineering
Biological Genome &euencing
T&' appears as a subproblem in many areas,such as DNA sequencing.
8/13/2019 TSP Presentation
5/15
Finding a Solution:
There are a few general methods for finding solutionsfor the TSP:
Brute Force Dynamic Programming Approximation
8/13/2019 TSP Presentation
6/15
ecurrence elation:
TSP (A") * The Minimum cost re+uired to go %rom ,erte- A to all
other emaining ,ertices is e-actly once and
coming bac to Source (S).
/ (A"S) $% *
TSP (A") *
/ (A"#) 0 TSP (#"12#3)
min
%or all # 4
5et Sbe the Source.
Dynamic Programming
8/13/2019 TSP Presentation
7/15
TSP Example: Let we have with us a Adjency Matrix. 1 2 !
1 " 1" 1# 2"
2 # " $ 1"
% 1 " 12
! & & $ "
Let 1 'e the S(urce). 1" 2#
*+1,2- TSP +2, /,!0-
# 1# 2#
TSP +1,/2,,!0- min *+1,- TSP +, /2,!0-
2" 2
*+1,!- TSP +!, /2,0-
8/13/2019 TSP Presentation
8/15
$ 2"
2# *+2,- TSP+, /!0-
TSP+2, /,!0- min
*+2,!- TSP+!, /0-
1" 1#
12 &
TSP/,!0 *+,!- *+!,1- 2"
$ %
TSP/!,0 *+!,- *+,1- 1#
8/13/2019 TSP Presentation
9/15
1 1&
2# *+,2- TSP+2, /!0-
TSP+, /2,!0- min
*+,!- TSP+!, /20-
12 1
1" &
TSP/2,!0 *+2,!- *+!,1- 1&
& #
TSP/!,20 *+!,2- *+2,1- 1
8/13/2019 TSP Presentation
10/15
& 1# 2 *+!,2- TSP+2, /0-
TSP+!, /2,0- min
*+!,- TSP+, /20-
$ 1&
$ %
TSP/2,0 *+2,- *+,1- 1#
1 # TSP/!,20 *+!,2- *+2,1- 1&
8/13/2019 TSP Presentation
11/15
S(, the Minimum ei3ht c(mes t( 'e #.
And the Path 4(ll(wed is).
1" 1" $ %
1 2 ! 1
S(, the t(tal ei3ht 1" 1" $ % #
8/13/2019 TSP Presentation
12/15
Time /om'le-city
1
+ 2 (
2 ( + ( 2 +
( 2 ( + + 2
!ecursi%e Tree ha%e 3n le%els4 where e%ery nodeha%e ma5imum 3n children4. &o, total number of
nodes are 67nn .
8/13/2019 TSP Presentation
13/15
S'ace /om'le-city
&pace $omple5city 9 n : nn
;here, n 9 Table.nn9 #ifferent function calls.
&o, &pace $omple5city 9 67nn.
8/13/2019 TSP Presentation
14/15
Summary
The TSP is a gra'h theory minimi6ation'roblem.
The com'le-ity o% the 'roblem (NP /om'lete) maes
it di%%icult to solve o'timally.
Solving TSP o'timally sheds light on other 'roblems
(P*NP).
7'timal solution carries a 'ri6e o% 89 Million
(Millennium Pri6e).
8/13/2019 TSP Presentation
15/15
Thank you.