Euler circuits Finding an Euler circuit Method Assume

  • Slides: 23
Download presentation
Euler circuits

Euler circuits

Finding an Euler circuit Method: Assume every vertex in a multigraph has even degree.

Finding an Euler circuit Method: Assume every vertex in a multigraph has even degree. Start at an arbitrary non-isolated vertex v 0, choose an arbitrary edge {v 0, v 1}, then choose an arbitrary edge {v 1, v 2}, then an arbitrary edge {v 2, v 3}, etc. ; every time choose an edge that has not been used yet. Then sooner or later you will arrive back to v 0 and thus get a simple circuit. Indeed, in the above procedure, once you entered a vertex x, there will always be another unused edge to exit x because x has an even degree and only an even number of the edges incident with it had been used before you entered it. The only edge from which you may not be able to exit after entering it is v 0 (because an odd number of edges incident with v 0 have been used as you didn’t enter it at the beginning) , but if you have reached v 0, then you have already constructed a circuit.

A procedure for constructing an Euler circuit Next, it can be shown that the

A procedure for constructing an Euler circuit Next, it can be shown that the following procedure produces an Euler circuit in a connected graph G whose all vertices have even degree: procedure Euler(G) circuit: = a circuit in G constructed using the procedure from Lemma 1. H: = G with the edges of this circuit removed while H has edges begin subcircuit: = a circuit in H constructed using the procedure from Lemma 1 beginning at a non-isolated vertex v of H which is also a vertex of circuit (the existence of such a vertex is guaranteed by the fact that G is connected) H: = H with edges of subcircuit removed circuit: = circuit with subcircuit inserted at v end {circuit is an Euler circuit}

Example - initialization 1 2 3 4 5 6 7 8 1 2 3

Example - initialization 1 2 3 4 5 6 7 8 1 2 3 4 G circuit 1521 5 6 7 8 1 2 3 4 5 6 7 8 H

Example - the first iteration of the while loop 1 2 3 4 5

Example - the first iteration of the while loop 1 2 3 4 5 6 7 8 1 2 3 4 G circuit 1521 5 6 7 8 1 2 3 4 5 1 6 2 7 3 8 4 H 23762 subcircuit 5 6 7 8

Example - the first iteration of the while loop 1 2 3 4 5

Example - the first iteration of the while loop 1 2 3 4 5 6 7 8 1 2 3 4 G circuit 1521 5 6 7 8 1 2 3 4 5 1 6 2 7 3 8 4 H 23762 subcircuit 5 6 7 8

Example - the first iteration of the while loop 1 2 3 4 5

Example - the first iteration of the while loop 1 2 3 4 5 6 7 8 1 2 3 4 G circuit 1521 5 6 7 8 1 2 3 4 5 1 6 2 7 3 8 4 H 23762 subcircuit 5 6 7 8

Example - the first iteration of the while loop 1 2 3 4 5

Example - the first iteration of the while loop 1 2 3 4 5 6 7 8 1 2 3 4 G circuit 1521 5 6 7 8 1 2 3 4 5 1 6 2 7 3 8 4 H 23762 subcircuit 5 6 7 8

Example - the first iteration of the while loop 1 2 3 4 5

Example - the first iteration of the while loop 1 2 3 4 5 6 7 8 1 2 3 4 G circuit 15 1 5 6 7 8 1 2 3 4 5 1 6 2 7 3 8 4 H 23762 subcircuit 5 6 7 8

Example - the first iteration of the while loop 1 2 3 4 5

Example - the first iteration of the while loop 1 2 3 4 5 6 7 8 1 2 3 4 G circuit 15 1 5 6 7 8 1 2 3 4 5 1 6 2 7 3 8 4 H 23762 subcircuit 5 6 7 8

Example - the first iteration of the while loop 1 2 3 4 5

Example - the first iteration of the while loop 1 2 3 4 5 6 7 8 1 2 3 4 G circuit 15 1 5 6 7 8 1 2 3 4 5 1 6 2 7 3 8 4 H 23762 subcircuit 5 6 7 8

Example - the first iteration of the while loop 1 2 3 4 5

Example - the first iteration of the while loop 1 2 3 4 5 6 7 8 1 2 3 4 G circuit 15 5 6 7 8 1 2 3 4 5 1 6 2 7 3 8 4 1 H 23762 subcircuit 5 6 7 8

Example - the first iteration of the while loop 1 2 3 4 5

Example - the first iteration of the while loop 1 2 3 4 5 6 7 8 1 2 3 4 G circuit 15 5 6 7 8 1 2 3 4 5 1 6 2 7 3 8 4 H 23762 subcircuit 5 6 7 8 1

Example - the first iteration of the while loop 1 2 3 4 5

Example - the first iteration of the while loop 1 2 3 4 5 6 7 8 1 2 3 4 G circuit 15 5 6 7 8 1 2 3 4 5 1 6 2 7 3 8 4 H 23762 subcircuit 5 6 7 8 1

Example - the first iteration of the while loop 1 2 3 4 5

Example - the first iteration of the while loop 1 2 3 4 5 6 7 8 1 2 3 4 G circuit 15 5 6 7 8 1 2 3 4 5 1 6 2 7 3 8 4 H 23762 subcircuit 5 6 7 8 1

Example - the first iteration of the while loop 1 2 3 4 5

Example - the first iteration of the while loop 1 2 3 4 5 6 7 8 1 2 3 4 G circuit 15 5 6 7 8 1 2 3 4 5 1 6 2 7 3 8 4 H 23762 subcircuit 5 6 7 8 1

Example - the first iteration of the while loop 1 2 3 4 5

Example - the first iteration of the while loop 1 2 3 4 5 6 7 8 1 2 3 4 G circuit 15 237621 5 6 7 8 1 2 3 4 5 1 6 2 7 3 8 4 H 23762 subcircuit 5 6 7 8

Example - the second iteration of the while loop 1 2 3 4 5

Example - the second iteration of the while loop 1 2 3 4 5 6 7 8 1 2 3 4 G circuit 15 237621 5 6 7 8 1 2 3 4 5 1 6 2 7 3 8 4 H 7847 subcircuit 5 6 7 8

Example - the second iteration of the while loop 1 2 3 4 5

Example - the second iteration of the while loop 1 2 3 4 5 6 7 8 1 2 3 4 G circuit 15 237621 5 6 7 8 1 2 3 4 5 1 6 2 7 3 8 4 H 7847 subcircuit 5 6 7 8

Example - the second iteration of the while loop 1 2 3 4 5

Example - the second iteration of the while loop 1 2 3 4 5 6 7 8 1 2 3 4 G circuit 15 237621 5 6 7 8 1 2 3 4 5 1 6 2 7 3 8 4 H 7847 subcircuit 5 6 7 8

Example - the second iteration of the while loop 1 2 3 4 5

Example - the second iteration of the while loop 1 2 3 4 5 6 7 8 1 2 3 4 G circuit 15 23 621 5 6 7 8 1 2 3 4 5 1 6 2 7 3 8 4 H 7847 subcircuit 5 6 7 8

Example - the second iteration of the while loop 1 2 3 4 5

Example - the second iteration of the while loop 1 2 3 4 5 6 7 8 1 2 3 4 G circuit 1523784762 1 5 6 7 8 1 2 3 4 5 1 6 2 7 3 8 4 H 7847 subcircuit 5 6 7 8

Example - the second iteration of the while loop 1 2 3 4 5

Example - the second iteration of the while loop 1 2 3 4 5 6 7 8 1 2 3 4 G circuit 1523784762 1 5 6 7 8