spring 2015 mathematics in management science traveling salesman problem approximate solutions for...
TRANSCRIPT
![Page 1: Spring 2015 Mathematics in Management Science Traveling Salesman Problem Approximate solutions for TSP NNA, RNN, SEA Greedy Heuristic Algorithms](https://reader035.vdocument.in/reader035/viewer/2022062719/56649ed05503460f94bddce5/html5/thumbnails/1.jpg)
Spring 2015Mathematics in
Management Science
Traveling Salesman Problem
Approximate solutions for TSPNNA, RNN, SEA
Greedy Heuristic Algorithms
![Page 2: Spring 2015 Mathematics in Management Science Traveling Salesman Problem Approximate solutions for TSP NNA, RNN, SEA Greedy Heuristic Algorithms](https://reader035.vdocument.in/reader035/viewer/2022062719/56649ed05503460f94bddce5/html5/thumbnails/2.jpg)
Traveling Salesman Problem
Given a complete weighted graph, find a minimum weight Hamilton circuit.
A Hamilton circuit visits each vertex exactly once.
A complete graph has one edge btwn each pair of vtxs.
A weighted graph has a weight (cost) for each edge.
![Page 3: Spring 2015 Mathematics in Management Science Traveling Salesman Problem Approximate solutions for TSP NNA, RNN, SEA Greedy Heuristic Algorithms](https://reader035.vdocument.in/reader035/viewer/2022062719/56649ed05503460f94bddce5/html5/thumbnails/3.jpg)
Solving a TSP
Brute Force Algorithm – exhaustive search
Nearest Neighbor Algorithm
Repetitive Nearest Neighbor Algorithm
Sorted Edges Algorithm
![Page 4: Spring 2015 Mathematics in Management Science Traveling Salesman Problem Approximate solutions for TSP NNA, RNN, SEA Greedy Heuristic Algorithms](https://reader035.vdocument.in/reader035/viewer/2022062719/56649ed05503460f94bddce5/html5/thumbnails/4.jpg)
Counting Hamilton Circuits
The complete graph KN with N vertices has (N – 1)!/2 distinct Hamilton circuits.
Here (N – 1)!/2 =(N-1)x(N-2)x···3x2x1.
For N=30, the number of HCs is4,420,880,996,869,850,977,271,808, 000,000 .
Generating 1 million HCs per second, say, it would take over 10 billion years to generate all of them.
The BFA will take a loooong time to finish.
![Page 5: Spring 2015 Mathematics in Management Science Traveling Salesman Problem Approximate solutions for TSP NNA, RNN, SEA Greedy Heuristic Algorithms](https://reader035.vdocument.in/reader035/viewer/2022062719/56649ed05503460f94bddce5/html5/thumbnails/5.jpg)
Approximate Solutions
Number of HCs in even modest sized problems is so large that we cannot examine them all to find exact solutions by brute force.
Instead we must rely on fast algorithms that find approximate solutions.
NNA, RRN, SEA
![Page 6: Spring 2015 Mathematics in Management Science Traveling Salesman Problem Approximate solutions for TSP NNA, RNN, SEA Greedy Heuristic Algorithms](https://reader035.vdocument.in/reader035/viewer/2022062719/56649ed05503460f94bddce5/html5/thumbnails/6.jpg)
Go Cheap – NNA
Start from the home city.
Go to the city that is the cheapest to get to. Repeat this.
From each new city go to the next city that is the cheapest to get to.
When there are no more new cities to go to, go back home
![Page 7: Spring 2015 Mathematics in Management Science Traveling Salesman Problem Approximate solutions for TSP NNA, RNN, SEA Greedy Heuristic Algorithms](https://reader035.vdocument.in/reader035/viewer/2022062719/56649ed05503460f94bddce5/html5/thumbnails/7.jpg)
Nearest Neighbor Algorithm
From a vertex, go to nearest vertex not already visited. Repeat until no more new vtxs; then go home.
An example of a greedy algorithm:– doesn’t look at the “big picture”,– goes for immediate/short-term gains– can paint itself into a corner and be
forced to accept a bad solution
![Page 8: Spring 2015 Mathematics in Management Science Traveling Salesman Problem Approximate solutions for TSP NNA, RNN, SEA Greedy Heuristic Algorithms](https://reader035.vdocument.in/reader035/viewer/2022062719/56649ed05503460f94bddce5/html5/thumbnails/8.jpg)
From Chicago, find shortest route that visits each of Minneapolis, St. Louis, and Cleveland, and returns to Chicago.
![Page 9: Spring 2015 Mathematics in Management Science Traveling Salesman Problem Approximate solutions for TSP NNA, RNN, SEA Greedy Heuristic Algorithms](https://reader035.vdocument.in/reader035/viewer/2022062719/56649ed05503460f94bddce5/html5/thumbnails/9.jpg)
Repetitive Nearest Neighbor
Do NNA with each vertex of the graph as the starting vertex.
Of all the circuits obtained, keep the best one.
If there is a designated starting vertex, rewrite this best circuit using that vertex as the reference point.
![Page 10: Spring 2015 Mathematics in Management Science Traveling Salesman Problem Approximate solutions for TSP NNA, RNN, SEA Greedy Heuristic Algorithms](https://reader035.vdocument.in/reader035/viewer/2022062719/56649ed05503460f94bddce5/html5/thumbnails/10.jpg)
From Chicago, find shortest route that visits each of Minneapolis, St. Louis, and Cleveland, and returns to Chicago.
![Page 11: Spring 2015 Mathematics in Management Science Traveling Salesman Problem Approximate solutions for TSP NNA, RNN, SEA Greedy Heuristic Algorithms](https://reader035.vdocument.in/reader035/viewer/2022062719/56649ed05503460f94bddce5/html5/thumbnails/11.jpg)
![Page 12: Spring 2015 Mathematics in Management Science Traveling Salesman Problem Approximate solutions for TSP NNA, RNN, SEA Greedy Heuristic Algorithms](https://reader035.vdocument.in/reader035/viewer/2022062719/56649ed05503460f94bddce5/html5/thumbnails/12.jpg)
Sorted Edges Algorithm
Start with minimum cost edge.
At each stage, use the cheapest (least cost) edge which is OK.
Stop when have an HC.
An edge is NOT OK ifIt closes a circuit that is not an HC, or
It meets a vertex that already has 2 edges which have been chosen.
![Page 13: Spring 2015 Mathematics in Management Science Traveling Salesman Problem Approximate solutions for TSP NNA, RNN, SEA Greedy Heuristic Algorithms](https://reader035.vdocument.in/reader035/viewer/2022062719/56649ed05503460f94bddce5/html5/thumbnails/13.jpg)
Sorted Edges Algorithm
Pick the cheapest link (edge with smallest weight) available.
Continue picking next cheapest link available that does notclose a circuit which is not an HC, norcreate three edges coming out of a single
vertex.
Done when get a Hamilton circuit.
![Page 14: Spring 2015 Mathematics in Management Science Traveling Salesman Problem Approximate solutions for TSP NNA, RNN, SEA Greedy Heuristic Algorithms](https://reader035.vdocument.in/reader035/viewer/2022062719/56649ed05503460f94bddce5/html5/thumbnails/14.jpg)
Sorted Edges Algorithm
Sort edges in order of increasing cost.
Select edges in order from this list to subject to these rules:
never reuse an edge
skip edges that connect to vtx already having two used edges meeting there
skip edges that create “premature” loops, (small circuits in graph that don’t include all vtxs). No circuits created until last edge is added!
![Page 15: Spring 2015 Mathematics in Management Science Traveling Salesman Problem Approximate solutions for TSP NNA, RNN, SEA Greedy Heuristic Algorithms](https://reader035.vdocument.in/reader035/viewer/2022062719/56649ed05503460f94bddce5/html5/thumbnails/15.jpg)
Comparison of Algorithms
Both are approximate; typically give
different approximate solutions; typically neither is the “real” solution.
Neither better than the other.
NNA adds edges in order as you would traverse the circuit.
SEA adds edges “at random” in the graph.
Neither algorithm says what to do in the case of a “tie”.
![Page 16: Spring 2015 Mathematics in Management Science Traveling Salesman Problem Approximate solutions for TSP NNA, RNN, SEA Greedy Heuristic Algorithms](https://reader035.vdocument.in/reader035/viewer/2022062719/56649ed05503460f94bddce5/html5/thumbnails/16.jpg)
![Page 17: Spring 2015 Mathematics in Management Science Traveling Salesman Problem Approximate solutions for TSP NNA, RNN, SEA Greedy Heuristic Algorithms](https://reader035.vdocument.in/reader035/viewer/2022062719/56649ed05503460f94bddce5/html5/thumbnails/17.jpg)
![Page 18: Spring 2015 Mathematics in Management Science Traveling Salesman Problem Approximate solutions for TSP NNA, RNN, SEA Greedy Heuristic Algorithms](https://reader035.vdocument.in/reader035/viewer/2022062719/56649ed05503460f94bddce5/html5/thumbnails/18.jpg)
![Page 19: Spring 2015 Mathematics in Management Science Traveling Salesman Problem Approximate solutions for TSP NNA, RNN, SEA Greedy Heuristic Algorithms](https://reader035.vdocument.in/reader035/viewer/2022062719/56649ed05503460f94bddce5/html5/thumbnails/19.jpg)
![Page 20: Spring 2015 Mathematics in Management Science Traveling Salesman Problem Approximate solutions for TSP NNA, RNN, SEA Greedy Heuristic Algorithms](https://reader035.vdocument.in/reader035/viewer/2022062719/56649ed05503460f94bddce5/html5/thumbnails/20.jpg)
![Page 21: Spring 2015 Mathematics in Management Science Traveling Salesman Problem Approximate solutions for TSP NNA, RNN, SEA Greedy Heuristic Algorithms](https://reader035.vdocument.in/reader035/viewer/2022062719/56649ed05503460f94bddce5/html5/thumbnails/21.jpg)
![Page 22: Spring 2015 Mathematics in Management Science Traveling Salesman Problem Approximate solutions for TSP NNA, RNN, SEA Greedy Heuristic Algorithms](https://reader035.vdocument.in/reader035/viewer/2022062719/56649ed05503460f94bddce5/html5/thumbnails/22.jpg)
![Page 23: Spring 2015 Mathematics in Management Science Traveling Salesman Problem Approximate solutions for TSP NNA, RNN, SEA Greedy Heuristic Algorithms](https://reader035.vdocument.in/reader035/viewer/2022062719/56649ed05503460f94bddce5/html5/thumbnails/23.jpg)
![Page 24: Spring 2015 Mathematics in Management Science Traveling Salesman Problem Approximate solutions for TSP NNA, RNN, SEA Greedy Heuristic Algorithms](https://reader035.vdocument.in/reader035/viewer/2022062719/56649ed05503460f94bddce5/html5/thumbnails/24.jpg)
ExampleFind an approximate solution to the following TSP using the Sorted-Edges Algorithm. A
D C40
BE
90100
10 20
8050 30
60 70
![Page 25: Spring 2015 Mathematics in Management Science Traveling Salesman Problem Approximate solutions for TSP NNA, RNN, SEA Greedy Heuristic Algorithms](https://reader035.vdocument.in/reader035/viewer/2022062719/56649ed05503460f94bddce5/html5/thumbnails/25.jpg)
ExampleFirst (smallest) edge: acceptable.
A
BE
90100
10 20
8050 30
60 70
D C40
![Page 26: Spring 2015 Mathematics in Management Science Traveling Salesman Problem Approximate solutions for TSP NNA, RNN, SEA Greedy Heuristic Algorithms](https://reader035.vdocument.in/reader035/viewer/2022062719/56649ed05503460f94bddce5/html5/thumbnails/26.jpg)
ExampleSecond (next smallest) edge: acceptable.
A
BE
90100
10 20
8050 30
60 70
D C40
![Page 27: Spring 2015 Mathematics in Management Science Traveling Salesman Problem Approximate solutions for TSP NNA, RNN, SEA Greedy Heuristic Algorithms](https://reader035.vdocument.in/reader035/viewer/2022062719/56649ed05503460f94bddce5/html5/thumbnails/27.jpg)
ExampleThird edge: acceptable.
A
BE
90100
8050 30
60 70
2010
D C40
![Page 28: Spring 2015 Mathematics in Management Science Traveling Salesman Problem Approximate solutions for TSP NNA, RNN, SEA Greedy Heuristic Algorithms](https://reader035.vdocument.in/reader035/viewer/2022062719/56649ed05503460f94bddce5/html5/thumbnails/28.jpg)
ExampleFourth edge: reject (creates premature loop; three edges into one vertex)
A
BE
90100
8050 30
60 70
2010
D C40
![Page 29: Spring 2015 Mathematics in Management Science Traveling Salesman Problem Approximate solutions for TSP NNA, RNN, SEA Greedy Heuristic Algorithms](https://reader035.vdocument.in/reader035/viewer/2022062719/56649ed05503460f94bddce5/html5/thumbnails/29.jpg)
ExampleFifth edge: reject (creates premature loop)
A
BE
90100
8050 30
60 70
2010
D C40
![Page 30: Spring 2015 Mathematics in Management Science Traveling Salesman Problem Approximate solutions for TSP NNA, RNN, SEA Greedy Heuristic Algorithms](https://reader035.vdocument.in/reader035/viewer/2022062719/56649ed05503460f94bddce5/html5/thumbnails/30.jpg)
ExampleSixth edge: reject (three edges at one vtx)
A
BE
90100
8050 30
60 70
2010
D C40
![Page 31: Spring 2015 Mathematics in Management Science Traveling Salesman Problem Approximate solutions for TSP NNA, RNN, SEA Greedy Heuristic Algorithms](https://reader035.vdocument.in/reader035/viewer/2022062719/56649ed05503460f94bddce5/html5/thumbnails/31.jpg)
ExampleSeventh edge: acceptable
A
BE
90100
8050 30
60 70
2010
D C40
![Page 32: Spring 2015 Mathematics in Management Science Traveling Salesman Problem Approximate solutions for TSP NNA, RNN, SEA Greedy Heuristic Algorithms](https://reader035.vdocument.in/reader035/viewer/2022062719/56649ed05503460f94bddce5/html5/thumbnails/32.jpg)
ExampleAlready added 4 of 5 edges. Only one possible to close up loop.
A
BE
90100
10 20
8050 30
60 70
D C40
![Page 33: Spring 2015 Mathematics in Management Science Traveling Salesman Problem Approximate solutions for TSP NNA, RNN, SEA Greedy Heuristic Algorithms](https://reader035.vdocument.in/reader035/viewer/2022062719/56649ed05503460f94bddce5/html5/thumbnails/33.jpg)
Example do NNA from BA B
CE
D
600
500
800400
700 650950
850550
750
![Page 34: Spring 2015 Mathematics in Management Science Traveling Salesman Problem Approximate solutions for TSP NNA, RNN, SEA Greedy Heuristic Algorithms](https://reader035.vdocument.in/reader035/viewer/2022062719/56649ed05503460f94bddce5/html5/thumbnails/34.jpg)
![Page 35: Spring 2015 Mathematics in Management Science Traveling Salesman Problem Approximate solutions for TSP NNA, RNN, SEA Greedy Heuristic Algorithms](https://reader035.vdocument.in/reader035/viewer/2022062719/56649ed05503460f94bddce5/html5/thumbnails/35.jpg)
![Page 36: Spring 2015 Mathematics in Management Science Traveling Salesman Problem Approximate solutions for TSP NNA, RNN, SEA Greedy Heuristic Algorithms](https://reader035.vdocument.in/reader035/viewer/2022062719/56649ed05503460f94bddce5/html5/thumbnails/36.jpg)
TSP – Conclusion
How does one find an optimal Hamilton circuit in a complete weighted graph?
NNA & SEA are fairly simple strategies for attacking TSPs, which quickly give good HCs.
The search for an optimal and efficient general algorithm….
![Page 37: Spring 2015 Mathematics in Management Science Traveling Salesman Problem Approximate solutions for TSP NNA, RNN, SEA Greedy Heuristic Algorithms](https://reader035.vdocument.in/reader035/viewer/2022062719/56649ed05503460f94bddce5/html5/thumbnails/37.jpg)