Professional Documents
Culture Documents
4
Applications
Hot rolling scheduling problem in Iron & Steel
Industry
Overhauling gas turbine engines (Ordering nozzle
guides)
X-Ray crystallography (Ordering positions for
measurement)
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)
8
Different Approaches for Solving TSP
Exact Heuristics
Enumeration Simulated Annealing
Linear Programming Genetic Algorithm
- Miller–Tucker–Zemlin Ant Colony
(1960) Optimization
Dynamic Programming Electromagnetism like
Algorithm
Approximation
Algorithms Lower Bound
- Nearest Neighbour Held -Karp
- Greedy
- K-Opt, Kernighan Lin (70’s)
- Christofides (1965)
9
Approximation Algorithms
I) Nearest Neighbour
II) Greedy Algorithm
10
Nearest Neighbour (NN) Algorithm for TSP (Pseudo code)
1. Select an arbitrary vertex as
current vertex.
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 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
Symmetric - Asymmetric
Triangular Inequality
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
(neighborhood) search
more. Chooses this move with a
small probability (Hill Climbing)
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