Professional Documents
Culture Documents
A Computational Study & Tool For The Travelling Salesman Problem (TSP)
A Computational Study & Tool For The Travelling Salesman Problem (TSP)
Accent 3 Mangesh
Accent 4 Gharote,
Accent 5 Dilys Thomas
Accent 6 and SachinFollowed
Hyperlink LodhaHyperlink
Tata Consultancy Service – Innovations Lab
127 203 179 212 255 255
175 215 149 195 242 249
221 238 197 223 171 213
Tata Blue 50% Tata Blue 25% Purple 50 % Purple 25 % Yellow 50 % Yellow 25 %
Note: A general presentation for research and study purpose.
229 248 180Original Article
214 found on
241 251
205 241 213 231 240 251
186 235 http://dl.acm.org/citation.cfm?id=2694462
154 200 202 241
Cite as: Mangesh Gharote, Dilys Thomas, Sachin Lodha:
Excel
Brown 50 % Solvers for
Brown 25 the
% Traveling
Green 50 %Salesman
Green 25Problem.
% COMAD
Light Green 2012:
50% Light 103-107
Green 25%
Talk outline
Problem statement
Applications
Computational Complexity
Top Awards
Combinatorial algorithm
nearest neighbour
greedy
Geometric repair heuristics
intersection removal
hinge and crest optimization
Benchmark datasets
cities, PCB layout etc.
comparison of algorithms to state of art
2
Problem Statement, Complexity
Given
n cities,
An actual tour on the globe with
Distances or costs between pair the lines indicating tour paths
5
Popular Appeal
TSP in 1960 achieved
national prominence in
the United States of
America
6
Awards
Proved to be NP complete in 1972 by Richard
Karp
Richard Karp won the Turing Award 1985
For contribution to the theory of algorithms and
NP completeness including this result
He showed a reduction from a result on logic
satisfiability of conjunctive normal form clauses
that have 3 literals each (3SAT)
9
Approximation Algorithms
I) Nearest Neighbour
II) Greedy Algorithm
10
Nearest Neighbour (NN) Algorithm for TSP (Pseudo code)
4. Mark V as visited.
11
Greedy Algorithm for TSP (Pseudo code)
1. Sort all edges in increasing
order of weigths.
2. Select the shortest edge and
add it to our tour if it Sub
doesn’t violate any of the Cycle
below constraints:
a) if it is not yet in the tour
b) if adding it would not
create a degree-3 vertex Degree of Vertex <3
or
c) If does not create a
cycle of size less than N.
3. Do we have N edges in our
tour? If no, repeat step 2.
Time Complexity
O( n2 log (n))
12
Numerical Example Using NN & Greedy
1 4 2
3
Input Graph 2 4
2
3 4
2
4 4
1 2 1 2
3
2 4
2
3 4 3 4
2 2
Starting Node
12
12 11
11
13
Nearest Neighbour with different starting vertex
16 Cities Benchmark Problem
Start
Optimal 32 % Optimal 5 %
Start
14
16 Cities Benchmark Problem
Greedy
Difference from
Optimal 16 %
15
51 Cities Benchmark Problem
Sr. No Cities NN
Best Greedy
Greedy
1 14 15.6% 17.0%
2 16 4.5% 16.6%
4 48 13.0% 19.7%
5 51 19.2% 13.0%
6 67 7.2% 18.2%
7 96 11.8% 5.1%
8 101 17.0% 26.3%
9 280 21.4% 14.8%
10 505 20.7% 15.4%
11 783 25.0% 19.6%
12 1002 21.4% 19.2%
14 14051 21.3% Out of memory
Avg 16.1% 17%
17
Observation about NN and Greedy
For ‘N’ node graph, theoretically can guarantee
only upto O(log N) multiplicative factor away from
optimal
towards the end more expensive edges could be forced
Start point makes a difference for nearest neighbour
18
Types of Distances
2D – Euclidean
19
Geographical Distance Code - Longitude & Latitude
PI = 3.141592
For computing the geographical distance;
RRR = 6378.388; /* Radius of earth in kms */
20
World Tour - 535 Airports NN – 2 Opt
19% Away from Optimal
21
World Tour - 535 Airports Greedy 2 Opt
Hawai
Asia Guam
Africa
South America Fiji
Australia
Santiago
23
Africa and Islands
Optimal Tour
Sahara
Senegal
St. Helenas
Mauritius
Tristan de cunha
South Africa
24
PCB- Drilling Problem (Nodes-2103)
Optimal Solution
28
Largest TSP instances solved optimally till date
Ref: http://www.tsp.gatech.edu/optimal/index.html 29
Motivating Our Work: Need for Approximate Solutions
Year – 2001
15,112 German towns solved using 110 processors at
Rice University and Princeton University ~ 22.6
years on 500MHz Alpha processor.
Year – 2005
33,810 Circuit board using state-of-the-art
Concorde TSP Solver took 15.7 CPU - years
Year -2006
85,900 points was solved using Concorde TSP Solver
took over 136 CPU-years.
30
Our Benchmark Results
31
Well Known Approximation Algorithms
Lin-Kernighan
heuristic works well in practice
32
Lin-Kernighan
Costly to find 3-opt improvements: O(n3)
candidates
Tour modification:
Collection of simple changes
Some increase length
Total set of changes decreases length
33
Linear Programming Formulation for TSP
Degree of Vertex is 2
Subtour elimination
34
Held-Karp Dynamic Programming
O(n22n) algorithm for TSP
A&N: TSP 35
TSP: Recursive Dynamic Programming formulation
B({s},s) = 0
A&N: TSP 36
Christofides 1.5 Approximation
Make a Minimum Spanning Tree T
Metaheuristics:
Simulated Annealing
Ant Colony Optimization
Electromagnetism-like Algorithm
Project Title:
“Excelling with Metaheuristics”
B.E. Project Done By:
Prem Nathan, Prashant Kumar and Sani Kumbhar
38
Simulated Annealing (Kirkpatrick, 1985)
SA is a variant of local Initial position
of the ball Simulated Annealing explores
more. Chooses this move with a
The more ants follow a trail, the more attractive that trail becomes
for being followed.
Even when the tracks are equal the behavior will encourage one over
the other—convergence
40
Electromagnetism Like Algorithm (Birbil & Fang, 2003)
Initialization Force Calculation Movement Neighborhood
Search
F
Idea is based on the attraction repulsion mechanism of
electromagnetism theory (Coulomb’s law)
force exerted on a point via other points is inversely
proportional to the distance between the points and directly
proportional to the product of their charges
Demo 2
Printed Circuit Board Drilling
Problem
280 Locations on 2D plane
NN and NN-2 Opt
All intersections removed
44
Reference
Thank You !
Robert Bosch, February 2009
mona-lisa100K.tsp
$1000 Prize Offered
[Can convert pictures into tours
using Voronoi diagrams]
45