Euler’s Theorems and Fleury’s Algorithm -...
Transcript of Euler’s Theorems and Fleury’s Algorithm -...
Euler’s Theorems and Fleury’s AlgorithmLecture 27Section 5.3
Robb T. Koether
Hampden-Sydney College
Fri, Oct 27, 2017
Robb T. Koether (Hampden-Sydney College) Euler’s Theorems and Fleury’s Algorithm Fri, Oct 27, 2017 1 / 19
1 Definitions
2 Euler’s Theorems
3 Fleury’s Algorithm
4 The Splicing Algorithm
5 The Mail Carrier Problem Solved
6 Assignment
Robb T. Koether (Hampden-Sydney College) Euler’s Theorems and Fleury’s Algorithm Fri, Oct 27, 2017 2 / 19
Outline
1 Definitions
2 Euler’s Theorems
3 Fleury’s Algorithm
4 The Splicing Algorithm
5 The Mail Carrier Problem Solved
6 Assignment
Robb T. Koether (Hampden-Sydney College) Euler’s Theorems and Fleury’s Algorithm Fri, Oct 27, 2017 3 / 19
Euler Paths and Circuits
Definition (Euler Path)An Euler path (pronounced "oiler") is a path that traverses each edgeexactly once.
Definition (Euler Circuit)An Euler circuit is an Euler path that is a circuit.
Robb T. Koether (Hampden-Sydney College) Euler’s Theorems and Fleury’s Algorithm Fri, Oct 27, 2017 4 / 19
Euler Paths and Circuits
In the Bridges of Königsberg Problem, we seek an Euler path andan Euler circuit.
Robb T. Koether (Hampden-Sydney College) Euler’s Theorems and Fleury’s Algorithm Fri, Oct 27, 2017 5 / 19
Definitions
Definition (Connected)A graph is connected if, for any two vertices, there is a path from oneto the other.
Definition (Even and Odd Vertices)A vertex is even if an even number of edges emanate from it.Otherwise, it is odd.
Robb T. Koether (Hampden-Sydney College) Euler’s Theorems and Fleury’s Algorithm Fri, Oct 27, 2017 6 / 19
Outline
1 Definitions
2 Euler’s Theorems
3 Fleury’s Algorithm
4 The Splicing Algorithm
5 The Mail Carrier Problem Solved
6 Assignment
Robb T. Koether (Hampden-Sydney College) Euler’s Theorems and Fleury’s Algorithm Fri, Oct 27, 2017 7 / 19
Euler’s Theorems
Theorem (Euler Circuits)If a graph is connected and every vertex is even, then it has an Eulercircuit. Otherwise, it does not have an Euler circuit.
Robb T. Koether (Hampden-Sydney College) Euler’s Theorems and Fleury’s Algorithm Fri, Oct 27, 2017 8 / 19
Euler’s Theorems
Theorem (Euler Paths)If a graph is connected and it has exactly 2 odd vertices, then it has anEuler path and any Euler path must begin at one of the odd verticesand end that the other one.
Robb T. Koether (Hampden-Sydney College) Euler’s Theorems and Fleury’s Algorithm Fri, Oct 27, 2017 9 / 19
Euler’s Theorems
Theorem (Euler Paths)If a graph is not connected or if it has more than 2 odd vertices, then itdoes not have an Euler path.
Robb T. Koether (Hampden-Sydney College) Euler’s Theorems and Fleury’s Algorithm Fri, Oct 27, 2017 10 / 19
Outline
1 Definitions
2 Euler’s Theorems
3 Fleury’s Algorithm
4 The Splicing Algorithm
5 The Mail Carrier Problem Solved
6 Assignment
Robb T. Koether (Hampden-Sydney College) Euler’s Theorems and Fleury’s Algorithm Fri, Oct 27, 2017 11 / 19
Fleury’s AlgorithmBegin at any vertex and follow an edge.Whenever there is a choice of edges, choose an edge that doesnot separate you from any remaining (unvisited) edges.
(Thisrequires thought.)Continue to follow edges in this manner.When you reach the starting point, you have an Euler circuit.
Robb T. Koether (Hampden-Sydney College) Euler’s Theorems and Fleury’s Algorithm Fri, Oct 27, 2017 12 / 19
Fleury’s AlgorithmBegin at any vertex and follow an edge.Whenever there is a choice of edges, choose an edge that doesnot separate you from any remaining (unvisited) edges. (Thisrequires thought.)
Continue to follow edges in this manner.When you reach the starting point, you have an Euler circuit.
Robb T. Koether (Hampden-Sydney College) Euler’s Theorems and Fleury’s Algorithm Fri, Oct 27, 2017 12 / 19
Fleury’s AlgorithmBegin at any vertex and follow an edge.Whenever there is a choice of edges, choose an edge that doesnot separate you from any remaining (unvisited) edges. (Thisrequires thought.)Continue to follow edges in this manner.When you reach the starting point, you have an Euler circuit.
Robb T. Koether (Hampden-Sydney College) Euler’s Theorems and Fleury’s Algorithm Fri, Oct 27, 2017 12 / 19
Fleury’s Algorithm
Robb T. Koether (Hampden-Sydney College) Euler’s Theorems and Fleury’s Algorithm Fri, Oct 27, 2017 13 / 19
Fleury’s Algorithm
Robb T. Koether (Hampden-Sydney College) Euler’s Theorems and Fleury’s Algorithm Fri, Oct 27, 2017 13 / 19
Fleury’s Algorithm
Robb T. Koether (Hampden-Sydney College) Euler’s Theorems and Fleury’s Algorithm Fri, Oct 27, 2017 13 / 19
Fleury’s Algorithm
Robb T. Koether (Hampden-Sydney College) Euler’s Theorems and Fleury’s Algorithm Fri, Oct 27, 2017 13 / 19
Fleury’s Algorithm
Robb T. Koether (Hampden-Sydney College) Euler’s Theorems and Fleury’s Algorithm Fri, Oct 27, 2017 13 / 19
Fleury’s Algorithm
Robb T. Koether (Hampden-Sydney College) Euler’s Theorems and Fleury’s Algorithm Fri, Oct 27, 2017 13 / 19
Fleury’s Algorithm
Robb T. Koether (Hampden-Sydney College) Euler’s Theorems and Fleury’s Algorithm Fri, Oct 27, 2017 13 / 19
Fleury’s Algorithm
Robb T. Koether (Hampden-Sydney College) Euler’s Theorems and Fleury’s Algorithm Fri, Oct 27, 2017 13 / 19
Fleury’s Algorithm
Robb T. Koether (Hampden-Sydney College) Euler’s Theorems and Fleury’s Algorithm Fri, Oct 27, 2017 13 / 19
Fleury’s Algorithm
Robb T. Koether (Hampden-Sydney College) Euler’s Theorems and Fleury’s Algorithm Fri, Oct 27, 2017 13 / 19
Fleury’s Algorithm
Robb T. Koether (Hampden-Sydney College) Euler’s Theorems and Fleury’s Algorithm Fri, Oct 27, 2017 13 / 19
Fleury’s Algorithm
Robb T. Koether (Hampden-Sydney College) Euler’s Theorems and Fleury’s Algorithm Fri, Oct 27, 2017 13 / 19
Fleury’s Algorithm
Robb T. Koether (Hampden-Sydney College) Euler’s Theorems and Fleury’s Algorithm Fri, Oct 27, 2017 13 / 19
Fleury’s Algorithm
Robb T. Koether (Hampden-Sydney College) Euler’s Theorems and Fleury’s Algorithm Fri, Oct 27, 2017 13 / 19
Fleury’s Algorithm
Robb T. Koether (Hampden-Sydney College) Euler’s Theorems and Fleury’s Algorithm Fri, Oct 27, 2017 13 / 19
Fleury’s Algorithm
Robb T. Koether (Hampden-Sydney College) Euler’s Theorems and Fleury’s Algorithm Fri, Oct 27, 2017 13 / 19
Fleury’s Algorithm
Robb T. Koether (Hampden-Sydney College) Euler’s Theorems and Fleury’s Algorithm Fri, Oct 27, 2017 13 / 19
Fleury’s Algorithm
Robb T. Koether (Hampden-Sydney College) Euler’s Theorems and Fleury’s Algorithm Fri, Oct 27, 2017 13 / 19
Fleury’s Algorithm
Robb T. Koether (Hampden-Sydney College) Euler’s Theorems and Fleury’s Algorithm Fri, Oct 27, 2017 13 / 19
Fleury’s Algorithm
Robb T. Koether (Hampden-Sydney College) Euler’s Theorems and Fleury’s Algorithm Fri, Oct 27, 2017 13 / 19
Fleury’s Algorithm
Robb T. Koether (Hampden-Sydney College) Euler’s Theorems and Fleury’s Algorithm Fri, Oct 27, 2017 13 / 19
Fleury’s Algorithm
Robb T. Koether (Hampden-Sydney College) Euler’s Theorems and Fleury’s Algorithm Fri, Oct 27, 2017 13 / 19
Fleury’s Algorithm
Robb T. Koether (Hampden-Sydney College) Euler’s Theorems and Fleury’s Algorithm Fri, Oct 27, 2017 13 / 19
Fleury’s Algorithm
Robb T. Koether (Hampden-Sydney College) Euler’s Theorems and Fleury’s Algorithm Fri, Oct 27, 2017 13 / 19
Outline
1 Definitions
2 Euler’s Theorems
3 Fleury’s Algorithm
4 The Splicing Algorithm
5 The Mail Carrier Problem Solved
6 Assignment
Robb T. Koether (Hampden-Sydney College) Euler’s Theorems and Fleury’s Algorithm Fri, Oct 27, 2017 14 / 19
The Splicing AlgorithmBegin at any vertex and follow an edge.
Continue to follow edges in any way whatsoever until you reachthe starting point, at which point you have a circuit.
(This does notrequire thought.)
If there are untraveled edges, then retrace the circuit until youreach the first untraveled edge.Follow untraveled edges, as before, until you return to that vertex.“Splice” that circuit into the original circuit.Repeat the last three steps until there are no more untravelededges. You now have an Euler circuit.
Robb T. Koether (Hampden-Sydney College) Euler’s Theorems and Fleury’s Algorithm Fri, Oct 27, 2017 15 / 19
The Splicing AlgorithmBegin at any vertex and follow an edge.Continue to follow edges in any way whatsoever until you reachthe starting point, at which point you have a circuit.
(This does notrequire thought.)If there are untraveled edges, then retrace the circuit until youreach the first untraveled edge.Follow untraveled edges, as before, until you return to that vertex.“Splice” that circuit into the original circuit.Repeat the last three steps until there are no more untravelededges. You now have an Euler circuit.
Robb T. Koether (Hampden-Sydney College) Euler’s Theorems and Fleury’s Algorithm Fri, Oct 27, 2017 15 / 19
The Splicing AlgorithmBegin at any vertex and follow an edge.Continue to follow edges in any way whatsoever until you reachthe starting point, at which point you have a circuit. (This does notrequire thought.)
If there are untraveled edges, then retrace the circuit until youreach the first untraveled edge.Follow untraveled edges, as before, until you return to that vertex.“Splice” that circuit into the original circuit.Repeat the last three steps until there are no more untravelededges. You now have an Euler circuit.
Robb T. Koether (Hampden-Sydney College) Euler’s Theorems and Fleury’s Algorithm Fri, Oct 27, 2017 15 / 19
The Splicing AlgorithmBegin at any vertex and follow an edge.Continue to follow edges in any way whatsoever until you reachthe starting point, at which point you have a circuit. (This does notrequire thought.)If there are untraveled edges, then retrace the circuit until youreach the first untraveled edge.
Follow untraveled edges, as before, until you return to that vertex.“Splice” that circuit into the original circuit.Repeat the last three steps until there are no more untravelededges. You now have an Euler circuit.
Robb T. Koether (Hampden-Sydney College) Euler’s Theorems and Fleury’s Algorithm Fri, Oct 27, 2017 15 / 19
The Splicing AlgorithmBegin at any vertex and follow an edge.Continue to follow edges in any way whatsoever until you reachthe starting point, at which point you have a circuit. (This does notrequire thought.)If there are untraveled edges, then retrace the circuit until youreach the first untraveled edge.Follow untraveled edges, as before, until you return to that vertex.
“Splice” that circuit into the original circuit.Repeat the last three steps until there are no more untravelededges. You now have an Euler circuit.
Robb T. Koether (Hampden-Sydney College) Euler’s Theorems and Fleury’s Algorithm Fri, Oct 27, 2017 15 / 19
The Splicing AlgorithmBegin at any vertex and follow an edge.Continue to follow edges in any way whatsoever until you reachthe starting point, at which point you have a circuit. (This does notrequire thought.)If there are untraveled edges, then retrace the circuit until youreach the first untraveled edge.Follow untraveled edges, as before, until you return to that vertex.“Splice” that circuit into the original circuit.
Repeat the last three steps until there are no more untravelededges. You now have an Euler circuit.
Robb T. Koether (Hampden-Sydney College) Euler’s Theorems and Fleury’s Algorithm Fri, Oct 27, 2017 15 / 19
The Splicing AlgorithmBegin at any vertex and follow an edge.Continue to follow edges in any way whatsoever until you reachthe starting point, at which point you have a circuit. (This does notrequire thought.)If there are untraveled edges, then retrace the circuit until youreach the first untraveled edge.Follow untraveled edges, as before, until you return to that vertex.“Splice” that circuit into the original circuit.Repeat the last three steps until there are no more untravelededges. You now have an Euler circuit.
Robb T. Koether (Hampden-Sydney College) Euler’s Theorems and Fleury’s Algorithm Fri, Oct 27, 2017 15 / 19
The Splicing Algorithm
Robb T. Koether (Hampden-Sydney College) Euler’s Theorems and Fleury’s Algorithm Fri, Oct 27, 2017 16 / 19
The Splicing Algorithm
1
Robb T. Koether (Hampden-Sydney College) Euler’s Theorems and Fleury’s Algorithm Fri, Oct 27, 2017 16 / 19
The Splicing Algorithm
1
2
Robb T. Koether (Hampden-Sydney College) Euler’s Theorems and Fleury’s Algorithm Fri, Oct 27, 2017 16 / 19
The Splicing Algorithm
1
2
3
Robb T. Koether (Hampden-Sydney College) Euler’s Theorems and Fleury’s Algorithm Fri, Oct 27, 2017 16 / 19
The Splicing Algorithm
1
2
3
4
Robb T. Koether (Hampden-Sydney College) Euler’s Theorems and Fleury’s Algorithm Fri, Oct 27, 2017 16 / 19
The Splicing Algorithm
1
2
3
45
Robb T. Koether (Hampden-Sydney College) Euler’s Theorems and Fleury’s Algorithm Fri, Oct 27, 2017 16 / 19
The Splicing Algorithm
1
2
3
45
6
Robb T. Koether (Hampden-Sydney College) Euler’s Theorems and Fleury’s Algorithm Fri, Oct 27, 2017 16 / 19
The Splicing Algorithm
1
2
3
45
6
7
Robb T. Koether (Hampden-Sydney College) Euler’s Theorems and Fleury’s Algorithm Fri, Oct 27, 2017 16 / 19
The Splicing Algorithm
1
2
3
45
6
7
Robb T. Koether (Hampden-Sydney College) Euler’s Theorems and Fleury’s Algorithm Fri, Oct 27, 2017 16 / 19
The Splicing Algorithm
1
2
3
45
6
7
Robb T. Koether (Hampden-Sydney College) Euler’s Theorems and Fleury’s Algorithm Fri, Oct 27, 2017 16 / 19
The Splicing Algorithm
1
2
3
45
6
7 1A
Robb T. Koether (Hampden-Sydney College) Euler’s Theorems and Fleury’s Algorithm Fri, Oct 27, 2017 16 / 19
The Splicing Algorithm
1
2
3
45
6
7 1A
2A
Robb T. Koether (Hampden-Sydney College) Euler’s Theorems and Fleury’s Algorithm Fri, Oct 27, 2017 16 / 19
The Splicing Algorithm
1
2
3
45
6
7 1A
2A
3A
Robb T. Koether (Hampden-Sydney College) Euler’s Theorems and Fleury’s Algorithm Fri, Oct 27, 2017 16 / 19
The Splicing Algorithm
1
2
3
45
6
7 1A
2A
3A
4A
Robb T. Koether (Hampden-Sydney College) Euler’s Theorems and Fleury’s Algorithm Fri, Oct 27, 2017 16 / 19
The Splicing Algorithm
1
2
3
45
6
7 1A
2A
3A
4A
5A
Robb T. Koether (Hampden-Sydney College) Euler’s Theorems and Fleury’s Algorithm Fri, Oct 27, 2017 16 / 19
The Splicing Algorithm
1
2
3
45
6
7 1A
2A
3A
4A
5A
6A
Robb T. Koether (Hampden-Sydney College) Euler’s Theorems and Fleury’s Algorithm Fri, Oct 27, 2017 16 / 19
The Splicing Algorithm
1
2
3
45
6
7 1A
2A
3A
4A
5A
6A
7A
Robb T. Koether (Hampden-Sydney College) Euler’s Theorems and Fleury’s Algorithm Fri, Oct 27, 2017 16 / 19
The Splicing Algorithm
1
2
3
45
6
7 1A
2A
3A
4A
5A
6A
7A
Robb T. Koether (Hampden-Sydney College) Euler’s Theorems and Fleury’s Algorithm Fri, Oct 27, 2017 16 / 19
The Splicing Algorithm
1
2
3
45
6
7 1A
2A
3A
4A
5A
6A
7A
Robb T. Koether (Hampden-Sydney College) Euler’s Theorems and Fleury’s Algorithm Fri, Oct 27, 2017 16 / 19
The Splicing Algorithm
1
2
3
45
6
7 1A
2A
3A
4A
5A
6A
7A
Robb T. Koether (Hampden-Sydney College) Euler’s Theorems and Fleury’s Algorithm Fri, Oct 27, 2017 16 / 19
The Splicing Algorithm
1
2
3
45
6
7 1A
2A
3A
4A
5A
6A
7A
1B
Robb T. Koether (Hampden-Sydney College) Euler’s Theorems and Fleury’s Algorithm Fri, Oct 27, 2017 16 / 19
The Splicing Algorithm
1
2
3
45
6
7 1A
2A
3A
4A
5A
6A
7A
1B
2B
Robb T. Koether (Hampden-Sydney College) Euler’s Theorems and Fleury’s Algorithm Fri, Oct 27, 2017 16 / 19
The Splicing Algorithm
1
2
3
45
6
7 1A
2A
3A
4A
5A
6A
7A
1B
2B
3B
Robb T. Koether (Hampden-Sydney College) Euler’s Theorems and Fleury’s Algorithm Fri, Oct 27, 2017 16 / 19
The Splicing Algorithm
1
2
3
45
6
7 1A
2A
3A
4A
5A
6A
7A
1B
2B
3B4B
Robb T. Koether (Hampden-Sydney College) Euler’s Theorems and Fleury’s Algorithm Fri, Oct 27, 2017 16 / 19
The Splicing Algorithm
1
2
3
45
6
7 1A
2A
3A
4A
5A
6A
7A
1B
2B
3B4B
5B
Robb T. Koether (Hampden-Sydney College) Euler’s Theorems and Fleury’s Algorithm Fri, Oct 27, 2017 16 / 19
The Splicing Algorithm
1
2
3
45
6
7 1A
2A
3A
4A
5A
6A
7A
1B
2B
3B4B
5B
6B
Robb T. Koether (Hampden-Sydney College) Euler’s Theorems and Fleury’s Algorithm Fri, Oct 27, 2017 16 / 19
The Splicing Algorithm
1
2
3
45
6
7 1A
2A
3A
4A
5A
6A
7A
1B
2B
3B4B
5B
6B
7B
Robb T. Koether (Hampden-Sydney College) Euler’s Theorems and Fleury’s Algorithm Fri, Oct 27, 2017 16 / 19
The Splicing Algorithm
1
2
3
45
6
7 1A
2A
3A
4A
5A
6A
7A
1B
2B
3B4B
5B
6B
7B 8B
Robb T. Koether (Hampden-Sydney College) Euler’s Theorems and Fleury’s Algorithm Fri, Oct 27, 2017 16 / 19
The Splicing Algorithm
1
2
3
45
6
7 1A
2A
3A
4A
5A
6A
7A
1B
2B
3B4B
5B
6B
7B 8B
Robb T. Koether (Hampden-Sydney College) Euler’s Theorems and Fleury’s Algorithm Fri, Oct 27, 2017 16 / 19
Outline
1 Definitions
2 Euler’s Theorems
3 Fleury’s Algorithm
4 The Splicing Algorithm
5 The Mail Carrier Problem Solved
6 Assignment
Robb T. Koether (Hampden-Sydney College) Euler’s Theorems and Fleury’s Algorithm Fri, Oct 27, 2017 17 / 19
The Mail Carrier Problem Solved
The mail carrier’s graph never contains any odd vertices.
Robb T. Koether (Hampden-Sydney College) Euler’s Theorems and Fleury’s Algorithm Fri, Oct 27, 2017 18 / 19
The Mail Carrier Problem Solved
The mail carrier’s graph never contains any odd vertices.
Robb T. Koether (Hampden-Sydney College) Euler’s Theorems and Fleury’s Algorithm Fri, Oct 27, 2017 18 / 19
The Mail Carrier Problem Solved
4 4 4 4 4 22
2
2 4
2 4 4 2
4
4
4
46
68
8
8
8
8 8
6 6
4 4
The mail carrier’s graph never contains any odd vertices.
Robb T. Koether (Hampden-Sydney College) Euler’s Theorems and Fleury’s Algorithm Fri, Oct 27, 2017 18 / 19
Outline
1 Definitions
2 Euler’s Theorems
3 Fleury’s Algorithm
4 The Splicing Algorithm
5 The Mail Carrier Problem Solved
6 Assignment
Robb T. Koether (Hampden-Sydney College) Euler’s Theorems and Fleury’s Algorithm Fri, Oct 27, 2017 19 / 19
Assignment
AssignmentChapter 5: Exercises 29, 30, 31, 35, 36, 37, 38, 39.
Robb T. Koether (Hampden-Sydney College) Euler’s Theorems and Fleury’s Algorithm Fri, Oct 27, 2017 20 / 19