0% found this document useful (0 votes)
24 views14 pages

Euler Hamiltonian Interval

Euler and Hamilton notes

Uploaded by

mkr64660
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)
24 views14 pages

Euler Hamiltonian Interval

Euler and Hamilton notes

Uploaded by

mkr64660
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/ 14

Graph Theory - Lecture 5

Euler Graphs, Hamiltonian Graphs


and
Interval Graphs
Chintan Kr Mandal
Department of Computer Science and Engineering
Jadavpur University, India

1 Euler Graphs
Eulerian trail An Eulerian trail / Euler walk in an undirected graph G(V, E) is a walk that
uses each edge exactly once.
If such a walk exists, the graph is called traversable / semi-eulerian.

Eulerian cycle An Eulerian cycle / Eulerian circuit / Euler tour in an undirected graph
is a cycle that uses each edge exactly once.
If such a cycle exists, the graph is called Eulerian / unicursal.

Eulerian orientation An Eulerian orientation of an undirected graph G(V, E) is an assign-


ment of a direction to each edge of G(V, E) such that the d+ (v) = d− (v) ∀v ∈ V (G) where
d+ (v) = OutDegree(v) and d− (v) = InDegree(v).
Such an orientation exists for any undirected graph in which every vertex has even degree, and
may be found by constructing an Euler tour in each connected component of G(V, E) and
then orienting the edges according to the tour.
Every Eulerian orientation of a connected graph is a strong orientation, an orientation that
makes the resulting directed graph strongly connected.

Definition 1.1 (Euler Graph). A connected graph is Eulerian if it has a closed trial containing
all the edges.
Note : The definition and properties of Eulerian trails, cycles and graphs are valid for multi-
graphs as well.
Check “Note – Eulerian circuits and directed graphs - Lincoln Lu” for applications

1.1 Konisberg Problem


Euler’s Solution
Leonard Euler solved this problem by the simple observation:

1
Figure 1: Königsberg bridge problem

This would only be possible if whenever you cross into a part of the city you must be able to leave
it by another bridge.
Rephrasing this problem in the language of graph theory, we get the problem of finding an
Eulerian trail in the connected graph

Theorem 1.1. A connected graph is Eulerian if and only if each vertex has even degree.

Proof.

Solution :
Since the degrees of all the vertices in the graph in the Konigsberg bridge problem are not even:
The answer is that it is not possible to cross each of the seven bridges of Konigsberg exactly once
and return to the starting point.

Problem. The Konigsberg bridge problem could have been solved if one bridge was removed and
another added.
Which bridge would you remove and where would you add a bridge?

1.2 Fleury’s Algorithm : Finding the Euler Path


Let G(V, E) be a connected graph. If G(V, E) is Eulerian, then Fluery’s Algorithm will produce
an Eulerian trial in G(V, E) .

STEP 1. We begin the algorithm with vertex A

STEP 2. Starting at A, choose AB, BC, CD. This gives the following G(V, E) Figure 2b (with
the current vertex circled)

STEP 3. The edge DA is a bridge; choosing DB, BE, EF, FG to produce the following graph:
Figure 2c

STEP 4. Edge GK is a bridge. Choosing GE, EH, HG, GK, KI to give the following : Figure
2d

2
Algorithm 1 Fleury’s Algorithm
Require: Let G(V, E) be an Eulerian Graph
1: Choose any vertex v ∈ V (G).
2: currentV ertex = v, currentT rial = φ . currentT rial is a sequence of edges, e ∈ E(G)
3: Select any edge e incident to currentV ertex. Choose a bridge only if there is no alternative
S
4: Add: currentT rial = currentT rial e
5: Delete e from G(V, E) . Delete any isolated vertices
6: Repeat Steps 2 - 5 until all edges have been deleted from G(V, E) .
7: The final currentT rial is an Eulerian trial in G(V, E)

(a) Step 1 (b) Step 2

(c) Step 3 (d) Step 4

Figure 2: Fluery’s Algorithm : Example

