Presentation is loading. Please wait.

Presentation is loading. Please wait.

Euler Paths & Euler Circuits

Similar presentations


Presentation on theme: "Euler Paths & Euler Circuits"— Presentation transcript:

1 Euler Paths & Euler Circuits
Graph Theory Euler Paths & Euler Circuits

2 WHAT YOU WILL LEARN • Euler paths and Euler circuits
• Fleury’s Algorithm

3 Definitions An Euler path is a path that passes through each edge of a graph exactly one time. An Euler circuit is a circuit that passes through each edge of a graph exactly one time. The difference between an Euler path and an Euler circuit is that an Euler circuit must start and end at the same vertex.

4 Examples Euler path D, E, B, C, A, B, D, C, E Euler circuit
D, E, B, C, A, B, D, C, E, F, D

5 Example: Euler Path and Circuits
For the graphs shown, determine if an Euler path, an Euler circuit, neither, or both exist. A B C D A B C D E The graph has an Euler path but it does not have an Euler circuit. One Euler path is E, C, B, E, D, B, A, D. Each path must begin or end at vertex D or E. This graph has two odd vertices. The graph has many Euler circuits, each of which is also an Euler path. This graph has no odd vertices. One example is A, D, B, C, D, B, A.

6 Euler’s Theorem For a connected graph, the following statements are true: 1. A graph with no odd vertices (all even vertices) has at least one Euler path, which is also an Euler circuit. An Euler circuit can be started at any vertex and it will end at the same vertex. 2. A graph with exactly two odd vertices has at least one Euler path but no Euler circuits. Each Euler path must begin at one of the two odd vertices, and it will end at the other odd vertex. 3. A graph with more than two odd vertices has neither an Euler path nor an Euler circuit.

7 Example: Using Euler’s Theorem
Use Euler’s theorem to determine whether an Euler path or an Euler circuit exists in the figures shown from the previous example. A B C D

8 Example: Using Euler’s Theorem (continued)
B C D The graph has no odd vertices (all vertices are even). According to item 1, at least one Euler circuit exists. An Euler circuit can be determined by starting at any vertex. The Euler circuit will end at the vertex from which it started. Remember that each Euler circuit is also an Euler path.

9 Example: Using Euler’s Theorem (continued)
B C D E There are 3 even vertices (A, B, C) and two odd vertices (D, E). Based on item 2, we conclude that since there are exactly two odd vertices, at least one Euler path exists but no Euler circuits exist. Each Euler path must begin at one of the odd vertices and end at the other odd vertex.

10 Example a) Is it possible to travel among the states and cross each common state border exactly one time? b) If it is possible, can he start and end in the same state? Michigan Ohio Indiana Kentucky West Virginia

11 Solution MI OH IN KY WV We are looking for an Euler path, you must use each edge exactly one time. There are two odd vertices. Therefore, according to item 2, the graph has at least one Euler path but no Euler circuits Therefore, yes, it is possible to travel among these states and cross each common border exactly one time. The researcher must start in either IN or KY and end in the other state. There is not an Euler circuit, so the researcher cannot start and end in the same state.

12 Fleury’s Algorithm To determine an Euler path or an Euler circuit:
1. Use Euler’s theorem to determine whether an Euler path or an Euler circuit exists. If one exists, proceed with steps 2-5. 2. If the graph has no odd vertices (therefore has an Euler circuit, which is also an Euler path), choose any vertex as the starting point. If the graph has exactly two odd vertices (therefore has only an Euler path), choose one of the two odd vertices as the starting point.

13 Fleury’s Algorithm (continued)
3. Begin to trace edges as you move through the graph. Number the edges as you trace them. Since you can’t trace any edges twice in Euler paths and Euler circuits, once an edge is traced consider it “invisible.” 4. When faced with a choice of edges to trace, if possible, choose an edge that is not a bridge (i.e., don’t create a disconnected graph with your choice of edges). 5. Continue until each edge of the entire graph has been traced once.

14 Example Use Fluery’s algorithm to determine an Euler circuit.
There is at least one Euler circuit since there are no odd vertices. Start at any vertex to determine an Euler circuit. A B C D E F G

15 Example (continued) Start at C.
B C D E F G 1 2 3 4 5 6 7 8 9 10 start here Start at C. Choose either CB or CD. Continue to trace from vertex to vertex around the outside of the graph.

16 In the following graph, determine an Euler circuit.
a. CBAECDA b. CBAECDAC c. EABCDA d. AEABCD

17 In the following graph, determine an Euler circuit.
a. CBAECDA b. CBAECDAC c. EABCDA d. AEABCD

18 Is it possible for a person to walk through each doorway in the house, whose floor plan is shown below, without using any of the doorways twice? If so, indicate which room the person may start and where he or she will end. a. Yes; A-G b. Yes; A-C c. Yes; C- G d. No

19 Is it possible for a person to walk through each doorway in the house, whose floor plan is shown below, without using any of the doorways twice? If so, indicate which room the person may start and where he or she will end. a. Yes; A-G b. Yes; A-C c. Yes; C- G d. No

20 Use Fleury’s algorithm to determine an Euler circuit in the following graph.
a. BCFAEDA b. DABCFAE c. EDABCFA d. AEDABCFA

21 Use Fleury’s algorithm to determine an Euler circuit in the following graph.
a. BCFAEDA b. DABCFAE c. EDABCFA d. AEDABCFA


Download ppt "Euler Paths & Euler Circuits"

Similar presentations


Ads by Google