You are on page 1of 22

4/19/21

CHAPTER

6
The Mathematics
of Graphs

Copyright © Cengage Learning. All rights reserved.

6.1
Section Graphs and Euler Circuits

Copyright © Cengage Learning. All rights reserved.

1
4/19/21

Introduction to Graphs

Introduction to Graphs
Think of all the various connections we experience in our
lives—friends are connected on Facebook, cities are
connected by roads, computers are connected across the
Internet.

A branch of mathematics called graph theory illustrates


and analyzes connections such as these.

For example, the diagram in


Figure 5.1 could represent
friends that are connected
on Facebook.
Figure 5.1
4

2
4/19/21

Introduction to Graphs
Each dot represents a person, and a line segment
connecting two dots means that those two people are
friends on Facebook.

This type of diagram is called a graph.

Example 1 – Constructing a Graph


The following table lists five students at a college. An “X”
indicates that the two students participate in the same
study group this semester.

3
4/19/21

Example 1 – Constructing a Graph cont’d


a. Draw a graph that represents this information where
each vertex represents a student and an edge connects
two vertices if the corresponding students study
together.

b. Use your graph to answer the following questions: Which


student is involved in the most study groups with the
others? Which student has only one study group in
common with the others? How many study groups does
Laura have in common with the others?

a. We draw five vertices (in any configuration we wish) to


represent the five students, and connect vertices with edges
according to the table.

4
4/19/21

cont’d
b. The vertex corresponding to Amber is connected to more edges than the
others, so she is involved with more study groups (three) than the others.

Kayla is the only student with one study group in common, as her vertex
is the only one connected to just one edge. Laura’s vertex is connected to
two edges, so she shares two study groups with the others.

10

10

5
4/19/21

Answer

11

11

Introduction to Graphs
In general, a graph can include vertices that are not joined
to any edges, but all edges must begin and end at vertices.
If two or more edges connect the same vertices, they are
called multiple edges. If an edge begins and ends at the
same vertex, it is called the loop.

A graph is called connected if any vertex can be reached


from any other vertex by tracing along edges. (Essentially,
the graph consists of one “piece.”)

A connected graph in which every possible edge is drawn


between vertices (without any multiple edges) is called a
complete graph.
12

12

6
4/19/21

Introduction to Graphs
Several examples of graphs are shown below.

This graph has five This is a connected graph that


vertices but no edges. It has a pair of multiple edges.
is not connected. Note that two edges cross in the
center, but there is no vertex
there. Unless a dot is drawn,
the edges are considered to pass
over each other without touching.

13

13

Introduction to Graphs

This graph is not connected; it This is a complete graph with


consists of two different sections. It five vertices.
also contains a loop.

14

14

7
4/19/21

15

15

Introduction to Graphs
Consequently, the three graphs shown below are
considered equivalent graphs because the edges form
the same connections of vertices in each graph.

16

16

8
4/19/21

Example 2 – Equivalent Graphs


Determine whether the following two graphs are equivalent.

Solution:
Despite the fact that the two graphs have different arrangements of vertices and
edges, they are equivalent.

To illustrate, we examine the edges of each graph. The first graph contains six
edges; we can list them by indicating which two vertices they connect.

The edges are AC, AE, BD, BE, CE, and DE. If we do the same for the second
graph, we get the same six edges.

Because the two graphs represent the same connections among the vertices,
they are equivalent. 17

17

Answer:

The two graphs are not equivalent. The first graph does
not have edge AB.
18

18

9
4/19/21

Euler Circuits

19

19

Euler Circuits
To solve the Königsberg bridges problem, we can represent
the arrangement of land areas and bridges with a graph. Let
each land area be represented by a vertex, and connect two
vertices if there is a bridge spanning the corresponding land
areas. Then the geographical configuration shown in Figure
5.3 becomes the graph shown in Figure 5.4.

Figure 5.4
Figure 5.3
20

20

10
4/19/21

Euler Circuits
A path in a graph can be thought of as a movement from
one vertex to another by traversing edges. We can refer to
our movement by vertex letters. For example, in the graph
in Figure 5.4, one path would be A–B–A–C.

Figure 5.4

21

21

If a path ends at the same vertex at which it


started, it is considered a closed path, or
circuit.

For the graph in Figure 5.5, the path


A–D–F–G–E–B–A is a circuit
because it begins and ends at the
same vertex. Figure 5.5

The path A–D–F–G–E–H is not a circuit, as


the path ends at a different vertex than the
one it started at.

22

22

11
4/19/21

Euler Circuits
A circuit that uses every edge, but never uses the same
edge twice, is called an Euler circuit. (The path may cross
through vertices more than once.)

The path B–D–F–G–H–E–C–B–A–D–G–E–B in Figure 5.5


is an Euler circuit. It begins and ends at the same vertex
and uses each edge exactly once.

Figure 5.5

23

23