STEP 5. Edge ID is a bridge. Choosing IJ followed by JK, KL, LI, ID, DA.
The complete trial is ABCDBEFGEHGKIJKLIDA
Theorem 1.2. If G(V, E) is Eulerian, then any circuit constructed by Fluery’s Algorithm is Eu-
lerian.
Proof. Let G(V, E) be an Eulerian graph. Let Cp = v0 e1 . . . ep vp be the trial constructed by Fluery’s
Algorithm.
Then, clearly, the final vertex, vp must be degree 0 in the graph Gp , and hence vp = vt and Cp
is the desired circuit of G(V, E) . Now, to see that Cp is the desired circuit, suppose instead that
Cp is not an Eulerian circuit of G(V, E) . Thus, there must be edges T of G(V, E) not in Cp .
Let S be the set of vertices of positive degree in Gp . Hence, S V (Cp ) is non-empty T since
G(V, E) is connected and vp ∈ S = V − S. Let i be the largest integer such that vi ∈ S Cp but
vi+1 ∈ S. Since, Cp ends in S, it follows that i < p.
From the definition of S, each edge of Gi that joins S and S is on Cp ; thus the edge ei+1 is the
only edge from S to S in the graph G(V, E) Gi . But then, ei+1 is a bridge in Gi .

3
Suppose, that e is any other edge of Gi that is incident to vi .
Then from Algorithm 1: Step 3, it follows that e must also be a bridge of Gi (and hence of the
graph Hi , induced by S in Gp ). Since, Hi ⊆ Hp (the graph induced by S in Gp ), it follows that e
is also a bridge in Hp .
Further, since ei+1 is a bridge of Gi and vi is the last vertex on Cp that is also in S, we see that
Hi = Hp and that degHp (v) = degGp (v) ∀v ∈ Hp . Thus, every vertex in Hp has even degree, which
implies that Hp has even degree, which implies that Hp contains no bridges, a contradiction.

1.3 Eulerian Digraphs


Definition 1.2 (Eulerian Trial). An Eulerian Trial in a D(V, E) is a trail containing all edges

An Eulerian circuit is a closed trail containing all edges.


A D(V, E) is Eulerian if it has an Eulerian circuit.

Theorem 1.3. If D(V, E) is a digraph with δ + (D(V, G)) ≥ 1, the D(V, E) contains a cycle. The
same conclusion holds when δ − (D(V, G)) ≥ 1

Proof. Let P be a maximal path in D(V, E) ; and let u ∈ P be the last vertex of P . Since, P
cannot be extended, every successor of u must already be a vertex of P . Since, δ + (D(V, G)) ≥ 1, u
has a successor v on P .
The edge −→ completes a cycle with the portion of P from v to u.
uv

Theorem 1.4. A D(V, E) is Eulerian iff d+ (v) = d− (v) for each vertex v ∈ V (D) and the under-
lying graph has at most one non-trivial component.

Theorem 1.5. A digraph D(V, E) is Eulerian if and only if D(V, E) has at most one nontrivial
component and d+ (vx ) = d− (vx ) for each vertex v ∈ V (D).

Proof. Necessity : Suppose D(V, E) is Eulerian. All edges are on a Eulerian cycle. Therefore,
all edges are in one component. Other components have no edges. Thus, they are isolated
vertices. For any vertex vx in the nontrivial component, the number of edges leaving vx is
equal to the number of edges entering vx . Thus, d+ (vx ) = d− (vx )

Sufficiency : We will prove it by induction on the number m of edges.


If m = 0, the Eulerian cycle is empty. It holds.
Suppose that the statement holds for any graph with at most m edges. In another words, if a
graph D(V, E) with at most m edges has at most one nontrivial component and its vertices
all have even degrees, then D(V, E) is Eulerian.
Now we consider a graph with m + 1 edges, which has at most one nontrivial component H
and d+ (v) = d− (v) ≥ 1 for all v ∈ V (H). By Lecture 3: Lemma 4.2, it contains a cycle C.
Deleting all edges on C from D(V, E) , H might be breaking into several components, say
H1 , H2 , . . . , Hr . It is clear that d+ (v) = d− (v) still holds for every vertex v.
Each component Hi has at most m edges. By inductive hypothesis, There is an Eulerian
circuit Ci for each component Hi . Since D(V, E) has only one non-trivial component, T the
cycle C must intersect with every component Hi . Pick one vertex vi ∈ V (C) V (Hi ). The
vertices v1 , v2 , . . . , vr break the cycle C into r paths, say v1 P1 v2 , v2 P2 v3 , . . . , vr Pr v1 . Arrange

4
Eulerian circuit Ci so that the starting vertex and end vertex is vi . Now we construct an
Eulerian circuit as follows
C1 P1 C2 P2 . . . Cr Pr v1
It contains all edges of D(V, E) .

Theorem 1.6. Prove that a graph G(V, E) has an Eulerian orientation if, and only if G(V, E) is
Eulerian

