Presentation is loading. Please wait.

Presentation is loading. Please wait.

The travelling salesman problem Finding an upper bound using minimum spanning trees Find a minimum spanning tree using Prim’s algorithm or Kruskal’s algorithm.

Similar presentations


Presentation on theme: "The travelling salesman problem Finding an upper bound using minimum spanning trees Find a minimum spanning tree using Prim’s algorithm or Kruskal’s algorithm."— Presentation transcript:

1 The travelling salesman problem Finding an upper bound using minimum spanning trees Find a minimum spanning tree using Prim’s algorithm or Kruskal’s algorithm. An upper bound to the travelling salesman problem can be found by doubling the length of the minimum spanning tree. A tour can be found by travelling along each arc of the minimum spanning tree in both directions. The upper bound can usually be reduced by using shortcuts.

2 The travelling salesman problem Example Finding an upper bound using minimum spanning trees First, you need to find a minimum spanning tree using Prim’s or Kruskal’s algorithm. A B C D E 3 5 4 2 2 4 6 6 5 5

3 The travelling salesman problem Example Finding an upper bound using minimum spanning trees A B C D E 3 5 4 2 2 4 6 6 5 5 A B C D E 3 5 4 2 2 4 6 6 5 5 Using Prim’s algorithm, starting from vertex A: E can be joined to the tree at either A or B, so there are two different minimum spanning trees.

4 The travelling salesman problem Example Finding an upper bound using minimum spanning trees A B C D E 3 5 4 2 2 4 6 6 5 5 A B C D E 3 5 4 2 2 4 6 6 5 5 The length of the minimum spanning tree is 3 + 2 + 2 + 5 = 12. A tour (starting and ending at the same vertex and visiting every vertex) can be found by travelling along the each arc of the minimum spanning tree twice, once in each direction.

5 The travelling salesman problem Example Finding an upper bound using minimum spanning trees A B C D E 3 5 4 2 2 4 6 6 5 5 A B C D E 3 5 4 2 2 4 6 6 5 5 So an upper bound for the minimum tour length is 2 × 12 = 24.

6 The travelling salesman problem Example Finding an upper bound using minimum spanning trees A B C D E 3 5 4 2 2 4 6 6 5 5 A B C D E 3 5 4 2 2 4 6 6 5 5 The upper bound can usually be reduced by using shortcuts in the tour found from the minimum spanning tree. Using the first minimum spanning tree, the route CBADAE can be replaced by CDE. This gives a tour length of 5 + 3 + 2 + 4 + 6 = 20. 4 6

7 The upper bound can usually be reduced by using shortcuts in the tour found from the minimum spanning tree. The travelling salesman problem Example Finding an upper bound using minimum spanning trees A B C D E 3 5 4 2 2 4 6 6 5 5 A B C D E 3 5 4 2 2 4 6 6 5 5 Using the second minimum spanning tree, the route CBEBAD can be replaced by CED. This gives a tour length of 2 + 3 + 2 + 6 + 6 = 19. 6 6

8 The travelling salesman problem Example Finding an upper bound using minimum spanning trees A B C D E 3 5 4 2 2 4 6 6 5 5 A B C D E 3 5 4 2 2 4 6 6 5 5 The lowest upper bound that we have found using shortcuts is 19. This is by using the tour DABCED.


Download ppt "The travelling salesman problem Finding an upper bound using minimum spanning trees Find a minimum spanning tree using Prim’s algorithm or Kruskal’s algorithm."

Similar presentations


Ads by Google