Euler Paths and Euler Circuits - Jeremy L. Martin · 2018. 8. 14. · The Criterion for Euler Paths...
Transcript of Euler Paths and Euler Circuits - Jeremy L. Martin · 2018. 8. 14. · The Criterion for Euler Paths...
![Page 1: Euler Paths and Euler Circuits - Jeremy L. Martin · 2018. 8. 14. · The Criterion for Euler Paths Suppose that a graph has an Euler path P. For every vertex v other than the starting](https://reader033.fdocuments.in/reader033/viewer/2022060101/60b2ff9044763474022f7747/html5/thumbnails/1.jpg)
Euler Paths and Euler Circuits
An Euler path is a path that uses every edge of a graphexactly once.
An Euler circuit is a circuit that uses every edge of a graphexactly once.
I An Euler path starts and ends at different vertices.
I An Euler circuit starts and ends at the same vertex.
![Page 2: Euler Paths and Euler Circuits - Jeremy L. Martin · 2018. 8. 14. · The Criterion for Euler Paths Suppose that a graph has an Euler path P. For every vertex v other than the starting](https://reader033.fdocuments.in/reader033/viewer/2022060101/60b2ff9044763474022f7747/html5/thumbnails/2.jpg)
Euler Paths and Euler Circuits
B
C
DE
A
B
C
DE
A
An Euler path: BBADCDEBC
![Page 3: Euler Paths and Euler Circuits - Jeremy L. Martin · 2018. 8. 14. · The Criterion for Euler Paths Suppose that a graph has an Euler path P. For every vertex v other than the starting](https://reader033.fdocuments.in/reader033/viewer/2022060101/60b2ff9044763474022f7747/html5/thumbnails/3.jpg)
Euler Paths and Euler Circuits
B
C
DE
A
B
C
DE
A
Another Euler path: CDCBBADEB
![Page 4: Euler Paths and Euler Circuits - Jeremy L. Martin · 2018. 8. 14. · The Criterion for Euler Paths Suppose that a graph has an Euler path P. For every vertex v other than the starting](https://reader033.fdocuments.in/reader033/viewer/2022060101/60b2ff9044763474022f7747/html5/thumbnails/4.jpg)
Euler Paths and Euler Circuits
B
C
DE
A
B
C
DE
A
An Euler circuit: CDCBBADEBC
![Page 5: Euler Paths and Euler Circuits - Jeremy L. Martin · 2018. 8. 14. · The Criterion for Euler Paths Suppose that a graph has an Euler path P. For every vertex v other than the starting](https://reader033.fdocuments.in/reader033/viewer/2022060101/60b2ff9044763474022f7747/html5/thumbnails/5.jpg)
Euler Paths and Euler Circuits
B
C
DE
A
B
C
DE
A
Another Euler circuit: CDEBBADC
![Page 6: Euler Paths and Euler Circuits - Jeremy L. Martin · 2018. 8. 14. · The Criterion for Euler Paths Suppose that a graph has an Euler path P. For every vertex v other than the starting](https://reader033.fdocuments.in/reader033/viewer/2022060101/60b2ff9044763474022f7747/html5/thumbnails/6.jpg)
Euler Paths and Euler Circuits
Is it possible to determine whether a graph has anEuler path or an Euler circuit, without necessarilyhaving to find one explicitly?
![Page 7: Euler Paths and Euler Circuits - Jeremy L. Martin · 2018. 8. 14. · The Criterion for Euler Paths Suppose that a graph has an Euler path P. For every vertex v other than the starting](https://reader033.fdocuments.in/reader033/viewer/2022060101/60b2ff9044763474022f7747/html5/thumbnails/7.jpg)
The Criterion for Euler Paths
Suppose that a graph has an Euler path P .
For every vertex v other than the starting and ending vertices,the path P enters v the same number of times that it leaves v(say s times).
Therefore, there are 2s edges having v as an endpoint.
Therefore, all vertices other than the two endpoints ofP must be even vertices.
![Page 8: Euler Paths and Euler Circuits - Jeremy L. Martin · 2018. 8. 14. · The Criterion for Euler Paths Suppose that a graph has an Euler path P. For every vertex v other than the starting](https://reader033.fdocuments.in/reader033/viewer/2022060101/60b2ff9044763474022f7747/html5/thumbnails/8.jpg)
The Criterion for Euler Paths
Suppose that a graph has an Euler path P .
For every vertex v other than the starting and ending vertices,the path P enters v the same number of times that it leaves v(say s times).
Therefore, there are 2s edges having v as an endpoint.
Therefore, all vertices other than the two endpoints ofP must be even vertices.
![Page 9: Euler Paths and Euler Circuits - Jeremy L. Martin · 2018. 8. 14. · The Criterion for Euler Paths Suppose that a graph has an Euler path P. For every vertex v other than the starting](https://reader033.fdocuments.in/reader033/viewer/2022060101/60b2ff9044763474022f7747/html5/thumbnails/9.jpg)
The Criterion for Euler Paths
Suppose that a graph has an Euler path P .
For every vertex v other than the starting and ending vertices,the path P enters v the same number of times that it leaves v(say s times).
Therefore, there are 2s edges having v as an endpoint.
Therefore, all vertices other than the two endpoints ofP must be even vertices.
![Page 10: Euler Paths and Euler Circuits - Jeremy L. Martin · 2018. 8. 14. · The Criterion for Euler Paths Suppose that a graph has an Euler path P. For every vertex v other than the starting](https://reader033.fdocuments.in/reader033/viewer/2022060101/60b2ff9044763474022f7747/html5/thumbnails/10.jpg)
The Criterion for Euler Paths
Suppose that a graph has an Euler path P .
For every vertex v other than the starting and ending vertices,the path P enters v the same number of times that it leaves v(say s times).
Therefore, there are 2s edges having v as an endpoint.
Therefore, all vertices other than the two endpoints ofP must be even vertices.
![Page 11: Euler Paths and Euler Circuits - Jeremy L. Martin · 2018. 8. 14. · The Criterion for Euler Paths Suppose that a graph has an Euler path P. For every vertex v other than the starting](https://reader033.fdocuments.in/reader033/viewer/2022060101/60b2ff9044763474022f7747/html5/thumbnails/11.jpg)
The Criterion for Euler Paths
Suppose the Euler path P starts at vertex x and ends at y .
Then P leaves x one more time than it enters, and leaves yone fewer time than it enters.
Therefore, the two endpoints of P must be odd vertices.
![Page 12: Euler Paths and Euler Circuits - Jeremy L. Martin · 2018. 8. 14. · The Criterion for Euler Paths Suppose that a graph has an Euler path P. For every vertex v other than the starting](https://reader033.fdocuments.in/reader033/viewer/2022060101/60b2ff9044763474022f7747/html5/thumbnails/12.jpg)
The Criterion for Euler Paths
Suppose the Euler path P starts at vertex x and ends at y .
Then P leaves x one more time than it enters, and leaves yone fewer time than it enters.
Therefore, the two endpoints of P must be odd vertices.
![Page 13: Euler Paths and Euler Circuits - Jeremy L. Martin · 2018. 8. 14. · The Criterion for Euler Paths Suppose that a graph has an Euler path P. For every vertex v other than the starting](https://reader033.fdocuments.in/reader033/viewer/2022060101/60b2ff9044763474022f7747/html5/thumbnails/13.jpg)
The Criterion for Euler Paths
Suppose the Euler path P starts at vertex x and ends at y .
Then P leaves x one more time than it enters, and leaves yone fewer time than it enters.
Therefore, the two endpoints of P must be odd vertices.
![Page 14: Euler Paths and Euler Circuits - Jeremy L. Martin · 2018. 8. 14. · The Criterion for Euler Paths Suppose that a graph has an Euler path P. For every vertex v other than the starting](https://reader033.fdocuments.in/reader033/viewer/2022060101/60b2ff9044763474022f7747/html5/thumbnails/14.jpg)
The Criterion for Euler Paths
The inescapable conclusion (“based on reason alone!”):
If a graph G has an Euler path, then it must haveexactly two odd vertices.
Or, to put it another way,
If the number of odd vertices in G is anything otherthan 2, then G cannot have an Euler path.
![Page 15: Euler Paths and Euler Circuits - Jeremy L. Martin · 2018. 8. 14. · The Criterion for Euler Paths Suppose that a graph has an Euler path P. For every vertex v other than the starting](https://reader033.fdocuments.in/reader033/viewer/2022060101/60b2ff9044763474022f7747/html5/thumbnails/15.jpg)
The Criterion for Euler Circuits
I Suppose that a graph G has an Euler circuit C .
I For every vertex v in G , each edge having v as anendpoint shows up exactly once in C .
I The circuit C enters v the same number of times that itleaves v (say s times), so v has degree 2s.
I That is, v must be an even vertex.
![Page 16: Euler Paths and Euler Circuits - Jeremy L. Martin · 2018. 8. 14. · The Criterion for Euler Paths Suppose that a graph has an Euler path P. For every vertex v other than the starting](https://reader033.fdocuments.in/reader033/viewer/2022060101/60b2ff9044763474022f7747/html5/thumbnails/16.jpg)
The Criterion for Euler Circuits
I Suppose that a graph G has an Euler circuit C .
I For every vertex v in G , each edge having v as anendpoint shows up exactly once in C .
I The circuit C enters v the same number of times that itleaves v (say s times), so v has degree 2s.
I That is, v must be an even vertex.
![Page 17: Euler Paths and Euler Circuits - Jeremy L. Martin · 2018. 8. 14. · The Criterion for Euler Paths Suppose that a graph has an Euler path P. For every vertex v other than the starting](https://reader033.fdocuments.in/reader033/viewer/2022060101/60b2ff9044763474022f7747/html5/thumbnails/17.jpg)
The Criterion for Euler Circuits
I Suppose that a graph G has an Euler circuit C .
I For every vertex v in G , each edge having v as anendpoint shows up exactly once in C .
I The circuit C enters v the same number of times that itleaves v (say s times), so v has degree 2s.
I That is, v must be an even vertex.
![Page 18: Euler Paths and Euler Circuits - Jeremy L. Martin · 2018. 8. 14. · The Criterion for Euler Paths Suppose that a graph has an Euler path P. For every vertex v other than the starting](https://reader033.fdocuments.in/reader033/viewer/2022060101/60b2ff9044763474022f7747/html5/thumbnails/18.jpg)
The Criterion for Euler Circuits
I Suppose that a graph G has an Euler circuit C .
I For every vertex v in G , each edge having v as anendpoint shows up exactly once in C .
I The circuit C enters v the same number of times that itleaves v (say s times), so v has degree 2s.
I That is, v must be an even vertex.
![Page 19: Euler Paths and Euler Circuits - Jeremy L. Martin · 2018. 8. 14. · The Criterion for Euler Paths Suppose that a graph has an Euler path P. For every vertex v other than the starting](https://reader033.fdocuments.in/reader033/viewer/2022060101/60b2ff9044763474022f7747/html5/thumbnails/19.jpg)
The Criterion for Euler Circuits
The inescapable conclusion (“based on reason alone”):
If a graph G has an Euler circuit, then all of its verticesmust be even vertices.
Or, to put it another way,
If the number of odd vertices in G is anything otherthan 0, then G cannot have an Euler circuit.
![Page 20: Euler Paths and Euler Circuits - Jeremy L. Martin · 2018. 8. 14. · The Criterion for Euler Paths Suppose that a graph has an Euler path P. For every vertex v other than the starting](https://reader033.fdocuments.in/reader033/viewer/2022060101/60b2ff9044763474022f7747/html5/thumbnails/20.jpg)
Things You Should Be Wondering
I Does every graph with zero odd vertices have an Eulercircuit?
I Does every graph with two odd vertices have an Eulerpath?
I Is it possible for a graph have just one odd vertex?
![Page 21: Euler Paths and Euler Circuits - Jeremy L. Martin · 2018. 8. 14. · The Criterion for Euler Paths Suppose that a graph has an Euler path P. For every vertex v other than the starting](https://reader033.fdocuments.in/reader033/viewer/2022060101/60b2ff9044763474022f7747/html5/thumbnails/21.jpg)
How Many Odd Vertices?
![Page 22: Euler Paths and Euler Circuits - Jeremy L. Martin · 2018. 8. 14. · The Criterion for Euler Paths Suppose that a graph has an Euler path P. For every vertex v other than the starting](https://reader033.fdocuments.in/reader033/viewer/2022060101/60b2ff9044763474022f7747/html5/thumbnails/22.jpg)
How Many Odd Vertices?
Odd vertices
![Page 23: Euler Paths and Euler Circuits - Jeremy L. Martin · 2018. 8. 14. · The Criterion for Euler Paths Suppose that a graph has an Euler path P. For every vertex v other than the starting](https://reader033.fdocuments.in/reader033/viewer/2022060101/60b2ff9044763474022f7747/html5/thumbnails/23.jpg)
How Many Odd Vertices?
86
2 4 8
6Number of odd vertices
![Page 24: Euler Paths and Euler Circuits - Jeremy L. Martin · 2018. 8. 14. · The Criterion for Euler Paths Suppose that a graph has an Euler path P. For every vertex v other than the starting](https://reader033.fdocuments.in/reader033/viewer/2022060101/60b2ff9044763474022f7747/html5/thumbnails/24.jpg)
The Handshaking Theorem
The Handshaking Theorem says that
In every graph, the sum of the degrees of all verticesequals twice the number of edges.
If there are n vertices V1, . . . ,Vn, with degrees d1, . . . , dn, andthere are e edges, then
d1 + d2 + · · · + dn−1 + dn = 2e
Or, equivalently,
e =d1 + d2 + · · · + dn−1 + dn
2
![Page 25: Euler Paths and Euler Circuits - Jeremy L. Martin · 2018. 8. 14. · The Criterion for Euler Paths Suppose that a graph has an Euler path P. For every vertex v other than the starting](https://reader033.fdocuments.in/reader033/viewer/2022060101/60b2ff9044763474022f7747/html5/thumbnails/25.jpg)
The Handshaking Theorem
Why “Handshaking”?
If n people shake hands, and the i th person shakes hands ditimes, then the total number of handshakes that take place is
d1 + d2 + · · · + dn−1 + dn2
.
(How come? Each handshake involves two people, so thenumber d1 + d2 + · · · + dn−1 + dn counts every handshaketwice.)
![Page 26: Euler Paths and Euler Circuits - Jeremy L. Martin · 2018. 8. 14. · The Criterion for Euler Paths Suppose that a graph has an Euler path P. For every vertex v other than the starting](https://reader033.fdocuments.in/reader033/viewer/2022060101/60b2ff9044763474022f7747/html5/thumbnails/26.jpg)
The Number of Odd Vertices
I The number of edges in a graph is
d1 + d2 + · · · + dn2
which must be an integer.
I Therefore, d1 + d2 + · · · + dn must be an even number.
I Therefore, the numbers d1, d2, · · · , dn must include aneven number of odd numbers.
I Every graph has an even number of odd vertices!
![Page 27: Euler Paths and Euler Circuits - Jeremy L. Martin · 2018. 8. 14. · The Criterion for Euler Paths Suppose that a graph has an Euler path P. For every vertex v other than the starting](https://reader033.fdocuments.in/reader033/viewer/2022060101/60b2ff9044763474022f7747/html5/thumbnails/27.jpg)
The Number of Odd Vertices
I The number of edges in a graph is
d1 + d2 + · · · + dn2
which must be an integer.
I Therefore, d1 + d2 + · · · + dn must be an even number.
I Therefore, the numbers d1, d2, · · · , dn must include aneven number of odd numbers.
I Every graph has an even number of odd vertices!
![Page 28: Euler Paths and Euler Circuits - Jeremy L. Martin · 2018. 8. 14. · The Criterion for Euler Paths Suppose that a graph has an Euler path P. For every vertex v other than the starting](https://reader033.fdocuments.in/reader033/viewer/2022060101/60b2ff9044763474022f7747/html5/thumbnails/28.jpg)
The Number of Odd Vertices
I The number of edges in a graph is
d1 + d2 + · · · + dn2
which must be an integer.
I Therefore, d1 + d2 + · · · + dn must be an even number.
I Therefore, the numbers d1, d2, · · · , dn must include aneven number of odd numbers.
I Every graph has an even number of odd vertices!
![Page 29: Euler Paths and Euler Circuits - Jeremy L. Martin · 2018. 8. 14. · The Criterion for Euler Paths Suppose that a graph has an Euler path P. For every vertex v other than the starting](https://reader033.fdocuments.in/reader033/viewer/2022060101/60b2ff9044763474022f7747/html5/thumbnails/29.jpg)
The Number of Odd Vertices
I The number of edges in a graph is
d1 + d2 + · · · + dn2
which must be an integer.
I Therefore, d1 + d2 + · · · + dn must be an even number.
I Therefore, the numbers d1, d2, · · · , dn must include aneven number of odd numbers.
I Every graph has an even number of odd vertices!
![Page 30: Euler Paths and Euler Circuits - Jeremy L. Martin · 2018. 8. 14. · The Criterion for Euler Paths Suppose that a graph has an Euler path P. For every vertex v other than the starting](https://reader033.fdocuments.in/reader033/viewer/2022060101/60b2ff9044763474022f7747/html5/thumbnails/30.jpg)
Back to Euler Paths and Circuits
Here’s what we know so far:
# odd vertices Euler path? Euler circuit?
0 No Maybe
2 Maybe No
4, 6, 8, . . . No No
1, 3, 5, . . . No such graphs exist!
Can we give a better answer than “maybe”?
![Page 31: Euler Paths and Euler Circuits - Jeremy L. Martin · 2018. 8. 14. · The Criterion for Euler Paths Suppose that a graph has an Euler path P. For every vertex v other than the starting](https://reader033.fdocuments.in/reader033/viewer/2022060101/60b2ff9044763474022f7747/html5/thumbnails/31.jpg)
Euler Paths and Circuits — The Last Word
Here is the answer Euler gave:
# odd vertices Euler path? Euler circuit?
0 No Yes*2 Yes* No
4, 6, 8, . . . No No
1, 3, 5, No such graphs exist
* Provided the graph is connected.
Next question: If an Euler path or circuit exists, how doyou find it?
![Page 32: Euler Paths and Euler Circuits - Jeremy L. Martin · 2018. 8. 14. · The Criterion for Euler Paths Suppose that a graph has an Euler path P. For every vertex v other than the starting](https://reader033.fdocuments.in/reader033/viewer/2022060101/60b2ff9044763474022f7747/html5/thumbnails/32.jpg)
Euler Paths and Circuits — The Last Word
Here is the answer Euler gave:
# odd vertices Euler path? Euler circuit?
0 No Yes*2 Yes* No
4, 6, 8, . . . No No
1, 3, 5, No such graphs exist
* Provided the graph is connected.
Next question: If an Euler path or circuit exists, how doyou find it?
![Page 33: Euler Paths and Euler Circuits - Jeremy L. Martin · 2018. 8. 14. · The Criterion for Euler Paths Suppose that a graph has an Euler path P. For every vertex v other than the starting](https://reader033.fdocuments.in/reader033/viewer/2022060101/60b2ff9044763474022f7747/html5/thumbnails/33.jpg)
Bridges
Removing a single edge from a connected graph can make it
disconnected. Such an edge is called a bridge.
![Page 34: Euler Paths and Euler Circuits - Jeremy L. Martin · 2018. 8. 14. · The Criterion for Euler Paths Suppose that a graph has an Euler path P. For every vertex v other than the starting](https://reader033.fdocuments.in/reader033/viewer/2022060101/60b2ff9044763474022f7747/html5/thumbnails/34.jpg)
Bridges
Removing a single edge from a connected graph can make it
disconnected. Such an edge is called a bridge.
![Page 35: Euler Paths and Euler Circuits - Jeremy L. Martin · 2018. 8. 14. · The Criterion for Euler Paths Suppose that a graph has an Euler path P. For every vertex v other than the starting](https://reader033.fdocuments.in/reader033/viewer/2022060101/60b2ff9044763474022f7747/html5/thumbnails/35.jpg)
Bridges
Removing a single edge from a connected graph can make it
disconnected. Such an edge is called a bridge.
![Page 36: Euler Paths and Euler Circuits - Jeremy L. Martin · 2018. 8. 14. · The Criterion for Euler Paths Suppose that a graph has an Euler path P. For every vertex v other than the starting](https://reader033.fdocuments.in/reader033/viewer/2022060101/60b2ff9044763474022f7747/html5/thumbnails/36.jpg)
Bridges
Loops cannot be bridges, because removing a loop from agraph cannot make it disconnected.
deleteloop e
e
![Page 37: Euler Paths and Euler Circuits - Jeremy L. Martin · 2018. 8. 14. · The Criterion for Euler Paths Suppose that a graph has an Euler path P. For every vertex v other than the starting](https://reader033.fdocuments.in/reader033/viewer/2022060101/60b2ff9044763474022f7747/html5/thumbnails/37.jpg)
Bridges
If two or more edges share both endpoints, then removing anyone of them cannot make the graph disconnected. Therefore,none of those edges is a bridge.
edgesA
C
D
B
multiple
delete
![Page 38: Euler Paths and Euler Circuits - Jeremy L. Martin · 2018. 8. 14. · The Criterion for Euler Paths Suppose that a graph has an Euler path P. For every vertex v other than the starting](https://reader033.fdocuments.in/reader033/viewer/2022060101/60b2ff9044763474022f7747/html5/thumbnails/38.jpg)
Bridges
If two or more edges share both endpoints, then removing anyone of them cannot make the graph disconnected. Therefore,none of those edges is a bridge.
edgesA
C
D
B
multiple
delete
![Page 39: Euler Paths and Euler Circuits - Jeremy L. Martin · 2018. 8. 14. · The Criterion for Euler Paths Suppose that a graph has an Euler path P. For every vertex v other than the starting](https://reader033.fdocuments.in/reader033/viewer/2022060101/60b2ff9044763474022f7747/html5/thumbnails/39.jpg)
Finding Euler Circuits and Paths
“Don’t burn your bridges.”
![Page 40: Euler Paths and Euler Circuits - Jeremy L. Martin · 2018. 8. 14. · The Criterion for Euler Paths Suppose that a graph has an Euler path P. For every vertex v other than the starting](https://reader033.fdocuments.in/reader033/viewer/2022060101/60b2ff9044763474022f7747/html5/thumbnails/40.jpg)
Finding Euler Circuits and Paths
Problem: Find an Euler circuit in the graph below.
A
B
FE
DC
![Page 41: Euler Paths and Euler Circuits - Jeremy L. Martin · 2018. 8. 14. · The Criterion for Euler Paths Suppose that a graph has an Euler path P. For every vertex v other than the starting](https://reader033.fdocuments.in/reader033/viewer/2022060101/60b2ff9044763474022f7747/html5/thumbnails/41.jpg)
Finding Euler Circuits and Paths
There are two odd vertices, A and F. Let’s start at F.
A
B
FE
DC
![Page 42: Euler Paths and Euler Circuits - Jeremy L. Martin · 2018. 8. 14. · The Criterion for Euler Paths Suppose that a graph has an Euler path P. For every vertex v other than the starting](https://reader033.fdocuments.in/reader033/viewer/2022060101/60b2ff9044763474022f7747/html5/thumbnails/42.jpg)
Finding Euler Circuits and Paths
Start walking at F. When you use an edge, delete it.
A
B
FE
DC
![Page 43: Euler Paths and Euler Circuits - Jeremy L. Martin · 2018. 8. 14. · The Criterion for Euler Paths Suppose that a graph has an Euler path P. For every vertex v other than the starting](https://reader033.fdocuments.in/reader033/viewer/2022060101/60b2ff9044763474022f7747/html5/thumbnails/43.jpg)
Finding Euler Circuits and Paths
Path so far: FE
A
B
FE
DC
![Page 44: Euler Paths and Euler Circuits - Jeremy L. Martin · 2018. 8. 14. · The Criterion for Euler Paths Suppose that a graph has an Euler path P. For every vertex v other than the starting](https://reader033.fdocuments.in/reader033/viewer/2022060101/60b2ff9044763474022f7747/html5/thumbnails/44.jpg)
Finding Euler Circuits and Paths
Path so far: FEA
A
B
FE
DC
![Page 45: Euler Paths and Euler Circuits - Jeremy L. Martin · 2018. 8. 14. · The Criterion for Euler Paths Suppose that a graph has an Euler path P. For every vertex v other than the starting](https://reader033.fdocuments.in/reader033/viewer/2022060101/60b2ff9044763474022f7747/html5/thumbnails/45.jpg)
Finding Euler Circuits and Paths
Path so far: FEAC
A
B
FE
DC
![Page 46: Euler Paths and Euler Circuits - Jeremy L. Martin · 2018. 8. 14. · The Criterion for Euler Paths Suppose that a graph has an Euler path P. For every vertex v other than the starting](https://reader033.fdocuments.in/reader033/viewer/2022060101/60b2ff9044763474022f7747/html5/thumbnails/46.jpg)
Finding Euler Circuits and Paths
Path so far: FEACB
A
B
FE
DC
![Page 47: Euler Paths and Euler Circuits - Jeremy L. Martin · 2018. 8. 14. · The Criterion for Euler Paths Suppose that a graph has an Euler path P. For every vertex v other than the starting](https://reader033.fdocuments.in/reader033/viewer/2022060101/60b2ff9044763474022f7747/html5/thumbnails/47.jpg)
Finding Euler Circuits and Paths
Up until this point, the choices didn’t matter.
But now, crossing the edge BA would be a mistake, becausewe would be stuck there.
The reason is that BA is a bridge. We don’t want to cross(“burn”?) a bridge unless it is the only edge available.
![Page 48: Euler Paths and Euler Circuits - Jeremy L. Martin · 2018. 8. 14. · The Criterion for Euler Paths Suppose that a graph has an Euler path P. For every vertex v other than the starting](https://reader033.fdocuments.in/reader033/viewer/2022060101/60b2ff9044763474022f7747/html5/thumbnails/48.jpg)
Finding Euler Circuits and Paths
Up until this point, the choices didn’t matter.
But now, crossing the edge BA would be a mistake, becausewe would be stuck there.
The reason is that BA is a bridge. We don’t want to cross(“burn”?) a bridge unless it is the only edge available.
![Page 49: Euler Paths and Euler Circuits - Jeremy L. Martin · 2018. 8. 14. · The Criterion for Euler Paths Suppose that a graph has an Euler path P. For every vertex v other than the starting](https://reader033.fdocuments.in/reader033/viewer/2022060101/60b2ff9044763474022f7747/html5/thumbnails/49.jpg)
Finding Euler Circuits and Paths
Up until this point, the choices didn’t matter.
But now, crossing the edge BA would be a mistake, becausewe would be stuck there.
The reason is that BA is a bridge. We don’t want to cross(“burn”?) a bridge unless it is the only edge available.
![Page 50: Euler Paths and Euler Circuits - Jeremy L. Martin · 2018. 8. 14. · The Criterion for Euler Paths Suppose that a graph has an Euler path P. For every vertex v other than the starting](https://reader033.fdocuments.in/reader033/viewer/2022060101/60b2ff9044763474022f7747/html5/thumbnails/50.jpg)
Finding Euler Circuits and Paths
Path so far: FEACB
A
B
FE
DC
![Page 51: Euler Paths and Euler Circuits - Jeremy L. Martin · 2018. 8. 14. · The Criterion for Euler Paths Suppose that a graph has an Euler path P. For every vertex v other than the starting](https://reader033.fdocuments.in/reader033/viewer/2022060101/60b2ff9044763474022f7747/html5/thumbnails/51.jpg)
Finding Euler Circuits and Paths
Path so far: FEACBD.
A
B
FE
DC
![Page 52: Euler Paths and Euler Circuits - Jeremy L. Martin · 2018. 8. 14. · The Criterion for Euler Paths Suppose that a graph has an Euler path P. For every vertex v other than the starting](https://reader033.fdocuments.in/reader033/viewer/2022060101/60b2ff9044763474022f7747/html5/thumbnails/52.jpg)
Finding Euler Circuits and Paths
Path so far: FEACBD. Don’t cross the bridge!
A
B
FE
DC
![Page 53: Euler Paths and Euler Circuits - Jeremy L. Martin · 2018. 8. 14. · The Criterion for Euler Paths Suppose that a graph has an Euler path P. For every vertex v other than the starting](https://reader033.fdocuments.in/reader033/viewer/2022060101/60b2ff9044763474022f7747/html5/thumbnails/53.jpg)
Finding Euler Circuits and Paths
Path so far: FEACBDC
A
B
FE
DC
![Page 54: Euler Paths and Euler Circuits - Jeremy L. Martin · 2018. 8. 14. · The Criterion for Euler Paths Suppose that a graph has an Euler path P. For every vertex v other than the starting](https://reader033.fdocuments.in/reader033/viewer/2022060101/60b2ff9044763474022f7747/html5/thumbnails/54.jpg)
Finding Euler Circuits and Paths
Path so far: FEACBDC Now we have to cross the bridge CF.
A
B
FE
DC
![Page 55: Euler Paths and Euler Circuits - Jeremy L. Martin · 2018. 8. 14. · The Criterion for Euler Paths Suppose that a graph has an Euler path P. For every vertex v other than the starting](https://reader033.fdocuments.in/reader033/viewer/2022060101/60b2ff9044763474022f7747/html5/thumbnails/55.jpg)
Finding Euler Circuits and Paths
Path so far: FEACBDCF
A
B
FE
DC
![Page 56: Euler Paths and Euler Circuits - Jeremy L. Martin · 2018. 8. 14. · The Criterion for Euler Paths Suppose that a graph has an Euler path P. For every vertex v other than the starting](https://reader033.fdocuments.in/reader033/viewer/2022060101/60b2ff9044763474022f7747/html5/thumbnails/56.jpg)
Finding Euler Circuits and Paths
Path so far: FEACBDCFD
A
B
FE
DC
![Page 57: Euler Paths and Euler Circuits - Jeremy L. Martin · 2018. 8. 14. · The Criterion for Euler Paths Suppose that a graph has an Euler path P. For every vertex v other than the starting](https://reader033.fdocuments.in/reader033/viewer/2022060101/60b2ff9044763474022f7747/html5/thumbnails/57.jpg)
Finding Euler Circuits and Paths
Path so far: FEACBDCFDB
A
B
FE
DC
![Page 58: Euler Paths and Euler Circuits - Jeremy L. Martin · 2018. 8. 14. · The Criterion for Euler Paths Suppose that a graph has an Euler path P. For every vertex v other than the starting](https://reader033.fdocuments.in/reader033/viewer/2022060101/60b2ff9044763474022f7747/html5/thumbnails/58.jpg)
Finding Euler Circuits and Paths
Euler Path: FEACBDCFDBA
A
B
FE
DC
![Page 59: Euler Paths and Euler Circuits - Jeremy L. Martin · 2018. 8. 14. · The Criterion for Euler Paths Suppose that a graph has an Euler path P. For every vertex v other than the starting](https://reader033.fdocuments.in/reader033/viewer/2022060101/60b2ff9044763474022f7747/html5/thumbnails/59.jpg)
Finding Euler Circuits and Paths
Euler Path: FEACBDCFDBA
A
B
FE
DC
![Page 60: Euler Paths and Euler Circuits - Jeremy L. Martin · 2018. 8. 14. · The Criterion for Euler Paths Suppose that a graph has an Euler path P. For every vertex v other than the starting](https://reader033.fdocuments.in/reader033/viewer/2022060101/60b2ff9044763474022f7747/html5/thumbnails/60.jpg)
Fleury’s Algorithm
To find an Euler path or an Euler circuit:
1. Make sure the graph has either 0 or 2 odd vertices.
2. If there are 0 odd vertices, start anywhere. If there are 2odd vertices, start at one of them.
3. Follow edges one at a time. If you have a choice betweena bridge and a non-bridge, always choose the non-bridge.
4. Stop when you run out of edges.
This is called Fleury’s algorithm, and it always works!
![Page 61: Euler Paths and Euler Circuits - Jeremy L. Martin · 2018. 8. 14. · The Criterion for Euler Paths Suppose that a graph has an Euler path P. For every vertex v other than the starting](https://reader033.fdocuments.in/reader033/viewer/2022060101/60b2ff9044763474022f7747/html5/thumbnails/61.jpg)
Fleury’s Algorithm
To find an Euler path or an Euler circuit:
1. Make sure the graph has either 0 or 2 odd vertices.
2. If there are 0 odd vertices, start anywhere. If there are 2odd vertices, start at one of them.
3. Follow edges one at a time. If you have a choice betweena bridge and a non-bridge, always choose the non-bridge.
4. Stop when you run out of edges.
This is called Fleury’s algorithm, and it always works!
![Page 62: Euler Paths and Euler Circuits - Jeremy L. Martin · 2018. 8. 14. · The Criterion for Euler Paths Suppose that a graph has an Euler path P. For every vertex v other than the starting](https://reader033.fdocuments.in/reader033/viewer/2022060101/60b2ff9044763474022f7747/html5/thumbnails/62.jpg)
Fleury’s Algorithm
To find an Euler path or an Euler circuit:
1. Make sure the graph has either 0 or 2 odd vertices.
2. If there are 0 odd vertices, start anywhere. If there are 2odd vertices, start at one of them.
3. Follow edges one at a time. If you have a choice betweena bridge and a non-bridge, always choose the non-bridge.
4. Stop when you run out of edges.
This is called Fleury’s algorithm, and it always works!
![Page 63: Euler Paths and Euler Circuits - Jeremy L. Martin · 2018. 8. 14. · The Criterion for Euler Paths Suppose that a graph has an Euler path P. For every vertex v other than the starting](https://reader033.fdocuments.in/reader033/viewer/2022060101/60b2ff9044763474022f7747/html5/thumbnails/63.jpg)
Fleury’s Algorithm
To find an Euler path or an Euler circuit:
1. Make sure the graph has either 0 or 2 odd vertices.
2. If there are 0 odd vertices, start anywhere. If there are 2odd vertices, start at one of them.
3. Follow edges one at a time. If you have a choice betweena bridge and a non-bridge, always choose the non-bridge.
4. Stop when you run out of edges.
This is called Fleury’s algorithm, and it always works!
![Page 64: Euler Paths and Euler Circuits - Jeremy L. Martin · 2018. 8. 14. · The Criterion for Euler Paths Suppose that a graph has an Euler path P. For every vertex v other than the starting](https://reader033.fdocuments.in/reader033/viewer/2022060101/60b2ff9044763474022f7747/html5/thumbnails/64.jpg)
Fleury’s Algorithm
To find an Euler path or an Euler circuit:
1. Make sure the graph has either 0 or 2 odd vertices.
2. If there are 0 odd vertices, start anywhere. If there are 2odd vertices, start at one of them.
3. Follow edges one at a time. If you have a choice betweena bridge and a non-bridge, always choose the non-bridge.
4. Stop when you run out of edges.
This is called Fleury’s algorithm, and it always works!
![Page 65: Euler Paths and Euler Circuits - Jeremy L. Martin · 2018. 8. 14. · The Criterion for Euler Paths Suppose that a graph has an Euler path P. For every vertex v other than the starting](https://reader033.fdocuments.in/reader033/viewer/2022060101/60b2ff9044763474022f7747/html5/thumbnails/65.jpg)
Fleury’s Algorithm
To find an Euler path or an Euler circuit:
1. Make sure the graph has either 0 or 2 odd vertices.
2. If there are 0 odd vertices, start anywhere. If there are 2odd vertices, start at one of them.
3. Follow edges one at a time. If you have a choice betweena bridge and a non-bridge, always choose the non-bridge.
4. Stop when you run out of edges.
This is called Fleury’s algorithm, and it always works!
![Page 66: Euler Paths and Euler Circuits - Jeremy L. Martin · 2018. 8. 14. · The Criterion for Euler Paths Suppose that a graph has an Euler path P. For every vertex v other than the starting](https://reader033.fdocuments.in/reader033/viewer/2022060101/60b2ff9044763474022f7747/html5/thumbnails/66.jpg)
Fleury’s Algorithm: Another Example
G
K LJ M
HE
A
F
CBD
NO P
Q