Proof. Contrapositive : It suffices to ignore trivial and disconnected graphs. Thus, suppose that
G(V, E) is a connected graph that is not Eulerian. Then G(V, E) has a vertex v ∈ V (G)
with deg(v) an odd integer.
Let D(V, E) be any digraph with V (D) = V (G) obtained by providing an orientation to the
edges of G(V, E) . In short, let D(V, E) be any orientation of G(V, E) . Then there are a
total of deg(v) arcs in E(D) with v as either initial element of the pair or terminal element
of the pair.
Since there must be an odd number of these arcs, it follows that d+ (v) 6= d− (v). From Theorem
1.5, the digraph D(V, E) cannot be Eulerian. Since D(V, E) was an arbitrary orientation of
G(V, E) , G(V, E) cannot have an Eulerian orientation.

Direct Proof : Suppose that G(V, E) is a Eulerian graph. Then G(V, E) has an Eulerian circuit,
say
C : u = v0 , . . . , v k = u
.
Let D(V, E) be the digraph with vertex set V (D) = V (G) and whose arc set is E(D) =
{(vi−1 , vi ) : i = 1, . . . , k} with the vi ’s from the Eulerian circuit C(G) above.
Then D(V, E) is an orientation for G(V, E) since each edge of G(V, E) appears exactly once
in C, and D(V, E) is Eulerian due to C actually being an Eulerian circuit for D(V, E) as well
for G(V, E) .

1.4 Application : deBruijn Cycle

5
8
De Bruijn sequences

The following problem has a practical origin: the so-called rotating


drum problem. Consider a rotating drum as in Fig. 8.1.

Figure 8.1

Each of the segments is of one of two types, denoted by 0 and 1.


We require that any four consecutive segments uniquely determine
the position of the drum. This means that the 16 possible quadru-
ples of consecutive 0’s and 1’s on the drum should be the binary
representations of the integers 0 to 15. Can this be done and, if yes,
in how many different ways? The first question is easy to answer.
Both questions were treated by N. G. de Bruijn (1946) and for this
reason the graphs described below and the corresponding circular
sequences of 0’s and 1’s are often called De Bruijn graphs and De
Bruijn sequences, respectively.
We consider a digraph (later to be called G4 ) by taking all 3-
tuples of 0’s and 1’s (i.e. 3-bit binary words) as vertices and joining
the vertex x1 x2 x3 by a directed edge (arc) to x2 x3 0 and x2 x3 1.
The arc (x1 x2 x3 , x2 x3 x4 ) is numbered ej , where x1 x2 x3 x4 is the
binary representation of the integer j. The graph has a loop at 000
and at 111. As we saw before, the graph has an Eulerian circuit
because every vertex has in-degree 2 and out-degree 2. Such a
72 A Course in Combinatorics

closed path produces the required 16-bit sequence for the drum.
Such a (circular) sequence is called a De Bruijn sequence. For
example the path 000 → 000 → 001 → 011 → 111 → 111 → 110 →
100 → 001 → 010 → 101 → 011 → 110 → 101 → 010 → 100 → 000
corresponds to 0000111100101101 (to be read circularly). We call
such a path a complete cycle.
We define the graph Gn to be the directed graph on (n−1)-tuples
of 0’s and 1’s in a similar way as above. (So Gn has 2n edges.)
The graph G4 is given in Fig. 8.2. In this chapter, we shall call a
digraph with in-degree 2 and out-degree 2 for every vertex, a ‘2-in
2-out graph’. For such a graph G we define the ‘doubled’ graph G∗
as follows:
(i) to each edge of G there corresponds a vertex of G∗ ;
(ii) if a and b are vertices of G∗ , then there is an edge from a to
b if and only if the edge of G corresponding to a has as terminal
end (head) the initial end (tail) of the edge of G corresponding to
b.
Clearly G∗n = Gn+1 .

Figure 8.2

Theorem 8.1. Let G be a 2-in 2-out graph on m vertices with M


complete cycles. Then G∗ has 2m−1 M complete cycles.
Proof: The proof is by induction on m.
(a) If m = 1 then G has one vertex p and two loops from p to p.
Then G∗ = G2 which has one complete cycle.
8. De Bruijn sequences 73

(b) We may assume that G is connected. If G has m vertices


and there is a loop at every vertex, then, besides these loops, G is
a circuit p1 → p2 → · · · → pm → p1 . Let Ai be the loop pi → pi and
Bi the arc pi → pi+1 . We shall always denote the corresponding
vertices in G∗ by lower case letters. The situation in G∗ is as in
Fig. 8.3.

Figure 8.3

Clearly a cycle in G∗ has two ways of going from bi to bi+1 . So