Euler Circuits
The path A–B–C–E–H–G–E–B–D–A is not an Euler
circuit.

Figure 5.5

The path begins and ends at the same vertex but it does
not use edges DF, DG, or FG.

24

24

12
4/19/21

Euler Circuits
Euler essentially proved that the graph
in Figure 5.4 could not have an Euler
circuit. He accomplished this by
examining the number of edges that
met at each vertex.

Figure 5.4

The number of edges that meet at a vertex is called the


degree of a vertex.

For an Euler circuit to exist, the degree of every vertex


would have to be an even number.
25

25

Euler Circuits
Furthermore, Euler was able to show that any graph that
has even degree at every vertex must have an Euler circuit.
Consequently, such graphs are called Eulerian.

26

26

13
4/19/21

Königsberg Problem
Because not every vertex is of even degree, we know by
the Eulerian Graph Theorem that no Euler circuit exists.
Consequently, it is not possible to begin and end at the
same location near the river and cross each bridge
exactly once.

Figure 5.4
Figure 5.3
27

27

Example 3 – Identifying Eulerian Graphs


Which of the following graphs has an Euler circuit?
a. b.

Solution:
a. Vertices C and D are of odd degree. By the Eulerian
Graph Theorem, the graph does not have an Euler circuit.

b. All vertices are of even degree. By the Eulerian Graph


Theorem, the graph has an Euler circuit.
28

28

14
4/19/21

Answer:

Vertices B, C, E and G are of odd degrees. By the Eulerian


Graph Theorem, the graph does not have an Euler circuit.

29

29

Euler Circuits
The Eulerian Graph Theorem guarantees that when all
vertices of a graph have an even degree, an Euler circuit
exists, but it does not tell us how to find one.

Because the graphs we will examine here are relatively


small, we will rely on trial and error to find Euler circuits.

There is a systematic method, called Fleury’s algorithm,


that can be used to find Euler circuits in graphs with large
numbers of vertices.

30

30

15
4/19/21

Fleury’s Algorithm

Step 1 Select any vertex to start with.

Step 2 Traverse any available edge starting with this vertex.

Delete already traversed edge. Make sure that the


Step 3
graph will not be disconnected.

Repeat step 2&3 until there are no more edges left.


Step 4 The resulting trail will be an Eulerian trail (given an
Eulerian graph).

31

31

Example 4 – Find an Euler Circuit


Determine whether the graph shown below is Eulerian. If it
is, find an Euler circuit. If it is not, explain how you know.

Solution:
Each vertex is of even degree (2, 4, or 6), so by the
Eulerian graph theorem, the graph is Eulerian. There are
many possible Euler circuits in this graph.
32

32

16
4/19/21

Example 4 – Solution cont’d

We do not have a formal method of locating one, but by


trial and error, one Euler circuit is B–A–F–B–E–F–G–E–D–
G–B–D–C–B.

33

33

Answer: Vertices D and E have odd degrees. By


Eulerian graph theorem, the graph does not
have an Euler Circuit. 34

34

17
4/19/21

Answer: Note, that


the vertex
representing the
Civic Center
junction has
degree 3. Because
a vertex has an
odd degree, the
graph cannot be
Eulerian, and it is
impossible for the
inspector not to
travel at least one
track twice. 35

35

Euler Paths

36

36

18
4/19/21

Euler Paths
Perhaps the Königsberg bridges problem
would have a solution if we did not need
to return to the starting point. In this case,
what we are looking for in Figure 5.4 is
a path (not necessarily a circuit) that
uses every edge once and only once.

Figure 5.4

We call such a path an Euler path. Euler showed that even


with this relaxed condition, the bridge problem still was not
solvable.

37

37

Euler Paths
The general result of his argument is given in the following
theorem.

38

38

19
4/19/21

Example 6 – An Application of Euler Paths

A photographer would like to travel across all of the roads


shown on the following map.

The photographer will rent a car that need not be returned


to the same city, so the trip can begin in any city. Is it
possible for the photographer to design a trip that traverses
all of the roads exactly once?
39

39

Example 6 – Solution
Looking at the map of roads as a
graph, we see that a route that
includes all of the roads but does not
cover any road twice corresponds to
an Euler path of the graph.

Notice that only two vertices are of odd degree, the cities
Alameda and Dover. Thus we know that an Euler path
exists, and so it is possible for the photographer to plan a
route that travels each road once.

Because (abbreviating the cities) A and D are vertices of


odd degree, the photographer must start at one of these
cities. With a little experimentation, we find that one Euler
path is A–B–C–D–B–F–A–G–F–E–D. 40

40

20
4/19/21

Answer: Because only two vertices (A and F) are of odd degree, we know
that an Euler path exists. Furthermore, the path must begin at A and end at F
or begin at F and end at A.
By trial and error, one Euler path is A–B–C–D–E–B–G–F– E–C–A–F.
41

41

42

42

21
4/19/21

43

43

44

44

22

You might also like