GRAPH THEORY (BCS405B) 2024
MODULE-2
Eulerian and Hamiltonian graphs: Euler graphs, Operations on graphs, Hamiltonian paths and circuits, travelling
salesman problem. Directed graphs – types of digraphs, Digraphs and binary relation.
𝐄𝐮𝐥𝐞𝐫 𝐥𝐢𝐧𝐞 𝐚𝐧𝐝 𝐄𝐮𝐥𝐞𝐫 𝐠𝐫𝐚𝐩𝐡:
Let G( V, E ) be an undirected graph or multigraph with no isolated vertices.
Closed walk containing all the edges of the graph is called 𝐄𝐮𝐥𝐞𝐫 𝐥𝐢𝐧𝐞 and the graph is called Euler graph.
An open walk containing all the edges of the graph is called an unicursal line or an open Euler line and the
graph is called unicursal graph.
Theorem: A given connected graph G is an Euler graph if and only if all the vertices of G are of even degree.
Proof: If 𝐺 is an Euler graph, then 𝐺 contains an Euler line. Let 𝑎 be the starting vertex of the Euler line. In
tracing this walk for any vertex 𝑣 of 𝐺, each time the walk comes to 𝑣 it then departs from the vertex 𝑣. Thus
the walk has traversed either two new edges that are incident with 𝑣 or a new loop at 𝑣. In either case a count
of 2 is contributed to deg (𝑣). Since 𝑣 is not the starting vertex a count of 2 is obtained each time the circuit
passes through 𝑣, so degree of 𝑣 is even. For the starting vertex 𝑎, the first edge of the circuit must be distinct
from the last edge, and any other visit to a results in a count of 2 for deg (𝑎), we have deg (𝑎) is also even.
Conversely, let G be a connected graph with every vertex of even degree. If the number of edges in G is 1 or 2,
then G is of the forms
Euler line are immediate in these cases. We proceed now by induction and assume the result true for all
situations where there are fewer than 𝑛 edges. If G has n edges, select a vertex 𝑎 in G as a starting point to
build a Euler line. The graph G is connected and each vertex is of even degree, so we can construct a closed
walk C containing 𝑎. If this closed walk contain every edge of G, we are finished. If not, remove the edges of C
from G and any vertex that would become isolated. The remaining subgraph 𝐾 has all vertices of even degree,
but it may not be connected. However, each component of 𝐾 is connected and by induction hypotheses will
have a Euler line. In addition, each of these Euler line has a vertex that is on C. Consequently, starting from 𝑎
we travel on C until we arrive at a vertex 𝑣1 that is on the Euler line 𝐶1 of the component of 𝐾. Then we
traverse this Euler line and returning to 𝑣1 , continue on C until we reach a vertex 𝑣2 that is on the Euler line 𝐶2
of another component of K. Since the graph is finite, as continue this process we construct an Euler line for G.
Theorem: A connected graph G has unicursal line if and only if only two vertices are of odd degree.
DEPARTMENT OF CUMPUTER SCIENCE & ENGINEERING /C.E.C.
1
GRAPH THEORY (BCS405B) 2024
𝐊𝐨𝐧𝐢𝐠𝐬𝐛𝐞𝐫𝐠‐ 𝐛𝐫𝐢𝐝𝐠𝐞 𝐩𝐫𝐨𝐛𝐥𝐞𝐦: In Konigsberg two islands C and D, two land arias A and B are connected by
seven bridges as shown in the figure.
A
C D
Problem is whether a person can start from any land area A, B, C or D walk through all the seven bridges
exactly once and then return to the starting point. Euler represented the four land areas as vertices and the
bridges as edges of a graph.
A
C D
Now the problem is to find a closed walk containing all the edges of the graph. A graph contains an Euler
line if and only if all the vertices are of even degree. But in the above graph all the vertices are of odd degree.
Therefore no Euler line exists. And hence no one can walk through all the seven bridges exactly once and then
return to the starting point.
For what values of n , K 𝑛 has an Euler circuit?
Theorem: A given connected graph is unicursal graph if and only if it has exactly two vertices of odd degree.
Operations on graph: Let 𝐺1 (𝑉1 , 𝐸1 ) and 𝐺2 (𝑉2 , 𝐸2 ) are given two graphs.
Union of two graphs: 𝐺1 ∪ 𝐺2 = 𝐺3 (𝑉3 , 𝐸3 ), where 𝑉3 = 𝑉1 ∪ 𝑉2 and 𝐸3 = 𝐸1 ∪ 𝐸2 .
Intersection of two graphs: 𝐺1 ∩ 𝐺2 = 𝐺4 (𝑉4 , 𝐸4 ), where 𝑉4 = 𝑉1 ∩ 𝑉2 and 𝐸4 = 𝐸1 ∩ 𝐸2 .
Ring sum of two graphs:
𝐺1 ⊕ 𝐺2 = 𝐺5 (𝑉5 , 𝐸5 ), where 𝑉5 = 𝑉1 ∪ 𝑉2 and 𝐸5 = 𝐸1 ⨁𝐸2 (i.e. edges that are in 𝐺1 or in 𝐺2 but not in both.
DEPARTMENT OF CUMPUTER SCIENCE & ENGINEERING /C.E.C.
2
GRAPH THEORY (BCS405B) 2024
Clearly if 𝐺1 and 𝐺2 are edge disjoint, then 𝐺1 ∩ 𝐺2 is a null graph and 𝐺1 ∪ 𝐺2 = 𝐺1 ⊕ 𝐺2 .
If 𝐺1 and 𝐺2 are vertex disjoint, then 𝐺1 ∩ 𝐺2 is empy.
For any graph 𝐺, 𝐺 ∪ 𝐺 = 𝐺, 𝐺 ∩ 𝐺 = 𝐺 and 𝐺⨁𝐺 = Null graph.
If 𝐺1 is subgraph of 𝐺, then 𝐺 ⊕ 𝐺1 is a subgraph of 𝐺 obtained by removing all the edges of 𝐺1 from 𝐺.
Therefore, if 𝐺1 is subgraph of 𝐺 then 𝐺 ⊕ 𝐺1 = 𝐺 − 𝐺1 . (Compliment of 𝐺1 in 𝐺).
Find the union, intersection, and ring sum of the following two graphs.
𝑣1
𝑣1 ℎ 𝑣6
𝑎 𝑏
𝑎 𝑔
𝑣2 𝑣3 𝑘
𝑐
𝑙
𝑑 𝑒 𝑣2 𝑐 𝑣3
𝑣5
𝑣4 𝑓 𝑣5
𝐺2
𝐺1
Decomposition: Two subgraphs 𝐺1 and 𝐺2 of a graph 𝐺 are said to be decomposition of 𝐺 if,
𝐺1 ∪ 𝐺2 = 𝐺 and 𝐺1 ∩ 𝐺2 = a null graph.
Deletion: Let 𝑣 be any vertex of a graph 𝐺, then 𝐺 − 𝑣 denotes a subgraph of 𝐺 obtained by deleting the vertex
𝑣 and all the edges incident on 𝑣 from 𝐺.
For any edge 𝑒 of 𝐺, 𝐺 − 𝑒 is a subgraph of 𝐺 obtained by deleting the edge 𝑒 only from 𝐺.
∴ 𝐺−𝑒 =𝐺⊕𝑒.
𝐺
𝑣
Find the graph 𝐺 − 𝑣 and 𝐺 − 𝑎.
Fusion: A pair of vertices 𝑎, 𝑏 in a graph are said to be fused (merged or identified) if the two vertices are
replaced by a single new vertex such that every edge that was incident on either a or b or on both is
incident on the new vertex.
DEPARTMENT OF CUMPUTER SCIENCE & ENGINEERING /C.E.C.
3
GRAPH THEORY (BCS405B) 2024
𝑒
𝑒 𝑓 2
1 1
3
2 3
𝑓
𝑎 𝑏 (𝑎𝑏)
4
4 5 6
6 5
𝑑 𝑐 7 𝑑
𝑐 7
Given graph Fusion of vertices 𝑎 and 𝑏.
Arbitrarily traceable graphs: An Euler graph is said to be an arbitrarily traceable graph from a vertex 𝑣 if one
can always trace Euler line from 𝑣 whenever walk arrives at a vertex, he can select any edge incident on it
which has not been previously traversed.
Arbitrarily traceable from 𝑎. Not arbitrarily traceable. Arbitrarily traceable from all vertices.
Hamiltonian paths and circuits: A circuit in a connected graph 𝐺 is said to be Hamiltonian if it includes every
vertex of 𝐺. A path containing all the vertices of the graph is called Hamiltonian path. If we remove any one
edge from a Hamiltonian circuit we get Hamiltonian path.
𝑛−1
Theorem: If n is an odd number≥ 3, then 𝐾𝑛 contains edge disjoint Hamiltonian circuits.
2
𝑛(𝑛−1) 𝑛−1
Proof: Since 𝐾𝑛 contains edges and each Hamiltonian circuit contains 𝑛 edges, there are at most
2 2
𝑛−1
edge disjoint Hamiltonian circuits possible. For odd 𝑛, there are edge disjoint Hamiltonian circuits
2
can be shown as follows:
The subgraph of a complete graph 𝐾𝑛 given below is a Hamiltonian circuit. Keeping the vertices fixed on
360 360 360 (𝑛−3) 360
a circle, rotate the polygonal pattern clockwise by 𝑛−1 , 2 × 𝑛−1 , 3 × 𝑛−1 ⋯ ⋯ ⋯ , × 𝑛−1 degrees.
2
Clearly each rotation produces a Hamiltonian circuit that has no edge in common with any of the previous
(𝑛−3)
ones. Thus we have new Hamiltonian circuits, all edge disjoint from the one given in the figure and
2
also edge disjoint among themselves.
DEPARTMENT OF CUMPUTER SCIENCE & ENGINEERING /C.E.C.
4
GRAPH THEORY (BCS405B) 2024
5
3 𝑛−2
2 𝑛
1
𝑛−1
4
𝑛−3
(𝑛−3) 𝑛−1
Therefore there are +1= edge disjoint Hamiltonian circuits in 𝐾𝑛 .
2 2
Directed graph (Digraph): Let 𝑉 be a nonempty set, and 𝐸 ⊆ 𝑉 × 𝑉. The pair 𝐺( 𝑉, 𝐸 ) is called directed
graph or digraph.
In-degree and out-degree: The number of edges in 𝐺 that are incident into the vertex 𝑣 is called in-degree of 𝑣
and denoted by 𝑜𝑑(𝑣) or 𝑑+ (𝑣).
The number of edges in 𝐺 that are incident from the vertex 𝑣 (incident out of the vertex 𝑣) is called out-degree
of 𝑣 and denoted by 𝑖𝑑(𝑣) or 𝑑 − (𝑣).
In a digraph isolated vertex is a vertex in which the in-degree and out- degree are both equal to zero.
For a vertex 𝑣 of a digraph 𝐺 if 𝑑 + (𝑣) + 𝑑 − (𝑣) = 1 then 𝑣 is a pendent vertex.
Two directed edges are said to be parallel if they are incident from the same vertex and incident into the same
vertex.
Types of digraphs:
1. Simple digraphs: A digraph that has no self-loop and parallel edges is called simple digraph.
2. Asymmetric or antisymmetric digraphs: Digraphs that have at most one directed edge between a pair of
vertices, but are allowed to have self-loops are called asymmetric digraphs. That means at the most one of the
edge(𝑎, 𝑏), (𝑏, 𝑎) ∈ 𝐸 for any 𝑎, 𝑏 ∈ 𝑉.
Complete asymmetric digraphs: Digraphs that have exactly one directed edge between a pair of vertices. That
means exactly one of the edge(𝑎, 𝑏), (𝑏, 𝑎) ∈ 𝐸 for any 𝑎, 𝑏 ∈ 𝑉.
3. Symmetric digraphs: Digraphs in which if (𝑎, 𝑏) ∈ 𝐸 then (𝑏, 𝑎) ∈ 𝐸 for any 𝑎, 𝑏 ∈ 𝑉.
Complete symmetric digraphs: A digraph in which there is exactly one edge directed from every vertex to every
other vertex.
4. Balanced digraphs or isographs: A digraph is said to be balanced if 𝑑+ (𝑣) = 𝑑 − (𝑣) for every vertex 𝑣 of 𝐺.
5. Regular digraphs: In a balanced digraphs all the vertices are of same in-degree and same out- degree then it is
regular.
DEPARTMENT OF CUMPUTER SCIENCE & ENGINEERING /C.E.C.
5
GRAPH THEORY (BCS405B) 2024
Digraphs and binary relations:
A subset of 𝐴 × 𝐴 is called a binary relation on 𝐴.
Every relation on a finite set can be represented by a digraph without parallel edges, and every digraph without
parallel edges defines a binary relation on the set of vertices.
Reflexive relation:
A relation ℛ on a set 𝐴 is called reflexive if ∀ 𝑥 ∈ 𝐴, (𝑥, 𝑥) ∈ ℛ (or 𝑥ℛ𝑥 ).
Symmetric relation: A relation ℛ on a set 𝐴 is called symmetric
if (𝑥, 𝑦) ∈ ℛ ⟹ (𝑦, 𝑥) ∈ ℛ , ∀ 𝑥, 𝑦 ∈ 𝐴 (or 𝑥ℛ𝑦 ⟹ 𝑦ℛ𝑥, ∀ 𝑥, 𝑦 ∈ 𝐴 ).
Transitive relation: A relation ℛ on a set 𝐴 is called transitive
if (𝑥, 𝑦), (𝑦, 𝑧) ∈ ℛ ⟹ (𝑥, 𝑧) ∈ ℛ , ∀ 𝑥, 𝑦, 𝑧 ∈ 𝐴 .
(or 𝑥ℛ𝑦 𝑎𝑛𝑑 𝑦ℛ𝑧 ⟹ 𝑥ℛ𝑧, ∀ 𝑥, 𝑦, 𝑧 ∈ 𝐴 ).
Anti-symmetric relation: A relation ℛ on a set 𝐴 is called antisymmetric
If ∀ 𝑥, 𝑦 ∈ 𝐴 , (𝑥, 𝑦), (𝑦, 𝑥) ∈ ℛ ⟹ 𝑥 = 𝑦.
Or, if 𝑥 ≠ 𝑦 then at the most one of the (𝑥, 𝑦) & (𝑦, 𝑥) belongs to ℛ.
Irreflexive relation: A relation ℛ on a set 𝐴 is called irreflexive if ∀ 𝑥 ∈ 𝐴, (𝑥, 𝑥) ∉ ℛ .
Note: Every reflexive relation is not irreflexive, and every irreflexive relation is not reflexive,
but there are relations which are neither reflexive nor irreflexive.
Consider the following relations on 𝐴 = {1, 2, 3}
1. ℛ = {(1, 1), (2, 2)(3, 3), (1, 2)} is reflexive but not irreflexive.
2. ℛ = {(1, 3), (2, 3)(3,1), (1, 2)} is irreflexive but not reflexive.
3. ℛ = {(1, 1), (3, 1), (1, 2)} is neither reflexive nor irreflexive.
Let 𝐴 = {1, 2, 3} some examples of relations on A is given below.
Reflexive Symmetric Transitive Relation ℛ on 𝐴
{(1, 2), (2, 3)}
{(1, 2), (1, 3)}
{(1, 2), (2, 1)}
{(1, 1), (2, 2)}
DEPARTMENT OF CUMPUTER SCIENCE & ENGINEERING /C.E.C.
6
GRAPH THEORY (BCS405B) 2024
{(1, 1), (2, 2)(3, 3), (1, 2), (2, 3)}
{(1, 1), (2, 2)(3, 3), (1, 2)}
{(1, 1), (2, 2)(3, 3), (1, 2), (2, 1), (1, 3), (3,1)}
{(1, 1), (2, 2)(3, 3)} , 𝐴 × 𝐴 .
Symmetric Anti-Symmetric Relation ℛ on 𝐴
{(1, 2), (2, 1), (2, 3)}
{(1, 2), (2, 3)}
{(1, 2), (2, 1)}
{(1, 1), (2, 2)}
Equivalence relation: A relation ℛ on a set 𝐴 is called Equivalence relation if ℛ is reflexive, symmetric and
transitive.
Examples: 1. Let 𝐴 = {1, 2, 3} , both ℛ = {(1, 1), (2, 2)(3, 3)} , and ℛ = 𝐴 × 𝐴 are equivalence relations
on 𝐴.
2. For a fixed integer 𝑛 > 1, Prove that the relation “Congruent modulo 𝑛” is an equivalence relation on the
set of all integers ℤ.
Equivalence class: Let ℛ be an equivalence relation on 𝐴 , For each element 𝑥 ∈ 𝐴 equivalence class of 𝑥, is
defined by [𝑥] = {𝑦 ∈ 𝐴|(𝑦, 𝑥) ∈ ℛ}.
A graph representing an equivalence relation is called equivalence graph. Because of the symmetry in
equivalence graph if (𝑎, 𝑏) ∈ 𝐸 then (𝑏, 𝑎) ∈ 𝐸, hence two directed edges can be replaced by a single
undirected edge.
Partition of a set 𝑨: Given a set 𝐴 and an index set 𝐼, Let ∅ ≠ 𝐴𝑖 ⊆ 𝐴 for each 𝑖 ∈ 𝐼. Then {𝐴𝑖 }𝑖∈𝐼 is a
partition of 𝐴 if i) 𝐴 = ⋃𝑖∈𝐼 𝐴𝑖 ii) 𝐴𝑖 ∩ 𝐴𝑗 = ∅, for all 𝑖, 𝑗 ∈ 𝐼 with 𝑖 ≠ 𝑗 .
Each subset 𝐴𝑖 is called a cell or block of the equation.
Or the nonempty subsets 𝐴1 , 𝐴2 , 𝐴3 ⋯ ⋯ 𝐴𝑛 form a partition of 𝐴 if
i) 𝐴 = 𝐴1 ∪ 𝐴2 ∪ 𝐴3 ⋯ ⋯ ∪ 𝐴𝑛
ii) 𝐴𝑖 ∩ 𝐴𝑗 = ∅, for 𝑖 ≠ 𝑗 .
Every equivalence relation (or equivalence graph) partitions the vertex set into different components.
DEPARTMENT OF CUMPUTER SCIENCE & ENGINEERING /C.E.C.
7
GRAPH THEORY (BCS405B) 2024
Partial order relation: A relation ℛ on a set 𝐴 is called Partial order if ℛ is reflexive, anti-symmetric and
transitive. The order pair (𝐴, ℛ) is called poset.
Examples: 1. Set 𝐴 = {1, 2, 3, 4, 6, 9} with divisibility relation ℛ is poset.
2. Power set of any finite set with subset relation is poset.
DEPARTMENT OF CUMPUTER SCIENCE & ENGINEERING /C.E.C.
8