+ All Categories
Home > Documents > Chapter 14 Section 2 - Slide 1 Copyright © 2009 Pearson Education, Inc. AND.

Chapter 14 Section 2 - Slide 1 Copyright © 2009 Pearson Education, Inc. AND.

Date post: 19-Jan-2016
Category:
Upload: james-holmes
View: 218 times
Download: 0 times
Share this document with a friend
19
Chapter 14 Section 2 - Slide 1 Copyright © 2009 Pearson Education, Inc. AND
Transcript
Page 1: Chapter 14 Section 2 - Slide 1 Copyright © 2009 Pearson Education, Inc. AND.

Chapter 14 Section 2 - Slide 1Copyright © 2009 Pearson Education, Inc.

AND

Page 2: Chapter 14 Section 2 - Slide 1 Copyright © 2009 Pearson Education, Inc. AND.

Copyright © 2009 Pearson Education, Inc. Chapter 14 Section 2 - Slide 2

Chapter 14

Graph Theory

Page 3: Chapter 14 Section 2 - Slide 1 Copyright © 2009 Pearson Education, Inc. AND.

Chapter 14 Section 2 - Slide 3Copyright © 2009 Pearson Education, Inc.

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

Page 4: Chapter 14 Section 2 - Slide 1 Copyright © 2009 Pearson Education, Inc. AND.

Chapter 14 Section 2 - Slide 4Copyright © 2009 Pearson Education, Inc.

WHAT YOU WILL LEARN

• Nearest neighbor method• Trees, spanning trees, and

minimum-cost spanning trees

Page 5: Chapter 14 Section 2 - Slide 1 Copyright © 2009 Pearson Education, Inc. AND.

Copyright © 2009 Pearson Education, Inc. Chapter 14 Section 2 - Slide 5

Section 2

Euler Paths and Euler Circuits

Page 6: Chapter 14 Section 2 - Slide 1 Copyright © 2009 Pearson Education, Inc. AND.

Chapter 14 Section 2 - Slide 6Copyright © 2009 Pearson Education, Inc.

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.

Page 7: Chapter 14 Section 2 - Slide 1 Copyright © 2009 Pearson Education, Inc. AND.

Chapter 14 Section 2 - Slide 7Copyright © 2009 Pearson Education, Inc.

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

Page 8: Chapter 14 Section 2 - Slide 1 Copyright © 2009 Pearson Education, Inc. AND.

Chapter 14 Section 2 - Slide 8Copyright © 2009 Pearson Education, Inc.

Example: Euler Path and Circuits

For the graphs shown, determine if an Euler path, an Euler circuit, neither, or both exist.

A BC

D

A B C

DE

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.

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.

Page 9: Chapter 14 Section 2 - Slide 1 Copyright © 2009 Pearson Education, Inc. AND.

Chapter 14 Section 2 - Slide 9Copyright © 2009 Pearson Education, Inc.

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.

Page 10: Chapter 14 Section 2 - Slide 1 Copyright © 2009 Pearson Education, Inc. AND.

Chapter 14 Section 2 - Slide 10Copyright © 2009 Pearson Education, Inc.

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.

Page 11: Chapter 14 Section 2 - Slide 1 Copyright © 2009 Pearson Education, Inc. AND.

Chapter 14 Section 2 - Slide 11Copyright © 2009 Pearson Education, Inc.

Example: Using Euler’s Theorem (continued) 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.

AB

C

D

Page 12: Chapter 14 Section 2 - Slide 1 Copyright © 2009 Pearson Education, Inc. AND.

Chapter 14 Section 2 - Slide 12Copyright © 2009 Pearson Education, Inc.

Example: Using Euler’s Theorem (continued)

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.

A B C

DE

Page 13: Chapter 14 Section 2 - Slide 1 Copyright © 2009 Pearson Education, Inc. AND.

Chapter 14 Section 2 - Slide 13Copyright © 2009 Pearson Education, Inc.

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.

Page 14: Chapter 14 Section 2 - Slide 1 Copyright © 2009 Pearson Education, Inc. AND.

Chapter 14 Section 2 - Slide 14Copyright © 2009 Pearson Education, Inc.

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?

Page 15: Chapter 14 Section 2 - Slide 1 Copyright © 2009 Pearson Education, Inc. AND.

Chapter 14 Section 2 - Slide 15Copyright © 2009 Pearson Education, Inc.

Solution

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.

MI

OH

IN

KY WV

Page 16: Chapter 14 Section 2 - Slide 1 Copyright © 2009 Pearson Education, Inc. AND.

Chapter 14 Section 2 - Slide 16Copyright © 2009 Pearson Education, Inc.

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.

Page 17: Chapter 14 Section 2 - Slide 1 Copyright © 2009 Pearson Education, Inc. AND.

Chapter 14 Section 2 - Slide 17Copyright © 2009 Pearson Education, Inc.

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.

Page 18: Chapter 14 Section 2 - Slide 1 Copyright © 2009 Pearson Education, Inc. AND.

Chapter 14 Section 2 - Slide 18Copyright © 2009 Pearson Education, Inc.

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.

AB

C

D

E

FG

Page 19: Chapter 14 Section 2 - Slide 1 Copyright © 2009 Pearson Education, Inc. AND.

Chapter 14 Section 2 - Slide 19Copyright © 2009 Pearson Education, Inc.

Example (continued)

Start at C. Choose either CB or CD.

Continue to trace from vertex to vertex around the outside of the graph.

A

BC

D

E

FG

1

23

4

5

6

7

8

9

10

start here


Recommended