0% found this document useful (0 votes)
180 views

Travelling Salesman Problem

1) The traveling salesman problem (TSP) involves finding the shortest route for a salesman to visit each city once and return to the origin city. 2) Exact solutions using enumeration become intractable even for moderate numbers of cities due to the vast number of possible routes. 3) Heuristics and approximation algorithms are commonly used instead to find reasonably good but not necessarily optimal solutions for large problem instances.

Uploaded by

rafsanteto
Copyright
© © All Rights Reserved
Available Formats
Download as PPT, PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
180 views

Travelling Salesman Problem

1) The traveling salesman problem (TSP) involves finding the shortest route for a salesman to visit each city once and return to the origin city. 2) Exact solutions using enumeration become intractable even for moderate numbers of cities due to the vast number of possible routes. 3) Heuristics and approximation algorithms are commonly used instead to find reasonably good but not necessarily optimal solutions for large problem instances.

Uploaded by

rafsanteto
Copyright
© © All Rights Reserved
Available Formats
Download as PPT, PDF, TXT or read online on Scribd
You are on page 1/ 27

Presented By

Md. Rafsan Jani


Md. Ashraful Islam
Fuad Hasan
Abdur Rahim




Dept. Of CSE, Jahangirnagar University
The "Traveling Salesman Problem" (TSP) is a common
problem applied to artificial intelligence. It is a
NP-hard problem.
Lots of researches are going on in this topic.

Dept. Of CSE, Jahangirnagar University
Dept. Of CSE, Jahangirnagar University
Given a list of cities and their pair wise distances, the
task is to find the shortest possible route that visits
each city exactly once and returns to the origin city.

What is the minimum distance of the tour??
What is the sequence??
Dept. Of CSE, Jahangirnagar University

Why don't we just check all possible tours using a
computer?

Given n cities and the distances di,j between all of them, we
wish to nd the shortest tour going through all cities and back
to the starting city.
Usually the TSP is given as a Graph(G),G = (V,D) where V = {1, 2,
. . . , n} is the set of cities, and D is the adjacency distance
matrix, with i, j V, i != j, di,j > 0, the problem is to nd the
tour with minimal distance/cost of travelling , starting in 1 goes
through all n cities and returns to the city 1.
Dept. Of CSE, Jahangirnagar University



Given S V with 1 S and given j = 1, j S, let C(S, j)
be
the shortest path
that starting at 1, visits all nodes in S and ends at j.
Observation:
If |S| = 2, then C(S, k) = d1,k for k = 2, 3, . . . , n
If |S| > 2, then C(S, k) = the optimal tour from 1 to m,
+dm,k, m S {k}

Dept. Of CSE, Jahangirnagar University
Dept. Of CSE, Jahangirnagar University

If there are n cities, the number of possible tours is (n - 1)!.




No. of cities No. of Tour Time
5
8
10
12
15
18
20
24
5040
2*181,440
2*19,958,400
2*87,178,291,200
2*177,843,714,048,000
2*60,822,550,204,416,000
12 microsecs
2.5 millisecs
0.18 secs
20 secs
12.1 hours
5.64 years
1927 years
Dept. Of CSE, Jahangirnagar University
Dept. Of CSE, Jahangirnagar University
1) Approximate. Use heuristics!
Nearest neighbour, nearest merger,
Love & Norback (angles), Lin-Kernighan (3-opt),
min spanning tree + shortcuts (Christofides),
and many others.

2) Spend a lot of time at it. Enumeration!
Cutting planes,
branch & bound,
dynamic programming.

Dept. Of CSE, Jahangirnagar University
Dept. Of CSE, Jahangirnagar University
Observation:
1.From starting node visit all the adjacent node
2. Repeat step 1 until all nodes are visited.

Recurrence:
Dept. Of CSE, Jahangirnagar University
Dept. Of CSE, Jahangirnagar University
Lets , consider there are four city in our example. Given
the adjacency matrix , which depicts the distance
between each cities. Distance between city i to j is
equal to the distance between city j to i .


Dept. Of CSE, Jahangirnagar University
0
1
3 2


70


75 30 20 80




90
Lets , consider there are four city in our example. Given the adjacency matrix , which
depicts the distance between each cities. Distance between city i to j is equal to the distance
between city j to i .

Dept. Of CSE, Jahangirnagar University
1 2 3 4
1 0 70 30 75
2 70 0 80 20
3 30 80 0 90
4 75 20 90 0
Adjacency Matrix Representation :
Dept. Of CSE, Jahangirnagar University


Figure : graphical representation of all possible tour.
Dept. Of CSE, Jahangirnagar University
0
1
3 2


70


75 30 20 80




90


TSP tour optimal distance :205
And traverse sequence is
0->2->1->3->0
Or,
0->3->1->2->0
Dept. Of CSE, Jahangirnagar University
0
1
3 2


70


75 30 20 80




90


TSP tour optimal distance :205
And traverse sequence is
0->2->1->3->0
Or,
0->3->1->2->0
Dept. Of CSE, Jahangirnagar University
0
1
3 2


70


75 30 20 80




90


TSP tour optimal distance :205
And traverse sequence is
0->2->1->3->0
Or,
0->3->1->2->0
Dept. Of CSE, Jahangirnagar University
0
1
3 2


70


75 30 20 80




90


TSP tour optimal distance :205
And traverse sequence is
0->2->1->3->0
Or,
0->3->1->2->0
Dept. Of CSE, Jahangirnagar University
Dept. Of CSE, Jahangirnagar University




a + b c

For example, cost of an edge as the euclidian distance
between two points.

Metric Traveling Salesman Problem (metric TSP):
Given a complete graph with edge costs satisfying
triangle inequalities. So, if we visit one city more than
once , it will certainly cost more.

As we are visiting all the cities once and we will come
back to the start position , it will create a cycle.


Dept. Of CSE, Jahangirnagar University
Time complexity of naive approach is : O(n!)
Space complexity of naive approach is : O(n)

Time complexity of dynamic programming approach is :
O( )

Space complexity of dynamic programming approach is :
O( )

Dept. Of CSE, Jahangirnagar University
scheduling jobs on machines
controlling satellites, telescopes, microscopes, lasers...
computing DNA sequences
designing telecommunications networks
designing and testing VLSI circuits
Dept. Of CSE, Jahangirnagar University
Dept. Of CSE, Jahangirnagar University
Dept. Of CSE, Jahangirnagar University

You might also like