G∗ has 2m−1 complete cycles, whereas G has only one.
(c) We now assume that G has a vertex x that does not have
a loop on it. The situation is as in Fig. 8.4, where P, Q, R, S are
different edges of G (although some of the vertices a, b, c, d may
coincide).
From G we form a new 2-in 2-out graph with one vertex less by
deleting the vertex x. This can be done in two ways: G1 is obtained
by the identification P = R, Q = S, and G2 is obtained by P = S,
Q = R. By the induction hypothesis, the theorem applies to G1
and to G2 .

Figure 8.4

There are three different types of complete cycle in G∗ , depending


on whether the two paths leaving r and returning to p, respectively
q, both go to p, both to q, or one to p and one to q. We treat one
74 A Course in Combinatorics

case; the other two are similar and left to the reader. In Fig. 8.5
we show the situation where path 1 goes from r to p, path 2 from
s to q, path 3 from s to p, and path 4 from r to q.

Figure 8.5

These yield the following four complete cycles in G∗ :

1, pr, 4, qs, 3, ps, 2, qr


1, ps, 2, qr, 4, qs, 3, pr
1, ps, 3, pr, 4, qs, 2, qr
1, ps, 2, qs, 3, pr, 4, qr

In G∗1 and G∗2 the situation reduces to Fig. 8.6.

Figure 8.6

In each of G∗1 and G∗2 one complete cycle using the paths 1, 2, 3, 4
is possible. In the remaining two cases, we also find two complete
cycles in G∗1 and G∗2 corresponding to four complete cycles in G∗ .
Therefore the number of complete cycles in G∗ is twice the sum of
the numbers for G∗1 and G∗2 . On the other hand, the number of
complete cycles in G is clearly equal to the sum of the correspond-
ing numbers for G1 and G2 . The theorem then follows from the
induction hypothesis. 
We are now able to answer the question how many complete
cycles there are in a De Bruijn graph.
8. De Bruijn sequences 75
n−1
−n
Theorem 8.2. Gn has exactly 22 complete cycles.
Proof: The theorem is true for n = 1. Since G∗n = Gn+1 , the
result follows by induction from Theorem 8.1. 
For a second proof, see Chapter 36.
Problem 8A. Let α be a primitive element in F2n . For 1 ≤ i ≤
m := 2n − 1, let
n−1

i
α = cij αj .
j=0

Show that the sequence


0, c10 , c20 , . . . , cm0
is a De Bruijn sequence.
Problem 8B. Find a circular ternary sequence (with symbols
0, 1, 2) of length 27 so that each possible ternary ordered triple
occurs as three (circularly) consecutive positions of the sequence.
First sketch a certain directed graph on 9 vertices so that Eulerian
circuits in the graph correspond to such sequences.
Problem 8C. We wish to construct a circular sequence a0 , . . . , a7
(indices mod 8) in such a way that a sliding window ai , ai+1 , ai+3
(i = 0, 1, . . . 7) will contain every possible three-tuple once. Show
(not just by trial and error) that this is impossible.
Problem 8D. Let m := 2n − 1. An algorithm to construct a De
Bruijn sequence a0 , a1 , . . . , am works as follows. Start with a0 =
a1 = · · · = an−1 = 0. For k > n, we define ak to be the maximal
value in {0, 1} such that the sequence (ak−n+1 , . . . , ak−1 , ak ) has
not occurred in (a0 , . . . , ak−1 ) as a (consecutive) subsequence. The
resulting sequence is known as a Ford sequence. Prove that this
algorithm indeed produces a De Bruijn sequence.

Notes.
Although the graphs of this chapter are commonly called De
Bruijn graphs, Theorem 8.1 was proved in 1894 by C. Flye Sainte-
Marie. This went unnoticed for a long time. We refer to De Bruijn
(1975).
2 Hamiltonian Graphs
Check ICOSIAN Game

Definition 2.1. A cycle in a graph G(V, E) that contains every v ∈ V (G) is called a Hamiltonian
cycle, Hn of G(V, E) , where n = |V (G)|.

Thus, a Hamiltonian cycle of G(V, E) is a spanning cycle of G(V, E) .

Definition 2.2. A Hamiltonian graph, G(V, E) is a graph that contains a Hamiltonian cycle.

Definition 2.3. A path is a graph G(V, E) that contains every vertex of G(V, E) is called a
Hamiltonian path in G(V, E)

Note : If a graph contains a Hamiltonian cycle, then it contains a hamiltonian path BUT if
a graph contains a Hamiltonian path, it need not contain a Hamiltonian cycle e.g Pn (Path of
order |Pn |)

Features :

