0% found this document useful (0 votes)
7 views

Lecture 3

Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
7 views

Lecture 3

Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
You are on page 1/ 15

Theorem

For an 𝑛𝑛-vertex (𝑛𝑛 ≥ 1) graph 𝐺𝐺 = (𝑉𝑉, 𝐸𝐸) the following are


equivalent:
1) 𝐺𝐺 = (𝑉𝑉, 𝐸𝐸) is a tree.
2) 𝐺𝐺 = (𝑉𝑉, 𝐸𝐸) is connected and has 𝑛𝑛 − 1 edges, i.e. 𝐸𝐸 = 𝑉𝑉 − 1.
3) 𝐺𝐺 = (𝑉𝑉, 𝐸𝐸) has 𝑛𝑛 − 1 edges, i.e. 𝐸𝐸 = 𝑉𝑉 − 1 and no cycles.
4)For arbitrary pair of vertices of 𝐺𝐺 = (𝑉𝑉, 𝐸𝐸), there is exactly one
simple path between them.
Proof.
1)⇒2) by induction
Base case: 𝑛𝑛 = 1. There is only one graph on one vertex, it has no
edges. Since 0 = 1 − 1, this completes the proof of the base case.
Inductive step: Let 𝑘𝑘 ≥ 1 be arbitrary, and suppose that every tree on 𝑘𝑘
vertices has 𝑘𝑘 − 1 edges.
Let 𝑇𝑇 be an arbitrary tree with 𝑘𝑘 + 1 vertices. Since 𝑘𝑘 + 1 ≥ 2, 𝑇𝑇 must have
at least two boundary vertices. Let 𝑣𝑣 be one of them. 𝑇𝑇 − 𝑣𝑣 is a tree. Also,
𝑇𝑇 − 𝑣𝑣 has 𝑘𝑘 vertices, so we can apply our induction hypothesis to 𝑇𝑇 − 𝑣𝑣 ,
so 𝑇𝑇 − 𝑣𝑣 has 𝑘𝑘 − 1 edges. Since 𝑣𝑣 was a boundary vertex of 𝑇𝑇, then 𝑇𝑇 has
precisely one more edge than 𝑇𝑇 − 𝑣𝑣, i.e. 𝑇𝑇 has 𝑘𝑘 edges .
2)⇒ 3)
We assume that 𝑇𝑇 is connected and has 𝑛𝑛 − 1 edges. Towards a
contradiction, suppose that 𝑇𝑇 has a cycle. Repeatedly delete edges that are
in cycles until no cycles remain. The resulting graph is connected, so by
definition it is a tree. Since we have already proven that 1 ⇒ 2, this tree
must have 𝑛𝑛 − 1 edges. Since we started with 𝑛𝑛 − 1 edges and deleted at
least one, this is a contradiction.
3)⇒4)
Suppose that 𝐺𝐺 = (𝑉𝑉, 𝐸𝐸) has 𝑛𝑛 − 1 edges, and no cycles.
It is easy to check that 𝐺𝐺 = (𝑉𝑉, 𝐸𝐸) is connected.
Now, towards a contradiction we assume that there exist 2 vertices
𝑣𝑣𝑖𝑖 , 𝑣𝑣𝑗𝑗 connected by 2 simple paths:
𝑣𝑣𝑖𝑖 , 𝑥𝑥1 , 𝑥𝑥2 , … 𝑥𝑥𝑘𝑘 , 𝑣𝑣𝑗𝑗
𝑣𝑣𝑖𝑖 , 𝑦𝑦1 , 𝑦𝑦2 , … , 𝑦𝑦𝑙𝑙 , 𝑣𝑣𝑗𝑗

Then, the graph contains the following cycle:


