220 likes | 237 Views
CIS260-201/204—Spring 2008. Recitation 10 Friday, April 4, 2008. Recap: Proof of Euler Tour. Let G be an Eulerian graph. Find a cycle C in G . (A cycle exists.) Remove C . Get a smaller graph. By inductive hypothesis, each connected component has an Euler tour.
E N D
CIS260-201/204—Spring 2008 Recitation 10 Friday, April 4, 2008
Recap: Proof of Euler Tour • Let G be an Eulerian graph. • Find a cycle C in G. (A cycle exists.) • Remove C. Get a smaller graph. • By inductive hypothesis, each connected component has an Euler tour. • The Euler tour of G is obtained by traversing C and diverge to the Euler tour of each component when we encounter it. • Example will help.
Euler Tour: Example • First, verify that this graph is Eulerian. • How? • Every vertex has even degree. • So, it has an Euler tour.
Euler Tour: Example (cont.) • Find a cycle. • Remove this cycle. • The remaining graph is still Eulerian. • So, we can find an Euler tour in the remaining graph.
Euler Tour: Example (cont.) • If the remaining graph is still complicated (like this), repeat the procedure. • Note: Now there are two connected components.
Euler Tour: Example (cont.) • Find a cycle. • Remove this cycle.
Euler Tour: Example (cont.) • The resulting graph is still Eulerian. • Now 3 components. • Again, find another cycle. • Remove it.
Euler Tour: Example (cont.) • The resulting graph is still Eulerian. • Many components now. • Again, find another cycle. • Remove it.
Euler Tour: Example (cont.) • The resulting graph is still Eulerian. • Now simple enough to see all the Euler tours of each nontrivial component. • So, ready to construct the tour for the whole graph.
Euler Tour: Example (cont.) • Start at the vertex on a cycle we removed. • Once we encounter a vertex having an Euler tour attached to it, traverse that tour.
Euler Tour: Example (cont.) • When done, go back to previous cycles… • … and do the same. • In this case we don’t encounter any other tour.
Euler Tour: Example (cont.) • Two more cycles to go.
Euler Tour: Example (cont.) • Last cycle… • And we are done!
Hamiltonian Cycle:Example • Prove that this graph does not have a Hamiltonian cycle.
Hamiltonian Cycle:Example (cont.) • This graph is bipartite! • Well, let’s color it.
Hamiltonian Cycle:Example (cont.) • 13 yellow vertices • 12 blue vertices • Any cycle must be yellow, blue, yellow, blue, …, blue, yellow (first vertex). • Is it possible to traverse every vertex and come back to the first vertex?
Hamiltonian Cycle:Example (cont.) • Start with a blue vertex. • blue, yellow, blue, yellow, …, blue, yellow. • One yellow vertex left! • Can’t start with a blue.
Hamiltonian Cycle:Example (cont.) • Start with a yellow vertex. • yellow, blue, yellow, blue, …, yellow, blue, yellow. • But the first and last vertices are yellow. • Can’t get back to the first vertex. • Can’t start with a yellow. • Can’t start with anything! • No Hamiltonian cycle.
Hamiltonian Path:Example • Prove that this graph does not have a Hamiltonian path.
Hamiltonian Path:Example (cont.) • Again, this graph is bipartite. • Let’s color it.
Hamiltonian Path:Example (cont.) • 32 blue vertices • 30 yellow vertices • Any path must be blue, yellow, …, blue. • Is it possible to traverse every vertex?
Hamiltonian Path:Example (cont.) • Even starting with a blue vertex, we can’t get to all blue vertices because there are not enough yellow vertices. • Starting with a yellow vertex is out of question; we can’t visit every blue vertex. • No Hamiltonian path.