Download presentation
Presentation is loading. Please wait.
1
Traveling Salesperson Problem
2
- 3 4 6 2 5 7 Traveling Salesperson Problem (TSP) A B A B C D A B C D
Optimization Problem: Find the least cost route starting at A, traveling through the other three cities exactly once and returning to A. Decision Problem: Is there a TSP route with cost less than k?
3
Icosian Game 1857
4
Traveller’s Dodecahedron 1857
5
Sir William Hamilton 1805 - 1865 Discovered quaternions in 1843
Invented Icosian Game in 1857 Invented Traveller’s Dodecahedron Hamiltonian Circuits
6
T. P. Kirkman In 1856, he published sufficient
In 1856, he published sufficient conditions for a polyhedral graph to have a Hamiltonian circuit.
8
Twentieth Century History
Merrill Flood, A.W.Tucker, Hassler Whitney (Princeton) pose the Traveling Salesperson Problem. 1947 George B. Dantzig designs simplex method for linear programming problems and formalizes combinatorial optimization as a a field of study. 1954 Connection with the Assignment Problem established. 1962 Dynamic programming formalized. 1972 Karp proved TSP is NP-complete. 1985 – 2006 Techniques leading to solving 300-city problems to …
9
TSP Applications Laser drilling circuit boards Robotic welding of cars
10
Genome sequencing. Finding most likely transitions between local maps.
TSP Applications Genome sequencing. Finding most likely transitions between local maps. Cities = maps Cost = likelihood of transition Job processing: Chemical plants – cost of setup to produce chemicals. Cities = setups Cost = time and cost of moving from one setup to next. Vehicle Routing Problem: Central depot delivery. Cities = Locations Cost = Delivery cost (minus profit) Depot
11
Admissions Office Campus Tour
Mathais Herb ‘n Farm Slocum El Pomar Packard Admissions Office Campus Tour
12
A A B C D B - 3 4 6 2 5 7 A B C D C D Traveling Salesperson Problem: Find the least cost route starting at A, traveling through the other three cities exactly once and returning to A.
13
Naïve Algorithm 1. List all routes and their costs: A BCD A = 18 A BDC A = 19 A CBD A = 15 A CDB A = 15 A DBC A = 24 A DCB A = 19 2. Find a route with minimum cost: A CBD A = (one optimal route)
14
Complexity If there are n cities (in addition to the home city A), then there are n! possible routes. The naïve algorithm takes at least n! steps. A random algorithm could possibly find an optimal route in n steps. Is there a deterministic algorithm that can find an optimal route in a polynomial number of steps? Finding the minimum in a list takes about n steps and sorting a list takes about n2 steps (or nlogn if you are clever.)
15
Theorem: (1972) TSP is NP-Complete. (That is, every other
hard problem is reducible to TSP.) Open problem: Is there a polynomial time algorithm for TSP? If not, can you prove it? (In technical terms, does P = NP?) Solving the open problem earns you $1,000,000 from the Clay Mathematics Institute.
16
Generating Permutations:
Recursion: A < BCD B < ACD C < ABD D < ABC BDC ADC ADB ACB CBD CAD BAD BAC CDB CDA BDA BCA DBC DAC DAB CAB DCB DCA DBA CBA Single exchange: ABCD CABD DCBA DBAC BACD ACBD DCAB DBCA BCAD ACDB DACB BDCA BCDA CADB ADCB BDAC CBDA CDAB ADBC BADC CBAD CDBA DABC ABDC
17
Timing results for Naïve Algorithm:
Cities Seconds Routes Sec/Route 10 0.50 3,628,800 1.38 x 10-7 11 5.61 39,916,800 1.41 x 10-7 12 69.12 479,001,600 1.44 x 10-7 Estimate for 16 cities: days (2.09 x 1013 routes)
18
Total nodes: 1+ n + n(n-1) + … + n!
B C D C D B D B C Little work required. D C D B C B Total nodes: 1+ n + n(n-1) + … + n! (If n=3, there are 10 nodes.)
19
Dynamic Programming Algorithm:
A – BCD EFG – A A – BCD EGF – A A – BCD FGE – A A – BCD FEG – A A – BCD GFE – A A – BCD GEF – A A – BCD FEG – A A – BDC FEG – A A – DBC FEG – A A – DCB FEG – A A – CBD FEG – A A – CDB FEG – A FEG g(i, S) = shortest path from i through vertices in S ending at A. g(i, S) = min { d g(j, S - {j}) } Optimal route = g(A, S) Steps: n2 x 2n i,j j in S
20
A B C D C D B C B D C C Branch and Bound techniques possibly reduce the number of nodes visited.
21
Branch and Bound Technique
Select node A. Generate children of selected node. If children complete a route, update optimal route. Otherwise, estimate cost of each child node and put on possible list. If estimated cost is greater than optimal so far, remove from list. Remove currently selected node from possible list. Select node on possible list with smallest cost. If there is no selected nodes, STOP, else go to 2. Technique depends on how accurate estimate is. Estimate must be a lower bound on the cost and is called the bounding function.
22
A Possible Bounding Function B(i) :
Each node i in the search tree represents a partial route. Those cities not in the partial route form a set of “remaining” cities. C1 = cost of partial route. C2 = sum of the minimum edges into each remaining city. B(i) = C1 + C2 B(i) <= Cost of any route containing the partial route.
23
Timing results for Branch and Bound Algorithm:
(Averages for three instances.) Cities Seconds Nodes Total Nodes 10 0.003 308 6,235,301 11 0.008 1442 68,588,312 12 0.011 3222 823,059,745 20 1.667 845,035 5 x 1019 For 22 cities, the elapsed time is about 17 seconds. Remember that the time and nodes visited vary with the TSP instance.
24
Shortest Campus Tour: 1281 seconds
Mathais Shortest Campus Tour: seconds Herb ‘n Farm Tutt Library Cutler Slocum El Pomar Armstrong Elapsed time: 1.3 seconds Total nodes visited: 743, 237
25
Linear Programming formulation of TSP
26
x2 x1+ x2 = 5.8 Feasible region Minimize: x1+ x2 Subject to: 2x1 + x2 >= 5 x1 + 2x2 >= 6 x1 >= 0 x2 >= 0 x1 x1+ x2 = 1 x1+ x2 = 3.67
27
TSP Instances Asymmetric Symmetric Upper Triangular Euclidean
Constant cost
28
- 1 3 5 10 6 8 2 9 A A B C D B A B C D C D Constant TSP:
A BCD A = 22 A CBD A = 22 A DBC A = 22 A BDC A = 22 A CDB A = 22 A DCB A = 22
29
Constant TSP: a b c 1 4 2 3 6 2 4 - 1 3 5 10 6 8 2 9
31
APPROXIMATIONS Are there “rules” (called heuristics) that help find good, if not optimal, TSP routes? Could an approximation algorithm find a route that was, say, within 110% of the optimal route? If I is a particular (instance) TSP problem, and A is an approximation algorithm, let A(I) be the cost of the route it generates and let OPT(I) be the optimal cost. Is it possible That A(I) < 1.1 OPT(I) for all I? Bottom line: No polynomial time algorithm A can guarantee that for all instances I of TSP, A(I) < r OPT(I) for any constant r, unless P=NP.
32
Geometric version of TSP:
The triangle inequality holds for the distance matrix. For any three cities A, B, C, AB + BC >= AC If the distance is actually the normal Euclidean distance, then the instance is referred to as a Euclidean TSP. For the Euclidean TSP, the route does not cross itself. The Euclidean TSP is still NP-Complete, but there are approximation algorithms.
33
Edge Crossings in Geometric TSP
A B e D C Ae + eB >= AB and Ce + eD >= CD AD + CB >= AB + CD
34
Shortest Campus Tour: 1281 seconds
Mathais Shortest Campus Tour: seconds Herb ‘n Farm Tutt Library Cutler Slocum El Pomar Armstrong Elapsed time: 1.3 seconds Total nodes visited: 743, 237
35
Minimum Spanning Tree Algorithm:
Pick next smallest edge connected to partial tree but not forming a cycle. D 11 C 6 9 E 7 2 4 7 10 9 A 5 B
36
Minimum Spanning Tree Algorithm:
Pick next smallest edge connected to partial tree but not forming a cycle. D 11 C 6 9 E 7 2 4 7 10 9 A 5 B
37
Minimum Spanning Tree Algorithm:
Pick next smallest edge connected to partial tree but not forming a cycle. D 11 C 6 9 E 7 2 4 7 10 9 A 5 B
38
Minimum Spanning Tree Algorithm:
Pick next smallest edge connected to partial tree but not forming a cycle. D 11 C 6 9 E 7 2 4 7 10 9 A 5 B
39
Minimum Spanning Tree Algorithm:
Pick next smallest edge connected to partial tree but not forming a cycle. D 11 C 6 9 E 7 2 4 7 10 9 A 5 B
40
Minimum Spanning Tree Algorithm:
Pick next smallest edge connected to partial tree but not forming a cycle. D 11 C 6 9 E 7 2 4 7 10 9 A 5 B To form a TSP route, trace the minimum spanning tree twice using short cuts if possible. This gives A-E-B-C-D-A. The cost of this route is 31. The spanning tree has cost 19.
41
Let OPT = cost of optimal TSP route.
MST = cost of minimum spanning tree. Rmst = cost of route derived from minimum spanning tree. The optimal TSP route minus the last edge is a minimum spanning tree, so MST < OPT. Then Rmst <= 2*MST <= 2*OPT With a little more care the shortcuts can be optimized to give: Rmst <= 1.5*OPT Recently an algorithm was discovered that gives Rmst <= (1+e)*OPT for arbitrary e>0
42
APPROXIMATIONS Some Heuristics for finding a good TSP tour: Nearest Neighbor Dissection Nearest Insertion Tour improvement (Lin-Kernighan)
43
Ant Colony Optimization
Ants find shortest path to food. They deposit pheromone on trail. Trails with most pheromone get most ants. Basic searching behavior has random character.
44
Ant Colony Optimization Algorithm for TSP:
Place some ants at each city. 2. Each ant calculates a = c / d where c is the amount of pheromone and d is the distance between i and j. Each ant selects a city not already visited with probabilities proportional to the a . After all ants have built a tour, evaporate some fraction of the existing pheromone. 5. Each ant deposits an amount of pheromone inversely proportional to the length of their tour. 6. Iterate steps 1 – 4 a large number of times. r s i,j i,j i,j i,j i,j i,j
45
Ant Campus Tour: 1291 seconds
Mathais Ant Campus Tour: seconds Herb ‘n Farm Tutt Library Cutler Slocum El Pomar Armstrong Elapsed time: 1.6 seconds Ant Tours: 34,000
46
Milestones in solving the TSP
Timing: d years of CPU time (110 processors; 500mhz.) sw years of CPU time
47
Line drawings with TSP routes: (Robert Bosch and Craig Kaplan)
Similar presentations
© 2025 SlidePlayer.com. Inc.
All rights reserved.