Presentation is loading. Please wait.

Presentation is loading. Please wait.

AND.

Similar presentations


Presentation on theme: "AND."— Presentation transcript:

1 AND

2 Chapter 14 Graph Theory

3 WHAT YOU WILL LEARN • Graphs, paths and circuits
• The Königsberg bridge problem • Euler paths and Euler circuits • Hamilton paths and Hamilton circuits • Traveling salesman problem • Brute force method

4 WHAT YOU WILL LEARN • Nearest neighbor method
• Trees, spanning trees, and minimum-cost spanning trees

5 Euler Paths and Euler Circuits
Section 2 Euler Paths and Euler Circuits

6 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.

7 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

8 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.

9 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.

10 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.

11 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.

12 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.

13 Example In the first example of section 14.1, we discussed some of the states that make up the Midwest region of the weather map from Weather Underground. We drew a graph that showed the states that share a common border. One of the researchers wants to visit each state within the mapped region. To plan the most efficient trip, the researcher wishes to travel between these states and cross each common state border exactly one time.

14 Example (continued) 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?

15 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.

16 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.

17 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.

18 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

19 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.


Download ppt "AND."

Similar presentations


Ads by Google