380 likes | 743 Views
§ 6.1-6.2 Hamiltonian Circuits and Paths; Complete Graphs. A sample-return mission sent to discover signs of microbial life on Mars is scheduled to be launched in 2014. Once the un-manned rover arrives, it will be dispatched to several sites to collect samples and run experiments.
E N D
§ 6.1-6.2 Hamiltonian Circuits and Paths; Complete Graphs • A sample-return mission sent to discover signs of microbial life on Mars is scheduled to be launched in 2014. • Once the un-manned rover arrives, it will be dispatched to several sites to collect samples and run experiments. • The rover will then return to its landing site where a return rocket will bring the samples to Earth.
Suppose that the seven sites marked below have been chosen as the most likely to bear evidence of life. • Assuming that the rover lands at A how might we route it? A B G E C D F
Suppose that the seven sites marked below have been chosen as the most likely to bear evidence of life. • Assuming that the rover lands at A how might we route it? A B G E C D F
Suppose that the seven sites marked below have been chosen as the most likely to bear evidence of life. • Assuming that the rover lands at A how might we route it? A B G E C D F
Suppose that the seven sites marked below have been chosen as the most likely to bear evidence of life. • Assuming that the rover lands at A how might we route it? A B G E C D F
Suppose that the seven sites marked below have been chosen as the most likely to bear evidence of life. • Assuming that the rover lands at A how might we route it? A B G E C D F
Suppose that the seven sites marked below have been chosen as the most likely to bear evidence of life. • Assuming that the rover lands at A how might we route it? A B G E C D F
Suppose that the seven sites marked below have been chosen as the most likely to bear evidence of life. • Assuming that the rover lands at A how might we route it? A B G E C D F
Suppose that the seven sites marked below have been chosen as the most likely to bear evidence of life. • Assuming that the rover lands at A how might we route it? • This is just one of hundreds of possible routes the rover could take--the question we will be concerned with is: Which route is the best or most efficient? A B G E C D F
Suppose that the seven sites marked below have been chosen as the most likely to bear evidence of life. • Assuming that the rover lands at A how might we route it? • This is just one of hundreds of possible routes the rover could take--the question we will be concerned with is: Which route is the best or most efficient? • This is an example of what is called a “Traveling-Salesman Problem” (or TSP). A B G E C D F
Hamilton vs. Euler(Round 1: Fight!) • When dealing with Euler circuits or paths we were concerned with traversing each edge of a graph exactly one time. • A circuit or path in which we visit each vertex once (and only once) is called a Hamiltonian circuit or path.
Example 1: (Exercise 3, pg 248) List all possible Hamiltonian circuits in the following graph: Example 2: (Exercise 5, pg 248) A D E F G A B C D B C (a) Find a Hamiltonian path that begins at A and ends at E. G F E (b) Find a Hamiltonian circuit that starts at A and ends with the pair of vertices E, A. (c) Find a Hamiltonian path that begins at F and ends at G.
Example 1: (Exercise 3, pg 248) List all possible Hamiltonian circuits in the following graph: Example 2: (Exercise 5, pg 248) A D E F G A B C D B C (a) Find a Hamiltonian path that begins at A and ends at E. G F E What about the Hamiltonian circuits that start at B, C, D, etc.? Well, since such a circuit must pass through all of the vertices it doesn’t matter which vertex we start with. (b) Find a Hamiltonian circuit that starts at A and ends with the pair of vertices E, A. (c) Find a Hamiltonian path that begins at F and ends at G.
Hamilton vs. Euler(Round 2: Fight!) • Just because a graph has an Euler circuit or path does not necessarily mean that it has a Hamiltoniancircuit or path.
Hamilton vs. Euler(Round 2: Fight!) • Just because a graph has an Euler circuit or path does not necessarily mean that it has a Hamiltoniancircuit or path. • For instance, the following graph has an Euler circuit:
Hamilton vs. Euler(Round 2: Fight!) • Just because a graph has an Euler circuit or path does not necessarily mean that it has a Hamiltoniancircuit or path. • For instance, the following graph has an Euler circuit: • However, it has no Hamiltonian circuit since you would have to travel through the middle vertex twice to return to your starting point.
Hamilton vs. Euler(Round 3: Fatality) • How can we tell whether or not a graph has a Hamiltonian circuit or path? • Unfortunately, there is no easy criteria like there are for Euler circuits or paths. • There are, however, some graphs such that every sequence of vertices gives us a Hamiltonian circuit.
Example 3: (Exercise 9, pg 249) The following graph has no Hamiltonian circuits or paths--why not? F G B A E D C I H
Complete Graphs • A graph in which every pair of vertices is joined by exactly one edge is called a complete graph. • If a complete graph has N vertices then we will name it KN. • Complete graphs have tons of Hamiltonian circuits; we can write the vertices in any order, repeat the first vertex at the end and we will have a Hamiltonian circuit.
Complete Graphs K3 K4
Complete Graphs K3 K4 K5
Example 4: • How many edges does K4 have? • What is the degree of each vertex? • How many Hamiltonian circuits does it have? A B C D K4
Example 4: • How many edges does K4 have? Ans.: 6 = 12/2 = [(4)(3)]/2 • What is the degree of each vertex? Ans.: 3 = 4 - 1 • How many Hamiltonian circuits does it have? A B C D K4
Example 4: • How many edges does K4 have? Ans.: 6 = 12/2 = [(4)(3)]/2 • What is the degree of each vertex? Ans.: 3 = 4 - 1 • How many Hamiltonian circuits does it have? A B C D K4
Example 4: • How many edges does K4 have? Ans.: 6 = 12/2 = [(4)(3)]/2 • What is the degree of each vertex? Ans.: 3 = 4 - 1 • How many Hamiltonian circuits does it have? A B C D K4
Example 4: • How many edges does K4 have? Ans.: 6 = 12/2 = [(4)(3)]/2 • What is the degree of each vertex? Ans.: 3 = 4 - 1 • How many Hamiltonian circuits does it have? A B C D K4
Example 4: • How many edges does K4 have? Ans.: 6 = 12/2 = [(4)(3)]/2 • What is the degree of each vertex? Ans.: 3 = 4 - 1 • How many Hamiltonian circuits does it have? A B C D K4
Example 4: • How many edges does K4 have? Ans.: 6 = 12/2 = [(4)(3)]/2 • What is the degree of each vertex? Ans.: 3 = 4 - 1 • How many Hamiltonian circuits does it have? Ans.: 6 = (3)(2)(1) = (4 - 1)(4 - 2)(4 - 3) A B C D K4
If we were to answer the same questions for K5 we would find the following:
If we were to answer the same questions for K5 we would find the following: • Each vertex would have a degree of 5 - 1 = 4.
If we were to answer the same questions for K5 we would find the following: • Each vertex would have a degree of 5 - 1 = 4. • The graph would have [(5)(5 - 1)]/2 = [(5)(4)]/2 = 20 / 2 = 10 edges.
If we were to answer the same questions for K5 we would find the following: • Each vertex would have a degree of 5 - 1 = 4. • The graph would have [(5)(5 - 1)]/2 = [(5)(4)]/2 = 20 / 2 = 10 edges. • There are (5 - 1) (5 - 2) ( 5 - 3) (5 - 4) = (4)(3)(2)(1) = 24distinct Hamiltonian circuits.
Properties of KN • The degree of each vertex in the complete graph with N vertices isN-1. • The total number of edges is N(N-1)/2. • The total number of distinct Hamiltonian circuits is(N - 1)! = (N - 1) x (N - 2) x (N - 3) x . . . x 3 x 2 x 1.
Example 5: (a) If KN has 720 distinct Hamiltonian circuits then what is N?(b) If KN has 55 edges then what is N? Example 6:(a) Given that 8! = 40,320 find 7! And 9!(b) How many distinct Hamiltonian circuits are there in K10?