Euler Hamiltonian Interval
Euler Hamiltonian Interval
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.
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
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?
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)
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.
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 )
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) .
5
8
De Bruijn sequences
Figure 8.1
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
Figure 8.3
Figure 8.4
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
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
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)|.
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 .
Results :
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
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.
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.
12
(a) Peterson Graph (b)
(c) (d)
(e)
13
(a) (b)
(c) (d)
(a) (b)
14