the traveling salesman problemjlmartin/courses/math105-f11/... · 2018. 8. 14. · the traveling...
TRANSCRIPT
![Page 1: The Traveling Salesman Problemjlmartin/courses/math105-F11/... · 2018. 8. 14. · The Traveling Salesman Problem De nition: A complete graph K N is a graph with N vertices and an](https://reader033.vdocuments.site/reader033/viewer/2022051906/5ff9744006e1a927894fa751/html5/thumbnails/1.jpg)
The Traveling Salesman Problem
Definition: A complete graph KN is a graph with Nvertices and an edge between every two vertices.
Definition: A Hamilton circuit is a circuit that uses everyvertex of a graph once.
Definition: A weighted graph is a graph in which eachedge is assigned a weight (representing the time, distance, orcost of traversing that edge).
Definition: The Traveling Salesman Problem is theproblem of finding a minimum-weight Hamilton circuit inKN .
![Page 2: The Traveling Salesman Problemjlmartin/courses/math105-F11/... · 2018. 8. 14. · The Traveling Salesman Problem De nition: A complete graph K N is a graph with N vertices and an](https://reader033.vdocuments.site/reader033/viewer/2022051906/5ff9744006e1a927894fa751/html5/thumbnails/2.jpg)
The Traveling Salesman Problem
Definition: A complete graph KN is a graph with Nvertices and an edge between every two vertices.
Definition: A Hamilton circuit is a circuit that uses everyvertex of a graph once.
Definition: A weighted graph is a graph in which eachedge is assigned a weight (representing the time, distance, orcost of traversing that edge).
Definition: The Traveling Salesman Problem is theproblem of finding a minimum-weight Hamilton circuit inKN .
![Page 3: The Traveling Salesman Problemjlmartin/courses/math105-F11/... · 2018. 8. 14. · The Traveling Salesman Problem De nition: A complete graph K N is a graph with N vertices and an](https://reader033.vdocuments.site/reader033/viewer/2022051906/5ff9744006e1a927894fa751/html5/thumbnails/3.jpg)
The Traveling Salesman Problem
Definition: A complete graph KN is a graph with Nvertices and an edge between every two vertices.
Definition: A Hamilton circuit is a circuit that uses everyvertex of a graph once.
Definition: A weighted graph is a graph in which eachedge is assigned a weight (representing the time, distance, orcost of traversing that edge).
Definition: The Traveling Salesman Problem is theproblem of finding a minimum-weight Hamilton circuit inKN .
![Page 4: The Traveling Salesman Problemjlmartin/courses/math105-F11/... · 2018. 8. 14. · The Traveling Salesman Problem De nition: A complete graph K N is a graph with N vertices and an](https://reader033.vdocuments.site/reader033/viewer/2022051906/5ff9744006e1a927894fa751/html5/thumbnails/4.jpg)
The Traveling Salesman Problem
Definition: A complete graph KN is a graph with Nvertices and an edge between every two vertices.
Definition: A Hamilton circuit is a circuit that uses everyvertex of a graph once.
Definition: A weighted graph is a graph in which eachedge is assigned a weight (representing the time, distance, orcost of traversing that edge).
Definition: The Traveling Salesman Problem is theproblem of finding a minimum-weight Hamilton circuit inKN .
![Page 5: The Traveling Salesman Problemjlmartin/courses/math105-F11/... · 2018. 8. 14. · The Traveling Salesman Problem De nition: A complete graph K N is a graph with N vertices and an](https://reader033.vdocuments.site/reader033/viewer/2022051906/5ff9744006e1a927894fa751/html5/thumbnails/5.jpg)
The Nearest-Neighbor Algorithm
1. Pick a reference vertex to start at.
2. Walk to its nearest neighbor (i.e., along the shortestpossible edge). (If there is a tie, break it randomly.)
3. At each stage in your tour, walk to the nearest neighborthat you have not already visited.
4. When you have visited all vertices, return to the startingvertex.
![Page 6: The Traveling Salesman Problemjlmartin/courses/math105-F11/... · 2018. 8. 14. · The Traveling Salesman Problem De nition: A complete graph K N is a graph with N vertices and an](https://reader033.vdocuments.site/reader033/viewer/2022051906/5ff9744006e1a927894fa751/html5/thumbnails/6.jpg)
The Nearest-Neighbor Algorithm
1. Pick a reference vertex to start at.
2. Walk to its nearest neighbor (i.e., along the shortestpossible edge). (If there is a tie, break it randomly.)
3. At each stage in your tour, walk to the nearest neighborthat you have not already visited.
4. When you have visited all vertices, return to the startingvertex.
![Page 7: The Traveling Salesman Problemjlmartin/courses/math105-F11/... · 2018. 8. 14. · The Traveling Salesman Problem De nition: A complete graph K N is a graph with N vertices and an](https://reader033.vdocuments.site/reader033/viewer/2022051906/5ff9744006e1a927894fa751/html5/thumbnails/7.jpg)
The Nearest-Neighbor Algorithm
1. Pick a reference vertex to start at.
2. Walk to its nearest neighbor (i.e., along the shortestpossible edge). (If there is a tie, break it randomly.)
3. At each stage in your tour, walk to the nearest neighborthat you have not already visited.
4. When you have visited all vertices, return to the startingvertex.
![Page 8: The Traveling Salesman Problemjlmartin/courses/math105-F11/... · 2018. 8. 14. · The Traveling Salesman Problem De nition: A complete graph K N is a graph with N vertices and an](https://reader033.vdocuments.site/reader033/viewer/2022051906/5ff9744006e1a927894fa751/html5/thumbnails/8.jpg)
The Nearest-Neighbor Algorithm
1. Pick a reference vertex to start at.
2. Walk to its nearest neighbor (i.e., along the shortestpossible edge). (If there is a tie, break it randomly.)
3. At each stage in your tour, walk to the nearest neighborthat you have not already visited.
4. When you have visited all vertices, return to the startingvertex.
![Page 9: The Traveling Salesman Problemjlmartin/courses/math105-F11/... · 2018. 8. 14. · The Traveling Salesman Problem De nition: A complete graph K N is a graph with N vertices and an](https://reader033.vdocuments.site/reader033/viewer/2022051906/5ff9744006e1a927894fa751/html5/thumbnails/9.jpg)
The Repetitive Nearest-Neighbor Algorithm
1. Pick a reference vertex to start at, and use theNearest-Neighbor Algorithm to find a Hamilton circuit.
2. Repeat Step 1 for every possible starting vertex. You willhave a total of N Hamilton circuits.
3. Select the cheapest one.
I Usually, there is no way to know in advance whichreference vertex will work the best.
I Once you find a Hamilton circuit, you can start your touranywhere you want.
![Page 10: The Traveling Salesman Problemjlmartin/courses/math105-F11/... · 2018. 8. 14. · The Traveling Salesman Problem De nition: A complete graph K N is a graph with N vertices and an](https://reader033.vdocuments.site/reader033/viewer/2022051906/5ff9744006e1a927894fa751/html5/thumbnails/10.jpg)
The Repetitive Nearest-Neighbor Algorithm
1. Pick a reference vertex to start at, and use theNearest-Neighbor Algorithm to find a Hamilton circuit.
2. Repeat Step 1 for every possible starting vertex. You willhave a total of N Hamilton circuits.
3. Select the cheapest one.
I Usually, there is no way to know in advance whichreference vertex will work the best.
I Once you find a Hamilton circuit, you can start your touranywhere you want.
![Page 11: The Traveling Salesman Problemjlmartin/courses/math105-F11/... · 2018. 8. 14. · The Traveling Salesman Problem De nition: A complete graph K N is a graph with N vertices and an](https://reader033.vdocuments.site/reader033/viewer/2022051906/5ff9744006e1a927894fa751/html5/thumbnails/11.jpg)
The Repetitive Nearest-Neighbor Algorithm
1. Pick a reference vertex to start at, and use theNearest-Neighbor Algorithm to find a Hamilton circuit.
2. Repeat Step 1 for every possible starting vertex. You willhave a total of N Hamilton circuits.
3. Select the cheapest one.
I Usually, there is no way to know in advance whichreference vertex will work the best.
I Once you find a Hamilton circuit, you can start your touranywhere you want.
![Page 12: The Traveling Salesman Problemjlmartin/courses/math105-F11/... · 2018. 8. 14. · The Traveling Salesman Problem De nition: A complete graph K N is a graph with N vertices and an](https://reader033.vdocuments.site/reader033/viewer/2022051906/5ff9744006e1a927894fa751/html5/thumbnails/12.jpg)
The Repetitive Nearest-Neighbor Algorithm
1. Pick a reference vertex to start at, and use theNearest-Neighbor Algorithm to find a Hamilton circuit.
2. Repeat Step 1 for every possible starting vertex. You willhave a total of N Hamilton circuits.
3. Select the cheapest one.
I Usually, there is no way to know in advance whichreference vertex will work the best.
I Once you find a Hamilton circuit, you can start your touranywhere you want.
![Page 13: The Traveling Salesman Problemjlmartin/courses/math105-F11/... · 2018. 8. 14. · The Traveling Salesman Problem De nition: A complete graph K N is a graph with N vertices and an](https://reader033.vdocuments.site/reader033/viewer/2022051906/5ff9744006e1a927894fa751/html5/thumbnails/13.jpg)
The Repetitive Nearest-Neighbor Algorithm
1. Pick a reference vertex to start at, and use theNearest-Neighbor Algorithm to find a Hamilton circuit.
2. Repeat Step 1 for every possible starting vertex. You willhave a total of N Hamilton circuits.
3. Select the cheapest one.
I Usually, there is no way to know in advance whichreference vertex will work the best.
I Once you find a Hamilton circuit, you can start your touranywhere you want.
![Page 14: The Traveling Salesman Problemjlmartin/courses/math105-F11/... · 2018. 8. 14. · The Traveling Salesman Problem De nition: A complete graph K N is a graph with N vertices and an](https://reader033.vdocuments.site/reader033/viewer/2022051906/5ff9744006e1a927894fa751/html5/thumbnails/14.jpg)
Example: Willy’s Tour of Australia
Ref. vertex Hamilton circuit WeightAD AD,ML,HO,CN,SY,BT,MK,CS,MI,AS,UL,BM,KU,DA,PE,AL,AD 18543AL AL,PE,BM,KU,DA,AS,UL,AD,ML,HO,CN,SY,BT,MK,CS,MI,AL 19795AS AS,UL,BM,KU,DA,MI,CS,MK,BT,SY,CN,ML,HO,AD,AL,PE,AS 18459BT BT,MK,CS,MI,AS,UL,BM,KU,DA,AD,ML,HO,CN,SY,AL,PE,BT 22113BM BM,KU,DA,AS,UL,AD,ML,HO,CN,SY,BT,MK,CS,MI,PE,AL,BM 19148CS CS,MK,BT,SY,CN,ML,HO,AD,AS,UL,BM,KU,DA,MI,PE,AL,CS 22936CN CN,SY,ML,HO,AD,AS,UL,BM,KU,DA,MI,CS,MK,BT,AL,PE,CN 21149DA DA,KU,BM,UL,AS,MI,CS,MK,BT,SY,CN,ML,HO,AD,AL,PE,DA 18543HO HO,ML,CN,SY,BT,MK,CS,MI,AS,UL,BM,KU,DA,AD,AL,PE,HO 20141KU KU,DA,AS,UL,BM,MI,CS,MK,BT,SY,CN,ML,HO,AD,AL,PE,KU 18785MK MK,CS,MI,AS,UL,BM,KU,DA,AD,ML,HO,CN,SY,BT,AL,PE,MK 23255ML ML,HO,CN,SY,BT,MK,CS,MI,AS,UL,BM,KU,DA,AD,AL,PE,ML 20141MI MI,AS,UL,BM,KU,DA,CS,MK,BT,SY,CN,ML,HO,AD,AL,PE,MI 20877PE PE,AL,BM,KU,DA,AS,UL,AD,ML,HO,CN,SY,BT,MK,CS,MI,PE 19148SY SY,CN,ML,HO,AD,AS,UL,BM,KU,DA,MI,CS,MK,BT,AL,PE,SY 21049 (NNA)UL UL,AS,MI,CS,MK,BT,SY,CN,ML,HO,AD,BM,KU,DA,PE,AL,UL 20763
![Page 15: The Traveling Salesman Problemjlmartin/courses/math105-F11/... · 2018. 8. 14. · The Traveling Salesman Problem De nition: A complete graph K N is a graph with N vertices and an](https://reader033.vdocuments.site/reader033/viewer/2022051906/5ff9744006e1a927894fa751/html5/thumbnails/15.jpg)
Example: Willy’s Tour of Australia
Ref. vertex Hamilton circuit WeightAD AD,ML,HO,CN,SY,BT,MK,CS,MI,AS,UL,BM,KU,DA,PE,AL,AD 18543AL AL,PE,BM,KU,DA,AS,UL,AD,ML,HO,CN,SY,BT,MK,CS,MI,AL 19795AS AS,UL,BM,KU,DA,MI,CS,MK,BT,SY,CN,ML,HO,AD,AL,PE,AS 18459 (best)BT BT,MK,CS,MI,AS,UL,BM,KU,DA,AD,ML,HO,CN,SY,AL,PE,BT 22113BM BM,KU,DA,AS,UL,AD,ML,HO,CN,SY,BT,MK,CS,MI,PE,AL,BM 19148CS CS,MK,BT,SY,CN,ML,HO,AD,AS,UL,BM,KU,DA,MI,PE,AL,CS 22936CN CN,SY,ML,HO,AD,AS,UL,BM,KU,DA,MI,CS,MK,BT,AL,PE,CN 21149DA DA,KU,BM,UL,AS,MI,CS,MK,BT,SY,CN,ML,HO,AD,AL,PE,DA 18543HO HO,ML,CN,SY,BT,MK,CS,MI,AS,UL,BM,KU,DA,AD,AL,PE,HO 20141KU KU,DA,AS,UL,BM,MI,CS,MK,BT,SY,CN,ML,HO,AD,AL,PE,KU 18785MK MK,CS,MI,AS,UL,BM,KU,DA,AD,ML,HO,CN,SY,BT,AL,PE,MK 23255ML ML,HO,CN,SY,BT,MK,CS,MI,AS,UL,BM,KU,DA,AD,AL,PE,ML 20141MI MI,AS,UL,BM,KU,DA,CS,MK,BT,SY,CN,ML,HO,AD,AL,PE,MI 20877PE PE,AL,BM,KU,DA,AS,UL,AD,ML,HO,CN,SY,BT,MK,CS,MI,PE 19148SY SY,CN,ML,HO,AD,AS,UL,BM,KU,DA,MI,CS,MK,BT,AL,PE,SY 21049 (NNA)UL UL,AS,MI,CS,MK,BT,SY,CN,ML,HO,AD,BM,KU,DA,PE,AL,UL 20763
![Page 16: The Traveling Salesman Problemjlmartin/courses/math105-F11/... · 2018. 8. 14. · The Traveling Salesman Problem De nition: A complete graph K N is a graph with N vertices and an](https://reader033.vdocuments.site/reader033/viewer/2022051906/5ff9744006e1a927894fa751/html5/thumbnails/16.jpg)
The Repetitive Nearest-Neighbor Algorithm
Using Alice Springs (AS) as the reference vertex yields thebest result:
AS → UL → BM → KU → DA → MI → CS → MK → BT→ SY → CN → ML → HO → AD → AL → PE → AS
Remember: Willy can still start anywhere he wants!For instance,
SY → CN → ML → HO → AD → AL → PE → AS→ UL → BM → KU → DA → MI → CS → MK → BT → SY
represents the same Hamilton circuit.
![Page 17: The Traveling Salesman Problemjlmartin/courses/math105-F11/... · 2018. 8. 14. · The Traveling Salesman Problem De nition: A complete graph K N is a graph with N vertices and an](https://reader033.vdocuments.site/reader033/viewer/2022051906/5ff9744006e1a927894fa751/html5/thumbnails/17.jpg)
The Repetitive Nearest-Neighbor Algorithm
Using Alice Springs (AS) as the reference vertex yields thebest result:
AS → UL → BM → KU → DA → MI → CS → MK → BT→ SY → CN → ML → HO → AD → AL → PE → AS
Remember: Willy can still start anywhere he wants!For instance,
SY → CN → ML → HO → AD → AL → PE → AS→ UL → BM → KU → DA → MI → CS → MK → BT → SY
represents the same Hamilton circuit.
![Page 18: The Traveling Salesman Problemjlmartin/courses/math105-F11/... · 2018. 8. 14. · The Traveling Salesman Problem De nition: A complete graph K N is a graph with N vertices and an](https://reader033.vdocuments.site/reader033/viewer/2022051906/5ff9744006e1a927894fa751/html5/thumbnails/18.jpg)
The Cheapest-Link Algorithm
Idea: Start in the middle.
I Add the cheapest available edge to your tour.
(If there is a tie, break it randomly.)
I Repeat until you have a Hamilton circuit.
I Make sure you add exactly two edges at each vertex.
I Don’t close the circuit until all vertices are in it.
This is called the Cheapest-Link Algorithm, or CLA.Here is an example.
![Page 19: The Traveling Salesman Problemjlmartin/courses/math105-F11/... · 2018. 8. 14. · The Traveling Salesman Problem De nition: A complete graph K N is a graph with N vertices and an](https://reader033.vdocuments.site/reader033/viewer/2022051906/5ff9744006e1a927894fa751/html5/thumbnails/19.jpg)
The Cheapest-Link Algorithm
Idea: Start in the middle.
I Add the cheapest available edge to your tour.
(If there is a tie, break it randomly.)
I Repeat until you have a Hamilton circuit.
I Make sure you add exactly two edges at each vertex.
I Don’t close the circuit until all vertices are in it.
This is called the Cheapest-Link Algorithm, or CLA.Here is an example.
![Page 20: The Traveling Salesman Problemjlmartin/courses/math105-F11/... · 2018. 8. 14. · The Traveling Salesman Problem De nition: A complete graph K N is a graph with N vertices and an](https://reader033.vdocuments.site/reader033/viewer/2022051906/5ff9744006e1a927894fa751/html5/thumbnails/20.jpg)
The Cheapest-Link Algorithm
Idea: Start in the middle.
I Add the cheapest available edge to your tour.
(If there is a tie, break it randomly.)
I Repeat until you have a Hamilton circuit.
I Make sure you add exactly two edges at each vertex.
I Don’t close the circuit until all vertices are in it.
This is called the Cheapest-Link Algorithm, or CLA.Here is an example.
![Page 21: The Traveling Salesman Problemjlmartin/courses/math105-F11/... · 2018. 8. 14. · The Traveling Salesman Problem De nition: A complete graph K N is a graph with N vertices and an](https://reader033.vdocuments.site/reader033/viewer/2022051906/5ff9744006e1a927894fa751/html5/thumbnails/21.jpg)
The Cheapest-Link Algorithm
Idea: Start in the middle.
I Add the cheapest available edge to your tour.
(If there is a tie, break it randomly.)
I Repeat until you have a Hamilton circuit.
I Make sure you add exactly two edges at each vertex.
I Don’t close the circuit until all vertices are in it.
This is called the Cheapest-Link Algorithm, or CLA.Here is an example.
![Page 22: The Traveling Salesman Problemjlmartin/courses/math105-F11/... · 2018. 8. 14. · The Traveling Salesman Problem De nition: A complete graph K N is a graph with N vertices and an](https://reader033.vdocuments.site/reader033/viewer/2022051906/5ff9744006e1a927894fa751/html5/thumbnails/22.jpg)
The Cheapest-Link Algorithm
Idea: Start in the middle.
I Add the cheapest available edge to your tour.
(If there is a tie, break it randomly.)
I Repeat until you have a Hamilton circuit.
I Make sure you add exactly two edges at each vertex.
I Don’t close the circuit until all vertices are in it.
This is called the Cheapest-Link Algorithm, or CLA.Here is an example.
![Page 23: The Traveling Salesman Problemjlmartin/courses/math105-F11/... · 2018. 8. 14. · The Traveling Salesman Problem De nition: A complete graph K N is a graph with N vertices and an](https://reader033.vdocuments.site/reader033/viewer/2022051906/5ff9744006e1a927894fa751/html5/thumbnails/23.jpg)
12 10
8
7 20
3
62
4
19B C
A
ED
Example 1
![Page 24: The Traveling Salesman Problemjlmartin/courses/math105-F11/... · 2018. 8. 14. · The Traveling Salesman Problem De nition: A complete graph K N is a graph with N vertices and an](https://reader033.vdocuments.site/reader033/viewer/2022051906/5ff9744006e1a927894fa751/html5/thumbnails/24.jpg)
Results of Example 1
I Output of RNNA: BEDCAB (weight 34)
I Output of CLA: ACBEDA (weight 38)
I In this example, RNNA produces a better result.
I In fact, neither of these Hamilton circuits is optimal – theoptimal one is EACBDE (weight 32).
![Page 25: The Traveling Salesman Problemjlmartin/courses/math105-F11/... · 2018. 8. 14. · The Traveling Salesman Problem De nition: A complete graph K N is a graph with N vertices and an](https://reader033.vdocuments.site/reader033/viewer/2022051906/5ff9744006e1a927894fa751/html5/thumbnails/25.jpg)
Results of Example 1
I Output of RNNA: BEDCAB (weight 34)
I Output of CLA: ACBEDA (weight 38)
I In this example, RNNA produces a better result.
I In fact, neither of these Hamilton circuits is optimal – theoptimal one is EACBDE (weight 32).
![Page 26: The Traveling Salesman Problemjlmartin/courses/math105-F11/... · 2018. 8. 14. · The Traveling Salesman Problem De nition: A complete graph K N is a graph with N vertices and an](https://reader033.vdocuments.site/reader033/viewer/2022051906/5ff9744006e1a927894fa751/html5/thumbnails/26.jpg)
14 15
9
5 10
18
1913
12
4B C
A
ED
Example 2
![Page 27: The Traveling Salesman Problemjlmartin/courses/math105-F11/... · 2018. 8. 14. · The Traveling Salesman Problem De nition: A complete graph K N is a graph with N vertices and an](https://reader033.vdocuments.site/reader033/viewer/2022051906/5ff9744006e1a927894fa751/html5/thumbnails/27.jpg)
Results of Example 2
I RNNA and CLA both output DAECBD (weight 46)
I This happens to be an optimal Hamilton circuit.
![Page 28: The Traveling Salesman Problemjlmartin/courses/math105-F11/... · 2018. 8. 14. · The Traveling Salesman Problem De nition: A complete graph K N is a graph with N vertices and an](https://reader033.vdocuments.site/reader033/viewer/2022051906/5ff9744006e1a927894fa751/html5/thumbnails/28.jpg)
5 7
10
3 10
2
53
4
7B C
A
ED
Example 3
![Page 29: The Traveling Salesman Problemjlmartin/courses/math105-F11/... · 2018. 8. 14. · The Traveling Salesman Problem De nition: A complete graph K N is a graph with N vertices and an](https://reader033.vdocuments.site/reader033/viewer/2022051906/5ff9744006e1a927894fa751/html5/thumbnails/29.jpg)
Results of Example 3
I Here, the output of both the CLA and the RNNA maydepend on how you break ties. (There’s no way to knowin advance.)
![Page 30: The Traveling Salesman Problemjlmartin/courses/math105-F11/... · 2018. 8. 14. · The Traveling Salesman Problem De nition: A complete graph K N is a graph with N vertices and an](https://reader033.vdocuments.site/reader033/viewer/2022051906/5ff9744006e1a927894fa751/html5/thumbnails/30.jpg)
12
29
23
16
5
3
19
25
21
2428
64
13
22
A
C D
E F
BExample 4
![Page 31: The Traveling Salesman Problemjlmartin/courses/math105-F11/... · 2018. 8. 14. · The Traveling Salesman Problem De nition: A complete graph K N is a graph with N vertices and an](https://reader033.vdocuments.site/reader033/viewer/2022051906/5ff9744006e1a927894fa751/html5/thumbnails/31.jpg)
Distance table for Example 4
A B C D E F
A 12 29 22 13 24B 12 19 3 25 6C 29 19 21 23 28D 22 3 21 4 5E 13 25 23 4 16F 24 6 28 5 16
![Page 32: The Traveling Salesman Problemjlmartin/courses/math105-F11/... · 2018. 8. 14. · The Traveling Salesman Problem De nition: A complete graph K N is a graph with N vertices and an](https://reader033.vdocuments.site/reader033/viewer/2022051906/5ff9744006e1a927894fa751/html5/thumbnails/32.jpg)
Results of Example 4
I Output of RNNA: FDBAECF (weight 84)
I Output of CLA: ACFBDEA (weight 83)
I In this example, CLA produces a better result.
I Neither of these Hamilton circuits is optimal – theoptimal one is FBCAEDF (weight 76).
![Page 33: The Traveling Salesman Problemjlmartin/courses/math105-F11/... · 2018. 8. 14. · The Traveling Salesman Problem De nition: A complete graph K N is a graph with N vertices and an](https://reader033.vdocuments.site/reader033/viewer/2022051906/5ff9744006e1a927894fa751/html5/thumbnails/33.jpg)
Results of Example 4
I Output of RNNA: FDBAECF (weight 84)
I Output of CLA: ACFBDEA (weight 83)
I In this example, CLA produces a better result.
I Neither of these Hamilton circuits is optimal – theoptimal one is FBCAEDF (weight 76).
![Page 34: The Traveling Salesman Problemjlmartin/courses/math105-F11/... · 2018. 8. 14. · The Traveling Salesman Problem De nition: A complete graph K N is a graph with N vertices and an](https://reader033.vdocuments.site/reader033/viewer/2022051906/5ff9744006e1a927894fa751/html5/thumbnails/34.jpg)
17
15
12 14
18 29
Example 5 A
B C
D
![Page 35: The Traveling Salesman Problemjlmartin/courses/math105-F11/... · 2018. 8. 14. · The Traveling Salesman Problem De nition: A complete graph K N is a graph with N vertices and an](https://reader033.vdocuments.site/reader033/viewer/2022051906/5ff9744006e1a927894fa751/html5/thumbnails/35.jpg)
Results of Example 5
Algorithm Output Weight
NNA (A) ABCDA 12 + 15 + 29 + 17 = 73NNA (B) BACDB 12 + 14 + 29 + 18 = 73NNA (C) CABDC = BACDBNNA (D) DABCD = ABCDA
CLA ABCDA
I The only other Hamilton circuit in K4 is ACBDA, whichhas weight 14 + 15 + 18 + 17 = 64.
I So both RNNA and CLA give worst possible answers!
![Page 36: The Traveling Salesman Problemjlmartin/courses/math105-F11/... · 2018. 8. 14. · The Traveling Salesman Problem De nition: A complete graph K N is a graph with N vertices and an](https://reader033.vdocuments.site/reader033/viewer/2022051906/5ff9744006e1a927894fa751/html5/thumbnails/36.jpg)
Results of Example 5
Algorithm Output Weight
NNA (A) ABCDA 12 + 15 + 29 + 17 = 73NNA (B) BACDB 12 + 14 + 29 + 18 = 73NNA (C) CABDC = BACDBNNA (D) DABCD = ABCDA
CLA ABCDA
I The only other Hamilton circuit in K4 is ACBDA, whichhas weight 14 + 15 + 18 + 17 = 64.
I So both RNNA and CLA give worst possible answers!
![Page 37: The Traveling Salesman Problemjlmartin/courses/math105-F11/... · 2018. 8. 14. · The Traveling Salesman Problem De nition: A complete graph K N is a graph with N vertices and an](https://reader033.vdocuments.site/reader033/viewer/2022051906/5ff9744006e1a927894fa751/html5/thumbnails/37.jpg)
Results of Example 5
Algorithm Output Weight
NNA (A) ABCDA 12 + 15 + 29 + 17 = 73NNA (B) BACDB 12 + 14 + 29 + 18 = 73NNA (C) CABDC = BACDBNNA (D) DABCD = ABCDA
CLA ABCDA
I The only other Hamilton circuit in K4 is ACBDA, whichhas weight 14 + 15 + 18 + 17 = 64.
I So both RNNA and CLA give worst possible answers!
![Page 38: The Traveling Salesman Problemjlmartin/courses/math105-F11/... · 2018. 8. 14. · The Traveling Salesman Problem De nition: A complete graph K N is a graph with N vertices and an](https://reader033.vdocuments.site/reader033/viewer/2022051906/5ff9744006e1a927894fa751/html5/thumbnails/38.jpg)
The Bad News
There is no known algorithm to solve theTSP that is both optimal and efficient.
I Brute-force is optimal but not efficient.
I NNA, RNNA, and CLA are all efficient but not optimal.
![Page 39: The Traveling Salesman Problemjlmartin/courses/math105-F11/... · 2018. 8. 14. · The Traveling Salesman Problem De nition: A complete graph K N is a graph with N vertices and an](https://reader033.vdocuments.site/reader033/viewer/2022051906/5ff9744006e1a927894fa751/html5/thumbnails/39.jpg)
The Bad News
There is no known algorithm to solve theTSP that is both optimal and efficient.
I Brute-force is optimal but not efficient.
I NNA, RNNA, and CLA are all efficient but not optimal.