Presentation is loading. Please wait.

Presentation is loading. Please wait.

Traveling Salesman Problems Nearest Neighbor Method

Similar presentations


Presentation on theme: "Traveling Salesman Problems Nearest Neighbor Method"— Presentation transcript:

1 Traveling Salesman Problems Nearest Neighbor Method
Graph Theory Traveling Salesman Problems Nearest Neighbor Method

2 Hamilton Paths & Circuits Nearest Neighbor Method
T. Serino Hamilton Paths & Circuits Using the Nearest Neighbor Method to solve a traveling salesman problem.

3 Hamilton Paths & Circuits
T. Serino Hamilton Paths & Circuits The brute force method becomes very taxing as your problems contain more and more vertices. The Nearest Neighbor Method will come to an approximate solution much faster, but using the nearest neighbor method may not yield the true optimal circuit. For a true optimal solution, brute force method must be used.

4 Hamilton Paths & Circuits
T. Serino Hamilton Paths & Circuits Steps: (to find an approximate solution to a traveling salesman problem) 1.  Represent the problem with a complete weighted graph. 2.  Identify the starting vertex. 3.  Travel along the least expensive (or shortest) path to the  next vertex. Circle the cost. 4.  Repeat step 3 without returning to a vertex for a second  time until you have visited all vertices and finally  returned to the starting vertex.

5 Hamilton Paths & Circuits
T. Serino Hamilton Paths & Circuits Example: Starting at vertex J, use the nearest neighbor method to approximate the optimal circuit in the traveling salesman problem described by the following graph. The only vertex left is K. So our last path is to K and then back home to vertex J. Circle the corresponding costs. Edge LM is less expensive with a cost of 12. Circle the 12 and move on to vertex M. Start Starting at vertex J, we have three choices of which vertex to travel to first. From vertex L, we have only two choices remaining. The solution circuit is JLMKJ which costs = 45 Of the three choices, edge JL is the least expensive with a cost of 8. Circle the number 8 and move to the next vertex, L.

6 Hamilton Paths & Circuits
T. Serino Hamilton Paths & Circuits Try this: Starting at vertex a, use the nearest neighbor method to approximate the optimal circuit in the traveling salesman problem described by the following graph. Do not go on until you have competed the problem on your own. Do NOT go on until you have completed the problem!

7 Hamilton Paths & Circuits
T. Serino Hamilton Paths & Circuits 75 50 75 50 + 125 375 The optimal circuit is AEDBCA. The optimal cost is 375.

8 athematical M D ecision aking


Download ppt "Traveling Salesman Problems Nearest Neighbor Method"

Similar presentations


Ads by Google