1 / 36

Section 14.3 Hamilton Paths, and Hamilton Circuits

Section 14.3 Hamilton Paths, and Hamilton Circuits. What You Will Learn. Hamilton Paths Hamilton Circuits Complete Graphs Traveling Salesman Problems. Hamilton Paths. A Hamilton path is a path that contains each vertex of a graph exactly once. Hamilton Paths.

hugginss
Download Presentation

Section 14.3 Hamilton Paths, and Hamilton Circuits

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. Section 14.3Hamilton Paths, and Hamilton Circuits

  2. What You Will Learn • Hamilton Paths • Hamilton Circuits • Complete Graphs • Traveling Salesman Problems

  3. Hamilton Paths • A Hamilton path is a path that contains each vertex of a graph exactly once.

  4. Hamilton Paths • The graph shown has Hamilton path A, B, C, E, D. The graph also has Hamilton path C, B, A, D, E. Can you find some others?

  5. Hamilton Paths • The graph shown has Hamilton path A, B, C, F, H, E, G, D. The graph also has Hamilton path G, D, E, H, F, C, B, A. Can you find • some others?

  6. Hamilton Circuits • A Hamilton circuit is a path that begins and ends at the same vertex and passes through all other vertices of the graph exactly one time.

  7. Hamilton Circuits • The graph shown has Hamilton circuit A, B, C, E, D,A. Can you find another?

  8. Hamilton Circuits • The graph shown has Hamilton circuit A, B, D, G, E, H, F, C, A. • A Hamilton circuit • starts and ends at • the same vertex.

  9. Complete Graph • A complete graph is a graph that has an edge between each pair of its vertices.

  10. Example 2: Finding Hamilton Circuits • Determine a Hamilton circuit for the complete graph shown. • Solution • One is: • A, B, C, D, E, A • There are many more.

  11. Number of Unique Hamilton Circuits in a Complete Graph • The number of unique Hamilton circuits in a complete graph with n vertices is (n– 1)! , where (n – 1)! = (n – 1)(n – 2)(n – 3)…(3)(2)(1)

  12. Example 4: American Idol Travel • Steven Tyler, Jennifer Lopez, and Randy Jackson, the judges for the television show American Idol, are in Hollywood (H). They need to travel to the following cities to judge contestants’ auditions: San Antonio (SA), East Rutherford (ER), Birmingham (B), Memphis (M), and Seattle (S). In how many different ways can Steven, Jennifer, and Randy, traveling together, visit each of these cities and return to Hollywood?

  13. Example 4: American Idol Travel • Solution • Represent this problem with the complete graph. • 6 vertices representthe 6 locations. • Edges represent theone-way flightsbetween theselocations.

  14. Example 4: American Idol Travel • Solution • Determine the number of Hamilton circuits. • There are (6 – 1)!= 5! = 5•4•3•2•1 • = 120 differentHamilton circuits. • There are 120 waysto start in Hollywood,visit the 5 cities andreturn to Hollywood.

  15. Traveling Salesman Problems • Complete graphs can represent cities and the process of traveling between these cities. • Our goal in a traveling salesman problem is to find the least expensive or shortest way to visit each city once and return home. • In terms of graph theory, our goal is to find the Hamilton circuit with the lowest associated cost or distance.

  16. Traveling Salesman Problems • The Hamilton circuit with the lowest associated cost (or shortest distance, etc.) is called the optimal solution. • We will discuss two methods, the brute force method and the nearest neighbor method, for determining the optimal solution. • A complete, weighted graph is a complete graph with the weights (or numbers) listed on the edges.

  17. The Brute Force Method of Solving Traveling Salesman Problems • To determine the optimal solution: 1. Represent the problem with a complete, weighted graph. 2. List all possible Hamilton circuits for this graph. 3. Determine the cost (or distance) associated with each of these Hamilton circuits. 4. The Hamilton circuit with the lowest cost (or shortest distance) is the optimal solution.

  18. Example 5: Using the Brute Force Method • Julienne Ward is the Southeast District Sales Director for Addison Wesley. On the next slide is a complete, weighted graph, whose numbers represent one-way fares, in dollars, between the cities. We want to use the brute force method to determine the optimal solution for Julienne to visit her regional sales offices.

  19. Example 5: Using the Brute Force Method • She will start in Orlando (O); visit offices in Atlanta (A), Memphis (M), and New Orleans (N); and then return to Orlando.

  20. Example 5: Using the Brute Force Method • Solution • There are (4 – 1)! = 3! = 6 possible unique Hamilton circuits we need to examine for costs. • We list theseHamilton circuitsin the table on thenext slide.

  21. Example 5: Using the Brute Force Method

  22. Example 5: Using the Brute Force Method • Solution • Hamilton circuits in column 1. • Columns 2 – 5 contain the cost associated with each leg of the circuit. • Last column contains the total cost of travel using the given circuit. • Two circuits have the lowest cost, $289. • These two Hamilton circuits are shown on the maps on the next slide.

  23. Example 5: Using the Brute Force Method

  24. Example 5: Using the Brute Force Method • Solution • The second circuit is the exact reverse order of the first circuit. • Although these are different circuits, the cost is the same regardless of the direction flown. • Either circuit provides Julienne with the least expensive way to visit each of her regional sales offices.

  25. Nearest Neighbor Method • Now we introduce a method for finding an approximate solution to a traveling salesman problem. • Approximate solutions can be used in cases where determining the optimal solution is not reasonable. • One method for finding an approximate solution is the nearest neighbor method.

  26. Nearest Neighbor Method of Determining an Approximate Solution to a Traveling Salesman Problem • To approximate a optimal solution: 1. Represent the problem with a complete, weighted graph. 2. Identify the starting vertex.

  27. Nearest Neighbor Method of Determining an Approximate Solution to a Traveling Salesman Problem 3. Of all the edges attached to the starting vertex, choose the edge that has the smallest weight. This edge is generally either the shortest distance or the lowest cost. Travel along this edge to the second vertex.

  28. Nearest Neighbor Method of Determining an Approximate Solution to a Traveling Salesman Problem 4. At the second vertex, choose the edge that has the smallest weight that does not lead to a vertex already visited. Travel along this edge to the third vertex.

  29. Nearest Neighbor Method of Determining an Approximate Solution to a Traveling Salesman Problem 5. Continue this process, each time moving along the edge with the smallest weight until all vertices are visited. 6. Travel back to the original vertex.

  30. Example 6: Using the Nearest Neighbor Method • In Example 4, we discussed the American Idol judges’ plan to visit five cities in which auditions would take place and then return to Hollywood. Use the nearest neighbor method to determine an approximate solution for the judges’ visits. The one-way per person flight prices between cities are given in the table on the next slide.

  31. Example 6: Using the Nearest Neighbor Method

  32. Example 6: Using the Nearest Neighbor Method • Solution • Here’s the complete, • weighted graph. • Start at H, go to S. • From S, go to SA. • From SA, go to B. • From B, go to ER. • From ER, go to M. • From M, go to H.

  33. Example 6: Using the Nearest Neighbor Method • Solution • H to S, $108 • S to SA, $119 • SA to B, $274 • B to ER, $258 • ER to M, $104 • M to H, $144 • Total cost is $1007.

  34. Example 6: Using the Nearest Neighbor Method • Solution • For comparison, here are 4 randomly chosen Hamilton circuits with costs.

  35. Example 6: Using the Nearest Neighbor Method • Solution • From the table, we see that the Hamilton circuit H, ER, M, B, S, SA, H results in a per person cost of $965, which is less than the $1007. • Thus, we see that the nearest neighbor method does not always produce the optimal solution.

  36. Example 6: Using the Nearest Neighbor Method • Solution • The nearest neighbor method produces an approximation for the optimal solution. • Without using the brute force method, we cannot determine if the Hamilton circuit H, ER, M, B, S, SA, H is the optimal solution.

More Related