ˆ A Hamiltonan graph of order |Hn | consists of a cycle Cn of length |Cn |, with some additional
edges joining non-consecutive vertices of Cn .

ˆ A Hamiltonian cycle, Hn in a graph G(V, E) or order |V (G)| ≥ 3 is a connected 2-regular


subgraph (all vertices having same degree) of order |Hn |, every proper subgraph of Hn is a
path or a (disjoint) union of paths.

Results :

ˆ Hn contains no cycle of order less than Hn as a subgraph, and certainly Hn contains no


subgraph, if it has deg(v) = 2, v ∈ V (G), then both edges of G(V, E) incident with v must
lie in Hn .

Theorem 2.1. The Peterson Graph is Non-Hamiltonan.

Proof. ˆ Peterson Graph is a 3-regular graph of order 10.


0 00
ˆ It can be considered as being constructed of two 5-cycles: C5 = S u1 u2 u3 u4 u5 and C5 =
v1 v2 v3 v4 v5 and joining edges u1 v1 , u2 v2 , u3 v3 , u4 v4 and u5 v5 or E = { ei = ui vi |1 ≤ i ≤ 5}
Suppose, that Peterson Graph is Hamiltonian. Then, paterson Graph contains a Hamiltonian
cycle, H10 . which contains 10 edges. Therefore, two of the 3 edges incident with each vertex of
Peterson graph necessarily belongs to H10 . Clearly, then H10 contains all five, some or none of the
0 00
edges ei = ui vi ; 1 ≤ i ≤ 5; so at least 5 edges of H10 belongs to either C5 or C5 . Therefore, either
0 00
C5 contains at least 3 edges of H10 or C5 contains at least 3 edges of H10 .
0
Without, loss of generality, let us assume that C5 contains at least 3 edges of H10 . Observe, that
0
all 5 edges of C5 cannot belong to H10 , since so sycle contains a smaller cycle as a subgraph.
0
Say, H10 contains exactly 4 edges of C5 : u1 u2 , u2 u3 , u4 u5 , u5 u1 . However, the cycle H10 must
contain the edges u4 v4 , u3 v3 as well as v1 v3 , v1 v4 .
But, this implies that H10 contains an 8-cycle, which is “contradiction”.
0
Case remains that H10 contains exactly 3 edges of C5 . There are two possibilities :

11
0 0
1. the 3 edges of C5 on H10 are consecutive on C5 and
0
2. these 3 edges are not consecutive on C5

Figure 3d : Impossible as u1 v1 is the only edge incident with u1 that could lie on H10

Figure 3e : H10 would have to contain the smaller cycle u4 v4 v1 v3 u3 v4

Therefore, as claimed, the Peterson Graph is NOT Hamiltonian.

Why determining whether a graph contains a Hamiltonian cycle is difficult ?


While there is a simple characterization of Eulerian graph, i.e. a nontrivial connected graph
G(V, E) is Eulerian iff every vertex of G(V, E) has even degree, there is no such characterization
of Hamiltonian graphs.
When there is no characterization of graphs possessing a certain property, one looks for sufficient
conditions for a graph to have such a property.

2.1 Closure of a Graph


The Closure Clsr(G(V, E)) of a graph, G(V, E) of order |V (G)| is the graph obtained from
G(V, E) by recursively joining pairs of non-adjacent vertices whose degree sum is at least |V (G)|
(in the resulting graph at each stage) until no such pair remains.

Theorem 2.2. A graph G(V, E) is Hamiltonian iff its closure is Hamiltonian

Corollary 2.3. If G(V, E) is a graph of order at least 3 such that Clsr(G(V, E)) is complete, then
G(V, E) is Hamiltonian.

2.2 Weighted Hamiltonian Graphs


There exists two practical problems realted to Weighted Hamiltonian graphs

Chinese Postman Problem : A postman starts from a post office to deliver mail. After visiting
a number of streets, he comes back.
What route should he take so that he visits every street at least once and the total distance
covered is least.

Travelling Salesman Problem : A travelling Salesman visits a number of cities and comes back
to his head office. What route should he travel so that he comes back after visiting each of
the cities exactly once and covers the minimumdistance/covers the distance with minimum
expense.

Note : Relation between Hamiltonian and Eulerian graphs – Line Graphs

12
(a) Peterson Graph (b)

(c) (d)

(e)

Figure 3: Peterson Graph – Is it Hamiltonan ??

13
(a) (b)

(c) (d)

Figure 4: Example 1: Closure of Graph

(a) (b)

Figure 5: Example 2: Closure of Graph

14

You might also like