𝑣𝑣𝑖𝑖 , 𝑥𝑥1 , 𝑥𝑥2 , … 𝑥𝑥𝑘𝑘 , 𝑣𝑣𝑗𝑗 , 𝑦𝑦𝑙𝑙 , … , 𝑦𝑦2 , 𝑦𝑦1 , 𝑣𝑣𝑖𝑖
4)⇒1) can be easily proved.□
Spanning tree
Let 𝐺𝐺 = (𝑉𝑉, 𝐸𝐸) be a connected graph. A spanning tree of 𝐺𝐺 is a
subgraph of 𝐺𝐺 that is a tree containing every vertex of G.
A spanning tree of 𝐺𝐺 can be obtained by removing edges such that the
resulting graph is remains connected and does not contain a cycle.

Example,
𝑇𝑇 ′ = 𝑉𝑉, 𝐸𝐸 ′ ,
𝐸𝐸 ′ = 𝑐𝑐, 𝑏𝑏 , 𝑏𝑏, 𝑎𝑎 , 𝑎𝑎, 𝑒𝑒 , 𝑒𝑒, 𝑑𝑑
𝑇𝑇 ′′ = 𝑉𝑉, 𝐸𝐸 ′′ ,
𝐸𝐸 ′′ = { 𝑎𝑎, 𝑏𝑏 , 𝑏𝑏, 𝑑𝑑 , 𝑑𝑑, 𝑒𝑒 , (𝑒𝑒, 𝑐𝑐)}
Euler path/cycle
Definition
An Euler path in a graph 𝐺𝐺 is a path that contains all vertices of the
graph and passes trough every edge of 𝐺𝐺 exactly once. An Euler path
is Euler cycle if it starts and ends in the same vertex.
Example

No Euler cycle,
no Euler path
No Euler cycle
Euler cycle - a, e, c, d, e, b, a Euler path - a, c, d, e, b, d, a, b.
It is evident that a necessary condition for Euler cycle/path is the
connectedness of the graph. But this is not sufficient condition.

