Presentation is loading. Please wait.

Presentation is loading. Please wait.

Graph Theory Hamilton Paths Hamilton Circuits and.

Similar presentations


Presentation on theme: "Graph Theory Hamilton Paths Hamilton Circuits and."— Presentation transcript:

1 Graph Theory Hamilton Paths Hamilton Circuits and

2 Hamilton Paths & Circuits A Hamilton path is a path that contains each vertex of a graph exactly once. A Hamilton circuit is a path that begins and ends at the same vertex and passes through all other vertices of a graph exactly one time.

3 Hamilton Paths & Circuits Ex) Find two different Hamilton paths. AEFBCGD EABFCGD Remember: Hamilton paths do not have to touch every edge; just every vertex.

4 Hamilton Paths & Circuits Ex) Find two different Hamilton Circuits FBCADEGF Remember: Circuits start and end at the same vertex. FGEDACBF Notice the two circuits go in opposite directions. If we simply change the starting point and follow the same path, it is not considered a different circuit. Circuit ACBFGEDA is considered the same as the circuit we just completed, FGEDACBF.

5 Hamilton Paths & Circuits Complete Graphs A complete graph is a graph that has an edge between each pair of vertices. Notice that for a complete graph with n vertices, each vertex has degree n-1.

6 Hamilton Paths & Circuits Ex)Draw a complete graph with six vertices. A F E D C B Start at one vertex and be sure it connects to every other vertex by one edge. Move to the next vertex and be sure it connects to every other vertex. Continue this until you reach the last vertex. When you reach the last vertex, it should already be connected to the others. Be sure that the degree of each vertex is 5. The degree of each vertex should always be one less than the number of vertices.

7 Hamilton Paths & Circuits Counting the number of Unique Hamilton Circuits in a Complete Graph. (using Factorials) The number of unique Hamilton circuits in a complete graph with n vertices is (n - 1)!

8 Hamilton Paths & Circuits Determine the number of unique Hamilton circuits for the following graph. A B C Three vertices  n=3 (n - 1)! = (3 – 1)! = 2! = (2)(1) = 2 unique circuits With only three vertices, it is easy to see that there are only two possible circuits. One rotates around the graph clockwise and the other counterclockwise.

9 Hamilton Paths & Circuits A C B D Determine the number of unique Hamilton circuits for the following graph. Four vertices  n=4 (n - 1)! = (4 – 1)! = 3! = (3)(2)(1) = 6 unique circuits It will take a bit of work, but we can list all 6 unique circuits here ABCDA ( around the perimeter) ACDBA ( using top and bottom) ADBCA (using the sides ) If we reverse the direction of these three circuits, we find the remaining three. Six unique circuits in all. ADCBA ABDCA ACBDA

10 Hamilton Paths & Circuits A C B D E Determine the number of unique Hamilton circuits for the following graph. Five vertices  n=5 (n - 1)! = (5 – 1)! = 4! = (4)(3)(2)(1) = 24 unique circuits It becomes a bit taxing to list all 24 circuits here, but it can be done.

11 Hamilton Paths & Circuits Milk Truck Route: Nick Grzela is a milk truck driver for English High Farms Cooperative in eastern Massachusetts. Nick has to start at the processing plant and pick up milk on 6 different farms. In how many ways can Nick visit each farm and return to the processing plant? 6 farms + 1 processing plant n = 7 (7-1)! = 6! =(6)(5)(4)(3)(2)(1) = 720 routes

12 Hamilton Paths & Circuits Weighted Graphs A weighted graph is a graph that contains weights (or numbers) listed on each edge. (Each edge is given a value, or cost.) Weighted graphs help us solve traveling salesman problems.

13 Hamilton Paths & Circuits Traveling Salesman Problems A salesman from Bakersville must make visits to clients in Dover, Centertown, and Adams before returning home. To save on mileage, he would like to take the shortest route on these sales visits. What is the shortest route he can take? Note: A “traveling salesman problem” does not always involve a traveling salesman. It is a name for a problem where the goal is to optimize a route where the beginning and the ending of the route must be the same location.

14 Hamilton Paths & Circuits Below is a table of values which is used to make a complete weighted graph to describe the problem.

15 Hamilton Paths & Circuits We will explore two different methods for solving a traveling salesman problem. 1.The Brute Force Method 2.The Nearest Neighbor Method

16


Download ppt "Graph Theory Hamilton Paths Hamilton Circuits and."

Similar presentations


Ads by Google