1 / 18

§ 6.3-6.4 Traveling-Salesman Problems; Simple Strategies to Solve TSPs

§ 6.3-6.4 Traveling-Salesman Problems; Simple Strategies to Solve TSPs.

herb
Download Presentation

§ 6.3-6.4 Traveling-Salesman Problems; Simple Strategies to Solve TSPs

An Image/Link below is provided (as is) to download presentation Download Policy: Content on the Website is provided to you AS IS for your information and personal use and may not be sold / licensed / shared on other websites without getting consent from its author. Content is provided to you AS IS for your information and personal use only. Download presentation by click this link. While downloading, if for some reason you are not able to download a presentation, the publisher may have deleted the file from their server. During download, if you can't get a presentation, the file might be deleted by the publisher.

E N D

Presentation Transcript


  1. § 6.3-6.4 Traveling-Salesman Problems; Simple Strategies to Solve TSPs

  2. Example (D`oh!): We all know that Homer is lazy. However, he has to run errands at the Kwik-E-Mart, the Retirement Home and Moe`s. Assuming that he wants to begin and end his day at home find the route that will allow him to get back to napping as soon as possible.

  3. We might represent this dilemma with the following graph: D 8 A 17 12 15 20 B C 20

  4. We might represent this dilemma with the following graph: D 8 A These numbers will represent the number of blocks between each destination. When we place values like this on the edges of a graph we refer to them as the weights of the edges. 17 12 15 27 B C 20

  5. One solution might begin as follows: D 8 A 17 12 15 20 B C 20

  6. . . . And continue like so. . . D 8 A 17 12 15 20 B C 20

  7. . . . And so on . . . D 8 A 17 12 15 20 B C 20

  8. . . . Continuing until he arrives back at home. D 8 A 17 12 15 20 B C 20

  9. Following this circuit, we find that Homer has to travel 12 + 8 + 20 + 17 = 57 blocks to finish his errands and get back to napping. • But is this the most efficient route he can take? • How might we find this best route?

  10. `Method 1` Make a list of all possible Hamiltonian circuits. Calculate the `cost` for each one. Select the circuit with the least cost.

  11. `Method 1` Make a list of all possible Hamiltonian circuits. Calculate the `cost` for each one. Select the circuit with the least cost.

  12. `Method 1` Make a list of all possible Hamiltonian circuits. Calculate the `cost` for each one. Select the circuit with the least cost. We can see that the first route was indeed the most efficient--Homer can get back to his nap after traveling only 57 blocks. Woo Hoo!

  13. Example: The Galactica needs to survey a set of planets (A, B, C, D, E, F, G) in order to find water for the Fleet. the Commander has asked the helm to chart the course that will use the lowest amount of tylium fuel.

  14. Again, we can model this situation using a graph like the one on the screen to the right. B • this time, however, it is incredibly difficult to list all the possible paths, so the ‘homer’ method (I.e. Method I( is not a good choice here. • in fact, even listing the weight of each edge on the graph is hard given the number of vertices. • so, the first thing we will do is list the weights in a table. . . 75 30 60 65 50 A C 28 28 48 22 35 40 35 50 29 G D 30 15 32 20 13 80 40 F E

  15. THE FOLLOWING TABLE TELLS US HOW MANY TONS OF TYLIUM IT TAKES TO TRAVEL FROM ONE PLANET TO ANOTHER:

  16. THE FOLLOWING TABLE TELLS US HOW MANY TONS OF TYLIUM IT TAKES TO TRAVEL FROM ONE PLANET TO ANOTHER: METHOD I IS IMPRACTICAL HERE (WE HAVE(7-1)!=6!=720POSSIBLE HAMILTONIAN CIRCUITS!) SO WHAT CAN WE DO IN THIS CASE?

  17. THE FOLLOWING TABLE TELLS US HOW MANY TONS OF TYLIUM IT TAKES TO TRAVEL FROM ONE PLANET TO ANOTHER: LET’S TRY THE FOLLOWING: METHOD 2START AT VERTEX A. FROM THERE, GO TO THE VERTEX WHICH COSTS THE LEAST TO GET TO. KEEP GOING TO THE ‘CHEAPEST’ VERTEX UNTIL YOU GET BACK TO A.

  18. THIS METHOD MAY NOT GIVE US THE MOST EFFICIENT ROUTE, BUT IN GENERAL IT GETS US CLOSE. THEREFORE, WE USE IT WHEN COMPUTING THE COST OF ALL THE POSSIBLE CIRCUITS IS IMPRACTICAL. WE WILL FORMALIZE THESE METHODS AND A VARIATION ON THE SECOND ONE TOMORROW. . .

More Related