Download as pdf or txt
Download as pdf or txt
You are on page 1of 38

CHAPTER

6
The Mathematics
of Graphs
Section 5.1 Graphs and Euler Circuits
Introduction to Graphs

3
Introduction to Graphs
The ideas and concepts of graph theory are used in diverse
field of study. Some of its applications are in:

• Computer science • Operation research


• Electrical engineering • Land and air traffic
• Biochemistry • Transportation problem
• Physics • Internet

4
Introduction to Graphs
Graph theory is a branch of mathematics which illustrates
and analyzes various connections we experience in our
lives.

For example, the diagram in


Figure 5.1 could represent
friends that are connected
on Facebook.

Figure 5.1

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.


5
Introduction to Graphs
Definition. A graph is a set of points (called vertices) and
line segments or curves (called edges) that connect
vertices.

7 vertices; 8 edges
5 vertices; 7 edges

6
Air traffic Internet connection

Facebook friends Electrical circuits

7
Basic concepts about graphs:
1. A graph can include vertices that are not joined to any
edges; (we call them isolated vertices)
A graph with all vertices
are isolated..

1 2

3
5
4
4 is an isolated vertex.

8
Basic concepts about graphs:
2. All edges must begin 3. If two or more edges
and end at vertices. connect the same
vertices, they are called
multiple edges;

edge

not an edge

9
4. If an edge begins and ends at the same vertex, it is
called the loop.

The blue edges are loops.


10
5. The degree of a vertex of a graph is the number of
edges that meet at a vertex, with loops counted twice.

Vertex Degree
a b a 1
c
b 3
d c 2
d 3
e e 5
f f 0
g g 2

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

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


1. Which student is involved in the most study groups with
the others?
2. Which student has only one study group in common
with the others?
3. How many study groups does Laura have in common
with the others?
13
Example 1 – Solution
a. We draw five vertices (in any configuration we wish) to
represent the five students, and connect vertices with
edges according to the table.
Laura

Oscar
Matt

Kayla
Amber
14
Example 1 – Solution cont’d

b.
1. 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.

2. Kayla is the only student with one study group in


common, as her vertex is the only one connected to just
one edge.

3. Laura’s vertex is connected to two edges, so


she shares two study groups with the others.

15
Introduction to Graphs
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.”)

Disconnected graphs:

16
A connected graph in which every possible edge is drawn
between vertices (without any multiple edges) is called a
complete graph.

17
Incomplete graphs:

18
More examples of graphs are shown below.

This graph has five vertices but This is a connected graph that has a
no edges. It is not connected. pair of multiple edges. 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.
19
Introduction to Graphs

This is a complete graph with


This graph is not connected; it
five vertices.
consists of two different
sections. It also contains a loop.

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

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.

22
Example 2 – Solution cont’d

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.

23
Euler Circuits

24
Euler Circuits
A path in a graph can be thought of as a movement from
one vertex to another by traversing edges.

Example:
In the graph in Figure 5.5, one path would be A–B–E-H–G.

Figure 5.5
25
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
26
Euler Circuits
A circuit that uses every edge, but never uses the same edge
twice, is called an Euler circuit.
(Note: The path may cross through vertices more than once.)

Example:

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. (Trace the path with your pencil to
verify!) The path A–B–C–E–H–G–E–B–D–A is not an Euler
circuit. The path begins and ends at the same vertex but it does
not use edges DF, DG, or FG.
27
No Euler Circuit

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

28
He made the observation that in order to complete the
desired path, every time you approached a vertex you
would then need to leave that vertex.

If you traveled through that vertex again, you would again


need an approaching edge and a departing edge.

Thus for an Euler circuit to exist in a graph, the degree of


every vertex would have to be an even number.

29
Euler Circuits
Furthermore, he 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.

30
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.
31
Euler Circuits
Remarks:
➢ 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.

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

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

34
Euler Paths

35
Euler Paths
A path (not necessarily a circuit) that uses every edge once
and only once is called an Euler path.

Examples: See exercises on the textbook.

36
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?
37
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.
38

You might also like