Euler theorem
A graph with at least two vertices has an Euler cycle if and only if it is
connected and each of its vertices has even degree.
Proof.
Necessity
Let a graph 𝐺𝐺 = (𝑉𝑉, 𝐸𝐸) has an Euler cycle. It follows that it is
connected. We move through the Euler cycle and count the vertex
degrees. Since all the edges are different, then passing through a
vertex, add 2 to its degree. All edges belong to the cycle, hence
passing through the last edge of the cycle, all degrees will be
counted, and thus, - it will be an even number.
Sufficiency
Let a graph 𝐺𝐺 = (𝑉𝑉, 𝐸𝐸) is connected and the degree of each vertex is
even. We prove that 𝐺𝐺 has an Euler cycle.
Consider the longest path in 𝐺𝐺 (the edges are all different), let it be:
𝑃𝑃: 𝑣𝑣1 , 𝑣𝑣2 , …,𝑣𝑣𝑘𝑘 . Prove that that 𝑣𝑣1 = 𝑣𝑣𝑘𝑘 .
Suppose that 𝑣𝑣1 ≠ 𝑣𝑣𝑘𝑘 . Since odd number of edges are adjacent to 𝑣𝑣1
in 𝑃𝑃, but the degree of 𝑣𝑣1 is even, then there must be an edge
(𝑢𝑢, 𝑣𝑣1 ) adjacent to 𝑣𝑣1 , which does not belong to 𝑃𝑃 . Then, the path
𝑢𝑢, 𝑣𝑣1 , 𝑣𝑣2 , …,𝑣𝑣𝑘𝑘 in 𝐺𝐺 is longer than 𝑃𝑃 . This contradicts the fact that
𝑃𝑃 is a longest path.
Therefore, 𝑃𝑃 is a cycle. Now we prove that 𝑃𝑃 is an Euler cycle, i.e.
contains all the edges of 𝐺𝐺.
Make a contradictory assumption – suppose there exists an edge
(𝑢𝑢1 , 𝑢𝑢2 ) , not belonging to 𝑃𝑃 . Then,
1. Either 𝑢𝑢1 or 𝑢𝑢2 belongs to P, which will bring to a longer path, -
this is a contradiction.
2. Both 𝑢𝑢1 and 𝑢𝑢2 do not belong to P. But, since the graph 𝐺𝐺 is
connected, there should be a path that connects 𝑢𝑢1 or 𝑢𝑢2 to P.
This will bring to a -longer path, - this is a contradiction.
Therefore, 𝑃𝑃 contains all the edges of 𝐺𝐺.□
Theorem
A connected graph 𝐺𝐺 = (𝑉𝑉, 𝐸𝐸) has an Euler path if and only the number
of odd degree vertices ≤2.
Proof.
Necessity.
Let 𝐺𝐺 = (𝑉𝑉, 𝐸𝐸) has an Euler path. If this is a cycle, then from the
previous theorem we know that the number of odd degree vertices is 0.
Now suppose an Euler path is from the vertex 𝑎𝑎 to the vertex 𝑏𝑏 of 𝐺𝐺 .
The first edge in the path adds 1 to the degree of the vertex 𝑎𝑎. Then if
the path again passes through the vertex 𝑎𝑎 (enter to the vertex, and go
out from it), it will add 2 to its degree. The last edge in the path adds 1
to the degree of the vertex 𝑏𝑏. Thus, the number of odd degree vertices
is 2.
Sufficiency.
If the number of odd degree vertices of 𝐺𝐺 = (𝑉𝑉, 𝐸𝐸) is 0, then according
to the previous theorem, 𝐺𝐺 has an Euler path.
The number of odd degree vertices could not be 1.
Now suppose that the number of odd degree vertices is 2, and let these
are the vertices 𝑎𝑎 and 𝑏𝑏 .
Let us define a graph 𝐺𝐺′ = (𝑉𝑉′, 𝐸𝐸′) in the following way:
𝑉𝑉 ′ = 𝑉𝑉 ∪ {𝑢𝑢} and 𝐸𝐸𝐸 = 𝐸𝐸 ∪ { 𝑎𝑎, 𝑢𝑢 , (𝑢𝑢, 𝑏𝑏)}.
Now the degrees of all the vertices in 𝐺𝐺𝐺 are even; and thus, it contains
an Euler cycle. Removing the vertex 𝑢𝑢 with the edges 𝑎𝑎, 𝑢𝑢 , (𝑢𝑢, 𝑏𝑏), we
obtain an Euler path in 𝐺𝐺 = (𝑉𝑉, 𝐸𝐸) □.
Euler theorem
A graph with at least two vertices has an Euler cycle if and only
if it is connected and each of its vertices has even degree.

Theorem
A connected graph 𝐺𝐺 = (𝑉𝑉, 𝐸𝐸) has an Euler path if and only the
number of odd degree vertices ≤2.

Theorem
A connected graph has an Euler path but not an Euler cycle if and
only if it has exactly two vertices of odd degree.
The problem model is a graph whose vertices are the land parts: banks and islands A, B, C, D;
and the edges are the seven bridges a, b, c, d, e, f, g. It should be passed through the edges
of the graph each one exactly once.
APPLICATIONS OF EULER PATHS AND CYCLES.
Euler paths and cycles can be used to solve many practical
problems. For example, many applications ask for a path or cycle
that traverses each street in a neighborhood, or each link in a
communications network exactly once. Finding an Euler path or
cycle in the appropriate graph model can solve such problems.
Algorithm constructing Euler Cycle (Fleury’s algorithm)
We start with an arbitrary vertex 𝑣𝑣 in the graph and move through an edge, let it
be the edge 𝑣𝑣𝑣𝑣, and assign the number 1 to this edge. Remove this edge from the
set of edges, and consider the vertex 𝑢𝑢.
In general, let 𝑤𝑤 be the vertex considered in the current step, and let 𝑘𝑘 be the
number assigned to the current edge.

Then, we chose an arbitrary edge adjacent to 𝑤𝑤 ,


meanwhile we chose the edge, removing of which
violates the connectedness of the graph, - only in
case when this is the only adjacent to 𝑤𝑤 edge. Assign
𝑘𝑘 + 1 to the edge, and remove it from the set of
edges. Continue the process while no edges remain
in the graph.

You might also like