Euler Circuits: The Circuit Comes To Town
Euler Circuits: The Circuit Comes To Town
1
Euler Circuits
Outline/learning Objectives
2
Euler Circuits
Outline/learning Objectives (cont.)
3
Euler Circuits
4
Euler Circuits
5
Euler Circuits
6
Euler Circuits
7
Euler Circuits
8
Euler Circuits
Graphs
9
Euler Circuits
Edges- lines
The edges do not have to be straight lines. But they
have to connect two vertices.
A Graph with No
Edges? Yes, its
possible. Without
edges, every vertex
of the graph is an
isolated vertex.
15
Euler Circuits
Graphs
A graph is a structure that defines pairwise
relationships within a set to objects. The
objects are the vertices, and the pairwise
relationships are the edges: X is related to Y if
and only if XY is an edge.
16
Euler Circuits
Graph Concepts
and Terminology
17
Euler Circuits
Adjacent vertices.
Two vertices are said
to be adjacent if there
is an edge joining
them. Vertices B and E
are adjacent; C and D
are not. Also because
of the loop at E, we can
say that Vertex E is
18
adjacent to itself.
Euler Circuits
Adjacent edges.
Two edges are
adjacent if they share
a common vertex. AB
and AD are adjacent;
edges AB and DE are
not.
19
Euler Circuits
Degree of a vertex.
The degree of a
vertex is the number of
edges at that vertex.
When there is a loop at
the vertex, the loop
contributes twice. The
deg(A) = 3, deg(B) = 5,
deg(C) = 3, deg(D) = 2,
20
deg(E) = 4, etc.
Euler Circuits
Odd and even vertices.
An odd vertex is a
vertex of odd degree;
an even vertex is a
vertex of even degree.
The graph has two
even vertices (D and E)
and six odd vertices (all
the others).
21
Euler Circuits
Paths.
A path is a sequence of vertices with the
property that each vertex in the sequence is
adjacent to the next one. The key requirement
in a path is that an edge can be part of a path
only once.
22
Euler Circuits
Paths (continued).
The number of edges in the path is called the
length of the path.
A, B, E, D. This is a path from vertex A to D,
consisting of the edges AB, BE, and ED.
The length of this path is 3.
23
Euler Circuits
Circuits.
A circuit has the same definition as a path,
but has the additional requirement that the
trip starts and ends at the same vertex.
24
Euler Circuits
Connected graphs.
A graph is connected,
if given any two
vertices, there is a path
joining them. A graph
that is not connected is
said to be
disconnected. A
disconnected graph is
made up of separate
25
components.
Euler Circuits
Bridges.
Sometimes in a
connected graph there
is an edge such that if
we were to erase it, the
graph would become
disconnected—such an
edge is called a
bridge. BF, FG, and
26
FH are bridges.
Euler Circuits
Euler paths.
An Euler path is a path
that passes through every
edge of a graph once and
only once. The graph
shown in (a) does not have
an Euler path; the graph in
(b) has several Euler
paths. One of them is
27
L,A,R,D,A,R,D,L,A.
Euler Circuits
Euler circuits.
An Euler circuit is a circuit
that passes through every
edge of a graph. One of
them is
L,A,R,D,A,R,D,L,A,L.
Note that if a graph has an
Euler circuit it cannot have
an Euler path, and vice
28 versa.
Euler Circuits
Graph Models
29
Euler Circuits
30
Euler Circuits
31
Euler Circuits
32
Euler Circuits
Euler’s Theorems
33
Euler Circuits
34
Euler Circuits
The graph in (a ) cannot have an Euler circuit because it is
disconnected. The graph in (b) has odd vertices (C is
one of them, there are others). The graph in (c) is
connected and all the vertices are even. The graph
does have Euler circuits.
35
Euler Circuits
36
Euler Circuits
37
Euler Circuits
Fleury’s Algorithm
38
Euler Circuits
39
Euler Circuits
40
Euler Circuits
46
Euler Circuits
Eulerizing Graphs
47
Euler Circuits
Eulerizing Graphs
Our first step is to
identify the odd
vertices. This
graph has eight
odd vertices
(B,C,E,F,H,I,K,and
L), shown in red.
48
Euler Circuits
Eulerizing Graphs
When we add a
duplicate copy of
edges BC,EF,HI,
and KL, we get this
graph. This is the
eulerized version of
the original graph.
49
Euler Circuits
Eulerizing Graphs
This graph shows
the many possible
Euler circuits,with
the edges
numbered in the
order they are
traveled..
50
Euler Circuits
Eulerizing Graphs
With the four duplicate
edges (BC,EF,HI,and
KL) indicating the
deadhead blocks where
a second pass is
required. The total
length of this route is 28
blocks (24 blocks in the
grid plus 4 deadhead
blocks).
51
Euler Circuits
Eulerizing Graphs
In some situations we
need to find an
exhaustive route, but
there is no
requirement that it be
closed—the route
may start and end at
different points.
52
Euler Circuits
Eulerizing Graphs
In these cases, we
want to leave two
odd vertices on the
graph unchanged,
and change the other
odd vertices into
even vertices.
53
Euler Circuits
Eulerizing Graphs
This process id called
a semi-eulerization
of the graph. In this
case the route will
start at one of the two
odd vertices and end
at the other one.
54
Euler Circuits
Conclusion
Concept of a graph
This idea can be traced back to Euler some 270 years
ago.
Concept of a graph model.
We used graphs and mathematical theory of graphs to
solve certain types of routing problems.
Concept of an algorithm
A set of procedural rules that helps us find Euler
circuits or Euler path in a graph
55