DM U3
DM U3
2
Please read this disclaimer before proceeding:
This document is confidential and intended solely for the educational purpose of
RMK Group of Educational Institutions. If you have received this document
through email in error, please notify the system manager. This document
contains proprietary information and is intended only to the respective group /
learning community as intended. If you are not the addressee you should not
disseminate, distribute or copy through e-mail. Please notify the sender
immediately by e-mail if you have received this document by mistake and delete
this document from your system. If you are not the intended recipient you are
notified that disclosing, copying, distributing or taking any action in reliance on
the contents of this information is strictly prohibited.
3
22MA301 DISCRETE MATHEMATICS
DEPARTMENT CSE/CSD/IT/ADS
BATCH/YEAR 2022-2026/II
DATE 05.08.2023
4
Table of Contents
5
Course Objectives:
S.NO TOPIC
6
PREREQUISITES
7
22MA301 DISCRETE MATHEMATICS
LTPC
3204
UNIT II COMBINATORICS 15
Graphs and graph models – Graph terminology and special types of graphs – Matrix
representation of graphs and graph isomorphism – Connectivity – Euler and
Hamilton paths.
8
COURSE OUTCOMES
S.NO TOPIC
9
22MA301 DISCRETE MATHEMATICS
Course Outcome mapping with POs / PSOs
POs
PO PO PO PO PO PO PO PO PO PO PO PO PSO PSO PSO
1 2 3 4 5 6 7 8 9 10 11 12 1 2 3
COs
CO1 2 3 1 - - - - - - - - 1 2 - -
CO2 3 2 - - - - - - - - - - - -
CO3 2 2 - 2 - - - - - - - 1 2 - -
CO4 2 1 - 1 - - - - - - - - - - -
CO5 2 2 1 - - - - - - - - - 2 - -
10
UNIT – III GRAPH THEORY
11
Lecture plan
Actual
S. Topics to be No of Proposed Taxonomy Mode of
Lecture CO
No. covered periods date level Delivery*
Date
Introduction of Board &
1 2 CO3 K1
Graph 15.09.2023 Chalk
12
ACTIVITY BASED LEARNING
Activity based learning helps students express and embrace their curiosity.
Once the students become curious, they tend to explore and learn by themselves.
To evoke curiosity in students, Practice quiz is designed for al the five units.
https://quizizz.com/join/quiz/5f349febe9d
Basic e13001befaf49/start?from=soloLinkShare
Quiz &Flash
1. concepts of &referrer=5dea01388362a6001b41136a
Card
Graph theory
https://quizizz.com/admin/quiz/flashcards
Simple Quiz &Flash /5f349febe9de13001befaf49?q=%2Fadmi
2.
theorems Card n&source=preGameScreen
Isomorphism, https://quizizz.com/join/quiz/5f349d94f94
Hamiltonian Quiz &Flash b0b001d5bf2db/start?from=soloLinkShar
3. e&referrer=5dea01388362a6001b41136a
paths, Euler Card
path.
Basic
Cross word https://drive.google.com/file/d/1jR
4. Definitions of
Puzzle _MdKcmAuQVQPXswLFMImEk9T8A
Graph theory
cum0/view?usp=sharing
Basic https://docs.google.com/document/d/1Tu
Assignment uFyeTk1S4xC-
5. concepts of
1 jJO5uvA77VhV6vqgLsdWBp2hiWI4Q/edit?
Graph theory usp=sharing
Euler and https://docs.google.com/document/d/1D
Assignment 34JzRJMRDGMbgG7OATCBUOC7_meopa
6. Hamilton
2 ORxo6KPmhSm4/edit?usp=sharing
paths.
13
UNIT-III
GRAPHS
3.1 INTRODUCTION
Graphs are discrete structures consisting of vertices and edges that connect
these vertices. Depending on the type and number of edges that can connect a pair
of vertices, there are many kinds of different graphs. The graph models can be used
to represent almost every problem involving discrete arrangement of objects, where
we are not concerned with their internal properties but with their inter-relationship.
In this section, we shall define a graph as an abstract mathematical system and
also represent graphs diagrammatically. Then we shall discuss some of the basic
concepts and theorems of graph theory.
e8 e5 v3
Figure 1.
e2 e3
v1
v2
e1
SELF LOOP:
An edge of a graph that joins a vertex to itself is called a loop. The direction
of a loop is not significant, as the initial and terminal nodes are one and the same.
Example: In Figure 1, the edge e7 is called Self loop or simply loop.
14
PARALLEL EDGES:
If, in a directed or undirected graph, certain pairs of vertices are joined by
more than one edge, such edges are called parallel edges. In the case of directed
edges, the two possible edges between a pair of vertices which are opposite in
direction are considered distinct.
Example: In Figure 1, the edges e1 and e2 are called parallel edges.
ADJACENT EDGES AND VERTICES
If an edge e ∈ E is associated with an ordered pair or an unordered pair (u,
v), where u, v ∈ V, then e is said to connect or join the nodes u and v. The edge e
that connects the nodes u and v is said to be incident on each of the nodes. Two
edges are said to be adjacent if they are incident on a common vertex.
Example: In Figure 1, the edge e6 and e8 are adjacent and the vertices v1 and v5 are
adjacent vertices.
ISOLATED VERTEX & PENDANT VERTEX
A node of a graph which is not adjacent to any other node (viz., which is not
connected by an edge to any other node) is called an isolated vertex (or)
isolated node. Example: In Figure 1 the vertex v6 is isolated vertex.
A vertex of a graph is called a pendant vertex if only one edge is incident
with it.
PSEUDOGRAPH
A graph in which loops and parallel edges are allowed is called a Pseudo
graph.
Example: Figure 1 [Here e7 is a Self-loop, edges e1 and e2 are parallel edges]
DEGREE OF A VERTEX (Undirected Graph)
The degree of a vertex in an undirected graph is the number of edges
incident with it, with the exception that a loop at a vertex contributes twice to the
degree of that vertex. The degree of a vertex v is denoted by deg (v). Clearly the
degree of an isolated vertex is zero. If the degree of a vertex is one, it is called a
pendant vertex.
For example, let us consider the graph Figure 1
deg (v1) = 2, deg (v2) =4, deg (v3) =2
deg (v4) = 5, deg (v5) = 4, deg (v6) = 0 . We note that v6 is an isolated vertex
SIMPLE GRAPH
A graph, in which there is only one edge between a pair of vertices (neither
self-loop nor parallel edges), is called a simple graph.
v4 e3 v3
Example
e2 e4
v1 e1 v2
15
MULTIGRAPH
A graph which contains some parallel edges is called a multigraph.
v1
Example: e1 e2
e3
v2 v3
e4
NULL GRAPH
A graph containing only isolated nodes (viz. no edges) is called a null graph.
Example:
v1 v4
v2 v3
WEIGHTED GRAPH
Graphs in which a number (weight) is assigned to each edge are called
weighted graphs.
INDEGREE &OUT DEGREE (Directed Graph)
In a directed graph, the number of edges with v as their terminal vertex (i.e.,
the number of edges that converge at v) is called the in-degree of v and denoted as
deg (v) .
The number of edges with v as their initial vertex, (i.e., the number of edges
that emanate from v) is called the out-degree of v and is denoted as deg (v) .
A vertex with zero in degree is called a source and a vertex with zero degree out
is called a sink.
Let us consider the following directed graph.
a b
d c
16
In degree of v Out degree of v Total degree of v
This is obvious, because each edge of the graph converges at one vertex and
emanates from one vertex and hence contributes 1 each to the sum of the in-
degrees and to the out-degrees.
(i.e.) the sum of the degrees of all the vertices of an undirected graph is twice the
number of edges of the graph and hence even.
Proof: Since every edge is incident with exactly two vertices, every edge contributes
2 to the sum of the degree of the vertices.
∴ All the e edges contribute (2e) to the sum of the degrees of the vertices (i.e.)
i deg(vi ) 2e .
Theorem 2: The number of vertices of odd degree in an undirected graph is
even.
Proof: Let G = (V, E) be the undirected graph.
Let V1 and V2 and be the sets of vertices of G of even and odd degrees
respectively.
Then, by the previous theorem, (The Handshaking theorem)
v V
deg(vi ) deg(v j ) = 2e
v V
-------(1)
i 1 j 2
17
Since each deg(Vi) is even, deg(vi )
viV1
is even =2k
Theorem 3: The maximum number of edges in a simple graph with ‘n’ vertices is
n(n 1)
.
2
Proof: We prove this theorem by the principle of Mathematical Induction.
For n=1, a graph with one vertex has no edges.
Therefore, the result is true for n=1.
For n=2, a graph with 2 vertices may have at most one edge.
2 (2 1)
Therefore, =1 .The result is true for n=2.
2
Assume that the result is true for n=k. i.e., a graph with k vertices has at most
k (k 1)
edges.
2
When n=k+1, let G be a graph having ‘n’ vertices and G’ be the graph obtained from
G by deleting one vertex say v ϵ V (G).
k (k 1)
Since G’ has k vertices, then by the hypothesis G’ has at most edges. Now
2
add the vertex ‘v’ to G’, such that ‘v’ may be adjacent to all k vertices of G’.
Therefore, the total number of edges in G are
k (k 1) k 2 k 2k k 2 k k (k 1)
k
2 2 2 2
(k 1)(k 1 1)
2
Therefore, the result is true for n=k+1. Hence the maximum number of edges in a
n(n 1)
simple graph with ‘n’ vertices is .
2
Problems:
1. How many edges are there in a graph with ten vertices each of degree six.
Solution: Let e be the number of edges of the graph.
2e = sum of all degrees = 10x6 = 60
2e = 60
i.e, e = 30 ∴ There are 30 edges.
18
2. Can a simple graph exist with 15 vertices each of degree 5.
Solution: We know that
2e = sum of all degrees of vertices =15x5 = 75
∴ e = 75, which is not an integer
∴ Such a graph does not exist.
(or)
By theorem 2, in a graph the number of odd degree vertices is even. Therefore, it
is not possible to have 15 vertices, which is of odd degree.
19
Let |E|= the number of edges of the given graph.
By Handshaking theorem, (Proof should be included here)
deg(v i ) 2 | E | 2nk 2 | E | | E | nk
Number of edges = Multiple of k .
Therefore, the number of edges of the given graph is a multiple of k.
K2
K3
K4
Regular Graph:
If every vertex of a simple graph has the same degree then the graph is called regular
graph (or) number of vertices and number of edges is same.
Example:
2-Regular
Graphs
3-Reguar
Graphs
20
Sub graph:
Given two graphs G and G1, we say that G1 is a subgraph of G if the following
conditions hold.
(i) All the vertices and all the edges of G1 are in G.
(ii) Each edge of G1 has the same end vertices in G as in G1.
v2
Example: v
2
v1 v3
v1 v3
v4
v4 v5
G1 G
G1 is a subgraph of G since all the vertices and all the edges of the graph G 1 are in
the graph of G and that every edge in G1 has the same end vertices in G as in G1.
Results on Subgraph:
Every graph is a subgraph of itself.
If G1 is a subgraph of G2 and G2 is a subgraph of G, then G1 is subgraph of G.
A single vertex in a graph G is a subgraph of G.
Every simple graph of n vertices is a subgraph of complete graph Kn.
Complementary Graph:
The complement G of a simple graph G, has the same vertices as G.
Two vertices are adjacent in G iff they are not adjacent in G.
Example: (i) If G=Kn then G is a graph with n vertices and no edges.
(ii)
G Gc
Note: (i) If G is a self complementary graph then
Number of edges of G = Number of edges in Gc.
(ii) A graph G is said to self complementary if G G c .
Theorem:
Show that if G is a self complementary graph then n 0 or 1 (mod 4).
(or)
Any self complementary graph has 4n or (4n+1) vertices, where n is positive integer.
Proof: Given G is a self complementary graph.
Number of edges in G = Number of edges in Gc.
|E(G)| = |E(Gc)| (1)
21
Also, we know that
Total number of edges possible with n vertices
=Number of edges in G + Number of edges in Gc.
n (n 1)
m m 2m .
2
n (n-1)= 4m.
That is, n (n-1) is multiple of 4.
Either n (or) (n-1) is divisible by 4.
Therefore G is a self complementary graph with n vertices then n 0 or 1 (mod 4).
Bipartite Graph:
A bipartite graph is one whose vertices, V, can be divided into two
independent sets, V1 and V2, and every edge of the graph connects one vertex in V1
to one vertex in V2.
Example:
v1 v2
v3 v4 v5
V = {V1, V2}
V1 = {v1, v2}
V2 = {v3, v4, v5}
Example:
v1 v2 v1 v2 v3
v3 v4 v5 v4 v5
v6
K2,3 K3,3
22
Problems:
a b
a b
(i) (ii)
g c f
c
f d
e
e d
(G) (H)
Solution: (i) Given graph is bipartite because its disjoint sets V1={a, b, d} and
V2={c, e, f, g} and each edge connects a vertex in one of these subsets to a vertex
in the other subset.
(ii) Given graph is not bipartite because its vertex set cannot be partitioned into two
subsets. So that edges do not connect two vertices from the same subset.
2. Is K3 a bipartite?
Solution: No, the complete graph K3 is not bipartite. If we divide the vertex set K3
into two disjoint sets, one of the two sets must contain two vertices. If graph is
bipartite, these two vertices should not be connected by an edge, but in K3 each
vertex is connected to every other vertex by an edge.
23
v2
3. For any bipartite graph G with e edges and v vertices, prove that e .
4
Solution: Let G be a bipartite graph with bipartition (V1, V2).
Let |V1|=m and |V2|=n V=m + n.
We know that, the number of edges of a bipartite graph is maximum, when it is
complete bipartite graph (Km,n). So the maximum number of edges is mn.
The number of edges of
G mn e mn .
m n
We know that, mn e [ A.M. G.M.]
2
2
m n
mn e
2
v2
e.
4
1. The adjacency matrix completely defines a simple graph and it is symmetric i.e.,
aij = aji .
2. Any element of the adjacency matrix for a simple graph is either 0 or 1.
Therefore, it is also called bit matrix or Boolean matrix.
3. Any row total or column total is the degree of the corresponding matrix.
Note: A Pseudograph can also be represented by an adjacency matrix. In this case
the loop at the vertex Vi is represented by 1 at i, i th position. The i, j th entry equal
to the number of edges that are incident on Vi andVj .
24
Path matrix: Let G = V, E be a simple digraph in which V = n and the
nodes of G are assumed to be ordered. An n × n matrix P whose elements
are given by
1, if there exists a path from Vi to Vj
pij =
0, otherwise.
Solution:
(a). v1 v2 v3 v4 (b). v1 v2 v3 v4
v1 0 1 1 1 v1 0 1 0 0
v2 1 0 1 0 v2 0 0 1 0
v3 1 1 0 0 v3 1 1 0 0
v4 1 0 0 0 v4 0 1 1 0
(c) . K 4
v1 v2 v3 v4
v1 0 1 1 1
v2 1 0 1 1
v3 1 1 0 1
v4 1 1 1 0
25
(d). K 2,3
v1 v2 v3 v4 v5
v1 0 0 1 1 1
v2 0 0 1 1 1
v3 1 1 0 0 0
v4 1 1 0 0 0
v5 1 1 0 0 0
(e).C4 v1 v2 v3 v4
v1 0 1 0 1
v2 1 0 1 0
v3 0 1 0 1
v4 1 0 1 0
𝑎 𝑏 𝑐 𝑑
𝑎 0 3 0 2
A = 𝑎𝑖𝑗 = 𝑏 3 0 1 1
𝑐 0 1 1 2
𝑑 2 1 2 0
26
3. Draw undirected graph of the following adjacency matrix.
(i). 0 1 0 (ii). 0 1 1 0
1 0 1 1 0 0 1
1 0 0 1
0 1 0
0 1 1 0
a b c
a 0 1 0
b 1 0 1
c 0 1 0
The undirected graph is
a b c d
a 0 1 1 0
b 1 0 0 1
c 1 0 0 1
d 0 1 1 0
(i). (ii).
27
(iii)
Solution:
e1 e2 e3 e4 e5 e1 e2 e3 e4 e5 e6
B = Bij = v1 1 0 0 1 1 B = Bij = v1 1 1 0 0 0 0
v2 1 1 0 0 0 v2 0 0 1 1 0 1
v3 0 1 1 0 1 v3 0 0 0 0 1 1
v4 0 0 1 1 0 v4 1 0 1 0 0 0
v5 0 1 0 1 1 0
e1 e2 e3 e4 e5 e6 e7 e8
v1 1 1 1 0 0 0 0 0
v2 0 1 1 1 0 1 1 0
B = Bij =
v3 0 0 0 1 1 0 0 0
v4 0 0 0 0 0 0 1 1
v5 0 0 0 0 1 1 0 0
6. Find the adjacency matrix of the following graph G. Hence find degree of each vertex.
Also find A2 and A3 . What is your observation regarding entries in A2 and A3 .
Solution:
v1 v2 v3 v4
v1 0 1 0 1
A = aij = v2 1 0 1 1
v3 0 1 0 1
v4 1 1 1 0
0 1 0 1 0 1 0 1 2 1 2 1
Now, A2 = A × A = 1 0 1 1 × 1 0 1 1 = 1 3 1 2
0 1 0 1 0 1 0 1 2 1 2 1
1 1 1 0 1 1 1 0 1 2 1 3
29
2 1 2 1 0 1 0 1 2 5 2 5
A =A ×A= 1 3
3 2 1 2 × 1 0 1 1 = 5 4 5 5
2 1 2 1 0 1 0 1 2 5 2 5
1 2 1 3 1 1 1 0 5 5 5 4
Observation:
(i). A2 and A3 are symmetric matrices.
(ii). i, i th entry of A2 = deg vi .
Example: v2 , v2 entry in 3 = deg v2
(iii). i, j th entry i ≠ j entry of A2
= Number of different paths of lengths 2 between ith and jth vertices.
Example: 1,3 th entry of
A2 = 2 = Number of different paths of lengths 2 between the vertices v1 and v3 .
v1 v2 v3 v4
v1 0 1 0 0
A=
v2 1 0 0 0
v3 0 0 0 1
v4 0 0 1 0
0 1 0 0 0 1 0 0 1 0 0 0
Now A2 = A × A = 1 0 0 0 × 1 0 0 0 = 0 1 0 0
0 0 0 1 0 0 0 1 0 0 1 0
0 0 1 0 0 0 1 0 0 0 0 1
1 0 0 0 0 1 0 0 0 1 0 0
A3 = A2 × A = 0 1 0 0 × 1 0 0 0 = 1 0 0 0
0 0 1 0 0 0 0 1 0 0 0 1
0 0 0 1 0 0 1 0 0 0 1 0
30
0 1 0 0 00 1 0 1 0 0 0
A4 = A3 × A = 1 0 0 0 × 1 0
0 0 = 0 1 0 0
0 0 0 1 00 0 1 0 0 1 0
0 0 1 0 1 0 0 0 0 0 0 1
2 2 0 0
∴ Y = A + A2 + A3 + A4 = 2 2 0 0
0 0 2 2
0 0 2 2
Observation:
(i). A2 and A3 are symmetric matrix.
(ii). i, i th entry of A2 = deg vi
(iii). i, j th entry of A2
= Number of different paths of lengths 2 between ith and jth vertices.
8. Find all the simple paths from A to E and all cycles with respect to vertex A of the
given graph.
(G) (H)
31
Solution: Given graphs 𝐺 and 𝐻 are having same number of vertices and same number of
edges.
Let 𝑢 = {𝑢1 , 𝑢2 , 𝑢3 , 𝑢4 } and 𝑣 = {𝑣1 , 𝑣2 , 𝑣3 , 𝑣4 } are vertex sets of 𝐺 and 𝐻 respectively.
i.e., 𝑢 = 𝑣 = 4 and 𝐸1 = 𝐸2 = 4.
Degree of the vertices of 𝐺:
𝑑 𝑢1 = 𝑑 𝑢2 = 𝑑 𝑢3 = 𝑑 𝑢4 = 2.
Degree of the vertices of 𝐻:
𝑑 𝑣1 = 𝑑 𝑣2 = 𝑑 𝑣3 = 𝑑 𝑣4 = 2.
Define 𝑓: 𝐺 → 𝐻
Choose a vertex 𝑢1 in 𝐺. It has degree 2 and the two adjacent vertices of ‘𝑢1 ’ having the
degree sequence 2, 2.
Correspondingly choose a vertex 𝑣1 in 𝐻 with same degree and same degree sequence of
adjacent vertices.
∴ 𝑓 𝑢1 = 𝑣1
Similarly, all other vertices are having same degree and same degree sequence of the
adjacent vertices from 𝐺 and 𝐻.
i.e.,𝑓 𝑢2 = 𝑣4 , 𝑓 𝑢3 = 𝑣3 , 𝑓 𝑢4 = 𝑣2 .
∴ 𝐺 and 𝐻 are isomorphic.
10. Show that the graphs given below are not isomorphic.
(G) (H)
32
11. Determine whether the graphs G and H given below are isomorphic.
a b p
q
e f
u
d c t s
(G) (H)
Solution: Given graphs 𝐺 and 𝐻 are having same number of vertices and same
number of edges.
Let 𝑉1 = {𝑎, 𝑏, 𝑐, 𝑑, 𝑒, 𝑓} and 𝑉2 = {𝑝, 𝑞, 𝑟, 𝑠, 𝑡, 𝑢} are vertex sets of 𝐺 and 𝐻 respectively.
i.e., 𝑉1 = 𝑉2 = 6and 𝐸1 = 𝐸2 = 7.
Degree of the vertices of 𝐺:
𝑑 𝑎 = 𝑑 𝑐 = 𝑑 𝑒 = 𝑑 𝑓 = 2, 𝑑 𝑏 = 𝑑 𝑑 = 3.
Degree of the vertices of 𝐻:
𝑑 𝑝 = 𝑑 𝑞 = 𝑑 𝑠 = 𝑑 𝑢 = 2, 𝑑 𝑟 = 𝑑 𝑡 = 3.
Define 𝑓: 𝐺 → 𝐻
Choose a vertex '𝑎’ in 𝐺. It has degree 2 and the two adjacent vertices of ‘𝑎’ having
the degree sequence 3,3.
Correspondingly choose a vertex ‘𝑠’ in 𝐻 with same degree and same degree
sequence of adjacent vertices.
∴𝑓 𝑎 =𝑠
Similarly, all other vertices are having same degree and same degree sequence of
the adjacent vertices from 𝐺 and 𝐻.
i.e.,𝑓 𝑏 = 𝑟, 𝑓 𝑐 = 𝑢, 𝑓 𝑑 = 𝑡, 𝑓 𝑒 = 𝑝, 𝑓 𝑓 = 𝑞.
∴ 𝐺 and 𝐻 are isomorphic.
12. Examine whether the following pair of graphs given below are isomorphic or not?
A
B C
33
Solution: Given graphs 𝐺1 and 𝐺2 are having same number of vertices and
same number of edges.
Let 𝑉1 = {𝐴, 𝐵, 𝐶, 𝐷} and 𝑉2 = {𝑣1 , 𝑣2 , 𝑣3 , 𝑣4 } are vertex sets of 𝐺1 and 𝐺2 respectively.
i.e., 𝑉1 = 𝑉2 = 4 and 𝐸1 = 𝐸2 = 6.
Degree of the vertices of 𝐺1 :
𝑑 𝐴 = 𝑑 𝐵 = 𝑑 𝐶 = 𝑑 𝐷 = 3.
Degree of the vertices of 𝐺2 :
𝑑 𝑣1 = 𝑑 𝑣2 = 𝑑 𝑣3 = 𝑑 𝑣4 = 3.
Define 𝑓: 𝐺1 → 𝐺2
Choose a vertex '𝐴’ in 𝐺1 . It has degree 3 and the three adjacent vertices of ‘𝐴’ having the
degree sequence 3,3,3.
Correspondingly choose a vertex ‘𝑣1 ’ in 𝐺2 with same degree and same degree sequence
of adjacent vertices.
∴ 𝑓 𝐴 = 𝑣1
Similarly, all other vertices are having same degree and same degree sequence of the
adjacent vertices from 𝐺1 and 𝐺2 .
i.e.,𝑓 𝐵 = 𝑣2 , 𝑓 𝐶 = 𝑣3 , 𝑓 𝐷 = 𝑣4 .
∴ 𝐺1 and 𝐺2 are isomorphic.
A B C D
F a b c e f
(G) (G’)
Solution: Given graphs 𝐺and 𝐺 ′ are having same number of vertices and same number of
edges.
Let 𝑉1 = {𝐴, 𝐵, 𝐶, 𝐷, 𝐸, 𝐹} and 𝑉2 = {𝑎, 𝑏, 𝑐, 𝑑, 𝑒, 𝑓} are vertex sets of 𝐺and 𝐺 ′ respectively.
i.e., 𝑉1 = 𝑉2 = 6 and 𝐸1 = 𝐸2 = 5.
Degree of the vertices of 𝐺:
𝑑 𝐴 = 𝑑 𝐸 = 𝑑 𝐹 = 1, 𝑑 𝐵 = 𝑑 𝐶 = 2, 𝑑 𝐷 = 3.
Degree of the vertices of 𝐺 ′ :
𝑑 𝑎 = 𝑑 𝑑 = 𝑑 𝑓 = 1, 𝑑 𝑏 = 𝑑 𝑒 = 2, 𝑑 𝑐 = 3.
Define 𝑓: 𝐺 → 𝐺 ′
34
Choose a vertex '𝐷’ in 𝐺. It has degree 3 and the three adjacent vertices of ‘𝐷’ having the
degree sequence (1,1,2).
But in 𝐺 ′ , a vertex ‘𝐶’ has degree and the three adjacent vertices of ‘𝐶’ having the
degree sequence (1,2,2).
The vertex '𝐷’ in 𝐺 is not mapped to any of the vertex in 𝐻.
Hence 𝐺 and 𝐺 ′ are not isomorphic.
14. Establish the isomorphism of the following pair of graphs.
(G) (H)
Solution: Given graphs 𝐺 and 𝐻 are having same number of vertices and
same number of edges.
Let 𝑉1 = {𝑣1 , 𝑣2 , 𝑣3 , 𝑣4 , 𝑣5 , 𝑣6 } and 𝑉2 = {𝑢1 , 𝑢2 , 𝑢3 , 𝑢4 , 𝑢5 , 𝑢6 } are vertex sets of 𝐺 and
𝐻 respectively.
i.e., 𝑉1 = 𝑉2 = 6 and 𝐸1 = 𝐸2 = 5.
Degree of the vertices of 𝐺:
𝑑 𝑣1 = 𝑑 𝑣5 = 𝑑 𝑣6 = 1, 𝑑 𝑣2 = 𝑑 𝑣4 = 2, 𝑑 𝑣3 = 3.
Degree of the vertices of 𝐻:
𝑑 𝑢1 = 𝑑 𝑢5 = 𝑑 𝑢6 = 1, 𝑑 𝑢2 = 𝑑 𝑢3 = 2, 𝑑 𝑢4 = 3.
Define 𝑓: 𝐺 → 𝐻
Choose a vertex '𝑣3 ’ in 𝐺. It has degree 3 and the three adjacent vertices of '𝑣3 ’ having
the degree sequence 1,2,2.
But in ‘𝐻′ a vertex ‘𝑢4 ’ has degree and the three adjacent vertices of ‘𝑢4 ’ having the
degree sequence 1,1,2.
The vertex '𝑣3 ’ in 𝐺 is not mapped to any of the vertex in 𝐻.
Hence 𝐺 and 𝐻 are not isomorphic.
15. Examine whether the following pair of graphs isomorphic or not?
(i)
(G) (H)
35
(ii)
(G) (H)
Solution: i) 𝑉1 = 𝑉2 = 5, 𝐸1 = 𝐸2 = 8
𝑑 𝑢1 = 𝑑 𝑢5 = 3, 𝑑 𝑢2 = 𝑑 𝑢4 = 4, 𝑑 𝑢3 = 2
𝑑 𝑣1 = 𝑑 𝑣4 = 3, 𝑑 𝑣2 = 2, 𝑑 𝑣3 = 𝑑 𝑣5 = 4
𝑓 𝑢1 = 𝑣1 , 𝑓 𝑢2 = 𝑣3 , 𝑓 𝑢3 = 𝑣2 , 𝑓 𝑢4 = 𝑣5 , 𝑓 𝑢5 = 𝑣4
∴ 𝐺 and 𝐻 are isomorphic.
ii) 𝑉1 = 𝑉2 = 5, 𝐸1 = 𝐸2 = 6
𝑑 𝑢1 = 𝑑 𝑢3 = 3, 𝑑 𝑢2 = 𝑑 𝑢4 = 𝑑 𝑢5 = 2
𝑑 𝑣1 = 𝑑 𝑣3 = 3, 𝑑 𝑣2 = 𝑑 𝑣4 = 𝑑 𝑣5 = 2
𝑓 𝑢1 = 𝑣1 , 𝑓 𝑢2 = 𝑣4 , 𝑓 𝑢3 = 𝑣3 , 𝑓 𝑢4 = 𝑣2 , 𝑓 𝑢5 = 𝑣5
∴ 𝐺 and 𝐻 are isomorphic.
(G) (H)
Solution: The graphs 𝐺and 𝐻 both have eight vertices and 10 edges.
They also both have four vertices of degree two and four of degree three.
However, 𝐺and 𝐻 are not isomorphic because deg 𝑎 = 2 in 𝐺, ‘𝑎’ must correspond to either
𝑉2 , 𝑉3 , 𝑉6 , or 𝑉7 in 𝐻 because these are the vertices of degree two in 𝐻.
However, each of these four vertices 𝑉2 , 𝑉3 , 𝑉6 , 𝑉7 in 𝐻 is adjacent to another vertex of degree
two in 𝐻, which is not true for ‘𝑎’ in 𝐺.
36
17. Show that the graphs with the following adjacency matrices are isomorphic.
0 1 0 1 0 1 0 0
A1 = 1 0 1 1 , A2= 0 0 1 1
1 0 0 0 1 1 0 1
0 0 1 0 1 0 0 0
Solution: Let us apply a series of interchange of pairs of rows and the
corresponding pairs of columns.
Consider,
0 1 0 1
A1 = 1 0 1 1
1 0 0 0
0 0 1 0
1 0 0 0
= 1 0 1 1 𝑅1 ⟺ 𝑅3
0 1 0 1
0 0 1 0
0 0 1 0
= 1 0 1 1 𝐶1 ⟺ 𝐶3
0 1 0 0
1 0 0 0
0 0 1 0
= 0 1 0 1 𝑅2 ⟺ 𝑅3
1 0 1 1
1 0 0 0
0 1 0 0
= 0 0 1 1 𝐶2 ⟺ 𝐶3
1 1 0 1
1 0 0 0
= A2.
The graph represented by the adjacency matrix A1 and A2 are isomorphic.
18. Are the simple graphs with following adjacency matrix are isomorphic?
0 1 0 1 0 1 1 1
1 0 0 1 , 1 0 0 1
0 0 0 1 1 0 0 1
1 1 1 0 1 1 1 0
Solution: Let us apply a series of interchange of pairs of rows and the
corresponding pairs of columns.
0 1 0 1
Let A1 = 1 0 0 1
0 0 0 1
1 1 1 0
37
1 1 1 0
= 1 0 0 1 𝑅1 ⟺ 𝑅4
0 0 0 1
0 1 0 1
0 1 1 1
= 1 0 0 1 𝐶1 ⟺ 𝐶4
1 0 0 0
1 1 0 0
0
1 1 1
≠ A2, where A2 = 1 0 0 1
1 0 0 0
1 1 1 0
Since first row, second row and first column of this matrix are same as in A 2. It cannot be
brought to A2 by interchanging rows and columns.
∴ A1 and A2 cannot be similar.
Hence the corresponding graphs are not isomorphic.
19. Are the simple graphs with the following adjacency matrices isomorphic?
0 1 0 0 0 1 0 1 0 0 0 1
1 0 1 0 1 0 , 1 0 1 0 0 1
0 1 0 1 0 1 0 1 0 1 1 0
0 0 1 0 1 0 0 0 1 0 1 0
0 1 0 1 0 1 0 0 1 1 0 1
1 0 1 0 1 0 1 1 0 0 1 0
Solution: The graphs of the given adjacency matrices are given below.
The graphs 𝐺 and 𝐻 are having same number of vertices and same number of
edges.
Let 𝑉1 = {𝑢1 , 𝑢2 , 𝑢3 , 𝑢4 , 𝑢5 , 𝑢6 } and 𝑉2 = {𝑣1 , 𝑣2 , 𝑣3 , 𝑣4 , 𝑣5 , 𝑣6 } are vertex sets of 𝐺 and
𝐻 respectively. i.e., 𝑉1 = 𝑉2 = 6 and 𝐸1 = 𝐸2 = 8.
Degree of the vertices of 𝐺:
𝑑 𝑢1 = 𝑑 𝑢4 = 2, 𝑑 𝑢2 = 𝑑 𝑢3 = 𝑑 𝑢5 = 𝑑 𝑢6 = 3.
Degree of the vertices of 𝐻:
𝑑 𝑣1 = 𝑑 𝑣4 = 2, 𝑑 𝑣2 = 𝑑 𝑣3 = 𝑑 𝑣5 = 𝑑 𝑣6 = 3.
38
Both the graphs 𝐺 and 𝐻 are having two vertices of degree 2 and four vertices
of degree 3.
Define 𝑓: 𝐺 → 𝐻
Choose a vertex '𝑢1 ’ in 𝐺. It has degree 2 and the two adjacent vertices of '𝑢1 ’
having the degree sequence 3,3.
Correspondingly choose a vertex '𝑣1 ’ with the same degree and same degree
sequence of adjacent vertices.
∴ 𝑓 𝑢1 = 𝑣1
Similarly all other vertices are having same degree and same degree
sequence of the adjacent vertices from 𝐺 to 𝐻.
∴ 𝑓 𝑢2 = 𝑣2 , 𝑓 𝑢3 = 𝑣3 , 𝑓 𝑢4 = 𝑣4 , 𝑓 𝑢5 = 𝑣5 , 𝑓 𝑢6 = 𝑣6 .
Hence 𝐺 and 𝐻 are isomorphic.
20. Examine whether the two graphs 𝐺 and 𝐻 associated with the
following adjacency matrices are isomorphic.
0 1 0 1 0 0 0 1 0 0 1 0
1 0 1 0 0 1 , 1 0 1 0 0 0
0 1 0 1 0 0 0 1 0 1 0 1
1 0 1 0 1 0 0 0 1 0 1 0
0 0 0 1 0 1 1 0 0 1 0 1
0 1 0 0 1 0 0 0 1 0 1 0
𝑢1 𝑢2 𝑢3 𝑢4 𝑢5 𝑢6
𝑢1 0 1 0 1 0 0
Solution: Let G = 𝑢2 1 0 1 0 0 1
𝑢3 0 1 0 1 0 0
𝑢4 1 0 1 0 1 0
𝑢5 0 0 0 1 0 1
𝑢6 0 1 0 0 1 0
𝑣1 𝑣2 𝑣3 𝑣4 𝑣5 𝑣6
𝑣1 0 1 0 0 1 0
and H = 𝑣2 1 0 1 0 0 0
𝑣3 0 1 0 1 0 1
𝑣4 0 0 1 0 1 0
𝑣5 1 0 0 1 0 1
𝑣6 0 0 1 0 1 0
Here 𝑣1 = 𝑣2 = 6, 𝐸1 = 𝐸2 = 7
Degree of the vertices of 𝐺:
𝑑 𝑢1 = 𝑑 𝑢3 = 𝑑 𝑢5 = 𝑑 𝑢6 = 2, 𝑑 𝑢2 = 𝑑 𝑢4 = 3.
Degree of the vertices of 𝐻:
𝑑 𝑣1 = 𝑑 𝑣2 = 𝑑 𝑣4 = 𝑑 𝑣6 = 2, 𝑑 𝑣3 = 𝑑 𝑣5 = 3.
Define 𝑓: 𝐺 → 𝐻
∴ 𝑓 𝑢1 = 𝑣4 , 𝑓 𝑢2 = 𝑣3, 𝑓 𝑢3 = 𝑣6, 𝑓 𝑢4 = 𝑣5 , 𝑓 𝑢5 = 𝑣2 , 𝑓 𝑢6 = 𝑣1 .
Hence 𝐺 and 𝐻 are isomorphic.
39
3.6 PATHS, CIRCUITS AND CONNECTEDNESS
Many problems can be modelled with paths formed by travelling along
edges of graphs. Paths with their subclasses of cycles and circuits are important in
graph theory because they help us to answer many questions about models of real-
word situations. For instance, the problem of sending a message between two
computers using intermediate links can be studied with a graph model involving
paths.
Informally, a path is a sequence of edges starting with vertex nd travels
from vertex to vertex along the edges of the graph.
Definition: Path
A Path of length n from the vertex v0 to vertex vn is a sequence of the
form v0, e1, v1, e2, v2, ….,vn-1,en,vn where ei = vi-1vi , i = 1,2,3 …., n.
The vertices v0 and vn are called the end points of the paths, v0 is the intial
point and vn is the terminal point of the path.
Note: (1) the number of edges appearing in the path is its length.
(2) If the graph is simple, the path is unique and is denoted by just
listing the verticesv0, v1...., vn along the path.
(3) A path from v0 to vn which does not contain repeated vertices is
called a simple path.
(4) A path of length 0 i.e., It contains only one vertex is called a
trivial path.
Definition: Circuit
A non-trivial path is called a circuit or cycle if it starts and ends with the same vertex
V1
e4 V5
e1
e5
e7
V4
V2
e6 V7
e3
e8
e2
V6
V3
40
If the length of a cycle is k it is called a k-cycle.
(2) A non-loop edge together with its end vertices is a path.
(3) A triangle is a 3-cycle.
Connected graph
When a graph is used to represent a computer network, where vertices
represent the computers and edges represent the communication links, under what
condition there is always a path? This leads to the concept of connectivity.
Definition: A graph is connected if there is a path between every pair of distinct
vertices of the graph. Otherwise it is disconnected.
Any two computers in a network can communicate if and only if the graph
of the network is connected.
Note: (1) Any graph with isolated vertices is a disconnected graph.
(2) Null graph is totally disconnected.
Example: Consider the graph G,
Clearly v2,v3,v5,v8 are cut vertices of G, because their removal disconnects the graph.
Note: 1. The vertex adjacent to a pendent vertex is cut vertex.
2. An isolated vertex is never a cut vertex.The edges e1,e5,e10 are cut edges
of the graph G, because their removal disconnects the graph G.
Problems:
1. Prove that if a simple graph G is disconnected then its complement 𝐺 is connected.
Proof: Let G be a disconnected graph. So, it has at least two connected
components G1 and G2.
Let G be the complement of G. The vertex set of G is the same as the vertex set
of G and any vertices of G are adjacent if and only if there are not adjacent in G.
We have to prove G is connected.
Let u, v be any two vertices of G (in fact u, v are vertices of G).
Suppose u ∈ V(G1) and v ∈ V (G2)
41
Since G1 and G2 are connected components of G, u and v are not adjacent in G.
So u, v are adjacent in G .
Therefore, there is a path connecting u and v in G
Now suppose u, v belong to the same component of G say u, v∈V(G1). Take any
vertex w in G2
So they are not adjacent in G
Therefore u and w are adjacent in G
Similarly v and w are adjacent in G .
Thus we get a path uwv connecting u and v in G .
Hence there is a path connecting every pair of vertices in G . So G is connected
2. 2. Prove that If a graph, connected or disconnected has exactly two vertices of odd
degrees, then there must be a path joining these two vertices.
Proof: Let G be a graph with exactly two vertices u, v of odd degree and all
othervertices are of even degrees.
If the graph G is connected, there is a path joining u, v by definition of connected
graph.
If the graph G is disconnected, then there are connected components of G.
Each component itself is a graph.
We know that in a graph the number of odd vertices is even.
So the two odd vertices u and v must belong to the same connected component.
Hence there is a path joining u and v.
3. 3. Prove that a simple graph with n vertices and k components can have atmost
𝑛 −𝑘 n−k+1
edges.
2
Proof: Let n1, n2…. nk be the number of vertices in each of k components of the
graph G then n1 + n2 + ⋯ + nk = n = |V(G)|
i.e. ki=1 ni = n………….(1)
k
Now i=1
(ni − 1) = n1 − 1 + n2 − 1 + ⋯ + nk − 1
= k
i=1 ni −k
k k
i=1
(ni − 1) = n − k[Since i=1 ni = n]
Squaring both sides
k 2
(n − 1) = (n-k)2
i=1 i
(n1-1)2+(n2-1)2+……. +(nk-1)2≤ n2 +k2-2nk
n12−2n1 + 1 + n22 − 2n2 + 1 + ⋯ + n2k − 2nk + 1 ≤ n2 + k 2 − 2nk
42
k
n2i + k − 2n ≤ n2 + k2 − 2nk
i=1
n2i ≤ n2 + k2 − 2nk + 2n − k
i=1
k
n2i ≤ n2 + k2 − k − 2nk + 2n
i=1
k
n2i = n2 + k k − 1 − 2n(k − 1)
i=1
= n2 + (k − 1)(k − 2n)
k
n2
i=1 i
≤ n2 + (k − 1)(k − 2n)……….(2)
n i n i −1
Since G is simple, the maximum number of edges of G in its component is
2
k k
n i n i −1 n2
i −n i
Therefore, Maximum number of edges ofG = =
i=1 2 i=1 2
1 k 1
=2 n2
i=1 i
−2 k
i=1 ni
1 n
≤ 2 n + k − 1 k − 2n − 2 using equation (1) and (2)
2
1 2
= n + k2 − 2nk − k + 2n − n
2
1
=2 [ n − k 2 + (n − k)]
1
= n − k [n − k + 1]
2
n−k n−k+1
∴ Maximum number of edges of G ≤
2
4.Prove that a simple graph with n vertices must be connected if it has more than
(𝑛−1) 𝑛−2
edges.
2
(n−1) n−2
Proof: Let G be a simple graph with n vertices and more than edges.
2
Suppose if G is not connected, then G must have atleast two components. Let it
be G1 and G2
Let v1 be the vertex set of G1 with v1 = m. If v2 is the vertex set of G2,
then v2 = n − m
Here i) 1 ≤ m ≤ n − 1
ii) There is no edge joining a vertex of v 1 and a vertex of v2
iii) v2 = n − m ≥ 1
Now, E G = E G1 UG2 = E G1 + E G2
m (m−1) (n−m ) n−m−1
≤ + [By known result].
2 2
1
= m2 − m + n n − m − 1 − m(n − m − 1)
2
43
1
= n n − 1 − nm − m n − m − 1 + m2 − m
2
Adding and subtracting (2n-2)
1
= n − 1 n − 2 + 2n − 2 − 2nm + m2 + m + m2 − m
2
1
= n − 1 n − 2 + 2n − 2 − 2nm + 2m2
2
1
= 2 n − 1 n − 2 + 2n 1 − m + 2(m2 − 1)
1
= 2 n − 1 n − 2 − 2n m − 1 + 2(m − 1)(m + 1)
1
= 2 n − 1 n − 2 − 2 m − 1 (n − m − 1)
n−1 n−2
E G ≤ , ( Since [(m-1) (n-m-1)] ≥ 0 for 1 ≤ m ≤ n − 1)
2
n−1 n−2
which is a contradiction to G that has more than edges.
2
∴ Hence G is a connected graph.
𝑛
5. Let G be a simple graph with n vertices show that if 𝛿 𝐺 ≥ , then G
2
is connected, where 𝛿(G) is minimum degree of graph G
Proof: Let u & v be any two distinct vertices in G. We claim that there is a u-v
path in G.
If uv is an edge in G,then it is a uv path. Suppose uv is not an edge of G, then
X be the set of all vertices which are adjacent to Y.
Then u,v ∉ X ∪ Y ( ∵ G is a simple graph) and hence X ∪ Y ≤ n − 2
n n
We have X = deg u ≥ δ G ≥ [2 ] and Y = deg v ≥ δ G ≥ [2 ]
n n
X∪Y = X + Y ≥ + ≥ n-1
2 2
We Know that X ∪ Y = X + Y - X ∩ Y
From above, X ∩ Y ≥ 1 X ∩ Y ≠ 0
Now take a vertex w ∈ X ∩ Y. Then uvw is a path in G. Thus, for every pair of
distinct vertices of G there is a path between them. Therefore, G is connected.
6. Show that a simple graph G is bipartite if it has no circuit (or cycle) of odd length.
Solution:Let G = (V, E) be a bipartite graph.
We have to prove it contains no odd cycle (i.e. no cycle with odd number of
edges).Since G is bipartite the vertex set V can be partitioned into two subsets
V1 and V2such that every edge of G has one end in V1 and other end in V2.
Now consider any cycle v0, v1, v2…,vn = v0of length n.
44
Suppose v0∈ V1, then v1∈ V2, v2∈ V1, v3∈ V2….,
In general, vk∈ V1 if k is even,vk∈ V2 if k is odd
Thus v2, v4, v6..., ∈V1 and v1, v3, v5….∈V2 and vn= v0∈V1 and so n is even.
So the cycle has even number of edges.
Hence the graph has no odd cycle.
Conversely, let the graph G has no odd cycle We have to prove it is a bipartite.
Without loss of generality we may assume that G is connected.
(Otherwise we consider the connected components of G separately).
Let v1 be any vertex of G i.e. v1∈ V.
Define V1 = v ∈ V| ⅆ v, v1 , is even}
V2 = v ∈ V| ⅆ v, v1 , is odd}
Clearly V1, V2 are non-empty disjoint subsets of V.
i.e. V1 ∪ V2= V and V1∩ V2= ∅
We have to prove every edge of G has one end in V 1 and other end in V2.
i.e. to prove that no two vertices of V 1 are adjacent.
Suppose two vertices u1 v ∈ V1are adjacent then e=uv is an edge
Note: The result is true if G is directed or undirected, with multiple edges and
loops.
46
7. For the graph G given by the figure. Find (i) the number of paths of length 4
from a to d. (ii) the number of paths of length 3 from a to c and a to d.
47
0 1 1 1
1 0 1 1
The adjacency matrix A=
1 1 0 1
1 1 1 0
0 1 1 1 0 1 1 1 3 2 2 2
2 1 0 1 1 1 0 1 1 2 3 2 2
Now A = A.A = =
1 1 0 1 1 1 0 1 2 2 3 2
1 1 1 0 1 1 1 0 2 2 2 3
3 2 2 2 0 1 1 1 6 7 7 7
2 3 2 2 1 0 1 1 7 6 7 7
A3 = A2.A = =
2 2 3 2 1 1 0 1 7 7 6 7
2 2 2 3 1 1 1 0 7 7 7 6
6 7 7 7 0 1 1 1 21 20 20 20
7 6 7 7 1 0 1 1 20 21 20 20
A4 = A3.A = =
7 7 6 7 1 1 0 1 20 20 21 20
7 7 7 6 1 1 1 0 20 20 20 21
The number of paths of length 2 between any two different vertices = 2
The number of paths of length 2 from any vertex to itself is = 3
The number of paths of length 3 between two different vertices = 7
The number of paths of length 4 between two different vertices = 20
3.7 EULER AND HAMILTON PATHS
In the beginning of this chapter we considered the Konigsberg bridge problem
where two interesting questions arise. Can one walk through the city crossing each
bridge exactly once? Can one walk through the city, stating from the one place, using
each bridge exactly once and return to the starting place? These two questions are
the broad categories of problems for which graph theory is used.
48
The graph G1 is Eulerian, because it contains an Euler circuit a, b, c, e, f, g, c, d. a; it
contains each edge only once.
The graph G2 is Eulerian, because it contains an Euler circuit a, c, e, d, c, b, a.It
contains each edge only once.
The graph G3 is not Eulerian, because it does not contain Euler circuit, but it contain
an Euler path a, b, c, d, e, b containing every edge only once.
G4 has no Euler path or Euler circuit.
Note:
Euler path is also known as Eulerian path and Euler circuit is also known as
Eulerian circuit.
In Eulerian graph, a vertex may be revisited but no edge is repeated.
An Euler graph contains an Euler circuit containing all edges exactly once. So,
the graph is connected except for some isolated vertices. Since the isolated vertices
do not affect the nature of the connected path of a graph, we may discard te
isolated vertices if any. Hence we can consider an Eulerian graph to be a connected
graph.
Theorem: A connected graph G is Eulerian if and only if every vertex of G is of
even degree.
Proof: Let G be an Eulerian graph. We have to prove all vertices are of even
degree.
Since G is Eulerian, G contains an euler circuit, say,
v0 , e1 , v1 , e2 , … vn−1 , en , v0.
Both the edges e1 and en contribute one to the degree of vo and so deg vo is atleast
two.
In tracing this circuit we find an edge enters a vertex and another edge leaves the
vertex contributing 2 to the degree of the vertex.
This is true for all vertices and so each vertex is of degree 2, an even integer.
Conversely, let the graph G be such that all its vertices are of even degrees.
49
We have to prove G is an Euler graph.
We shall construct an Euler circuit and prove. Let v be an arbitrary vertex in G.
Beginning with v form a circuit C: v, v1 , v2 , … vn −1 , v
This is possible because every vertex are of even degree. We can leave a vertex
(≠ v) along an edge not used to enter it. This tracing clearly stops only at the vertex v
because v is also of even degree and we started from v. Thus, we get circuit or cycle C.
If C includes all the edges of G, then C is an Euler circuit and so G is Eulerian.
If C does not contain all the edges of G, consider the sub graph H of G obtained by
deleting all the edges of C from G and vertices not incident with remaining edges. Note
that all vertices of H have even degree. Since G is connected, h and C must have a
common vertex u. Beginning with u construct a circuit C1 for H.
Now combine C and C1 to form a larger circuit C2 .If it is Eulerian ie. If it contains all the
edges of G, the G is Eulerian.
Otherwise, continue this process until we get an Eulerian circuit.
Since G is finite this procedure must come to an end with a Eulerian circuit. Hence G is
Eulerian.
Theorem: A connected graph has an Euler path but not an Euler circuit if and only if it
has exactly two vertices of odd degree.
Proof: Given G is a connected graph.
Suppose it has an Euler path from v0 to vn , say, vo , e1 , v1 , e2 , … vn−1 , en , vn. .
The edges e1 and en contribute 1 to the degrees of v0 and vn respectively.
Every time the path passes through a vertex, it contributes 2 to its degree.
It is true for v0 and vn also.
So, the degrees of v0 and vn are always odd and the degrees of each internal vertices
remain even. Thus the graph contains exactly two vertices of odd degree.
Conversely, let the connected graph G contains two vertices of odd degree, say
v0 and vn . Adding a new edge e = v0 vn to G we get a graph G1 with all even degree
vertices. Therefore by previous theorem G1 is Eulerian.
Removing e = v0 vn from G1 , we get G containing an Euler path from v0 tovn .
Theorem: Prove that a graph G is disconnected iff its vertex set V is partitioned in to
two non empty disjoint subsets V1 and V2 such that there exist no edge in G whose one
end vertex is in subset V1 and other in V2 .
Proof: Suppose that such a partition exists. The partition V1 and V2 are like two
components. Consider two vertices a and b of G such that a ∈ V1 , b ∈ V2 then no path
exist between the vertices. Hence if the partition exist then G is not connected.
Conversely suppose G is disconnected. Consider a vertex ain G. Let V1 be the set of all
vertices that arre joined by a path to a. Since G is disconnected V1 does not include all
50
the vertices of G. Remaining vertices are inV2 . Therefore no vertex in V1 is joined to
any other vertex in V2 by an edge.
51
So, we get a Hamilton circuit
u = V1 − V2 − V3 … Vi − Vn = v − Vn−1 − Vi+2 − Vi+1 − u
which covers all the vertices in the graph without considering the edge uv
which is a contradiction to the fact 1. So G must be Hamiltonian. Hence the proof.
Theorem: Prove that any two simple connected graphs with n vertices all of degree
2 are isomorphic.
Proof:We know by Hand-shaking theorem sum of the degrees of the vertices= 2e
(v)
(i.e) n
i=1 dG = 2e. Further each vertices are of degree 2. Therefore 2n = 2e
⟹ n = e ⟹ number of edges = number of vertices. Also graphs are cycle graphs.
Hence they are isomorphic.
Theorem: Show that K n has a Hamilton circuit when n ≥ 3.
Proof: Let u be any vertex of K n . since K n is a complete graph with n vertices, any
two vertices are joined. So we start with u and visit vertices in any order exactly
once and come back to u. Hence there is a Hamilton cycle in K n and thus K n is
Hamiltonian.
Problems:
9. Give example for the graphs which are
(i) Not Eulerian and Hamiltonian
(ii) Eulerian and not Hamiltonian
(iii) Neither Eulerian nor Hamiltonian
(iv) Eulerian and Hamiltonian
Solution:
(i) The graph contains Hamiltonian circuit v1 , v2, v3, v4, v5, v6, v1
Hence G is a Hamilton graph. Since the degree of each vertex is not even, it is not
Eulerian.
52
(ii)
Since every vertex is of even degree, G has an Euler circuit. But it is not Hamiltonian,
because it can be seen that every circuit containing every vertex contains a vertex
twice. For example v1 , v2, v3, v5, v1, v6, v3, v4, v1, .So G is Eulerian but not Hamiltonian.
(iii)
The Peterson graph given above is not Eulerian and not Hamiltonian since every
vertex is of odd degree. The Peterson graph is not Hamiltonian because it can be
seen that every circuit containing every vertex contains a vertex twice.
(iv)
The circuit V1, V2, V3, V4, V1 in the graph consists of all edges and all vertices
each exactly only once. Therefore, The above graph iscontains a circuit i.e., both
Eulerian as well as Hamiltonian.
53
10. Determine whether Euler path exist in the following graph.
Solution: G1 contains exactly two vertices a and b of odd degree. So, there is a
Euler path a, b, c, d, e, b starting with one odd vertex and ending with other odd
vertex.
G2 contains exactly two vertices e,g of odd degree. So it contains a Euler path
starting with g and ending with e namely g, a, b, c, d, e, f, b, g, f, c, e.
G3 contains two vertices of odd degree a and c. So it contains a Euler path
starting with a and ending with c namely a, b, c, d, a, c.
11. Find an Euler path or an Euler circuit, if it exists in each of the graphs
given below. If it does not exist, explain why?
Solution: In G1 , there are two vertices namely A, B of odd degree 3 and other
vertices are of even degrees 2 and 4. So G1 has Euler path and has no Euler circuit.
The Euler path between A and B is given by A, B, C, D, A, C, D, B.
In G3 all the 5 vertices are of even degree 4. So, by the theorem A necessary
and sufficient condition for a graph G to have Euler circuit iff all the vertices are of
even degree) G3 has Euler circuit A,B,C,D,E, A, C, E,B, D,A.
54
Solution:
(i) In G1 ,v1 , v2 , v3 , v4 , v5 , v8 , v7 , v6 , v1 is a Hamilton cycle and so it is a Hamilton
graph.
v1 , v2 , v3 , v4 , v5 , v6 , v7 , v8 is a Hamilton path.
(ii) In G2 , a, b, c, d, e, h, g, f, ais a Hamilton cycle. So G2 is a Hamilton graph. It
contains a Hamilton path also. a, b, c, d, e, f, g, h is a Hamilton path.
(iii) In G3 , v1 , v2, v3, v4 is a Hamilton path. But there is no Hamilton cycle, since v1 , v2
occurs twice in every circuit. So v2 is repeated.
(iv)In G4 , any cycle will have v2 , v5 atleast twice. So it is not a Hamilton graph. It
has no Hamilton path also.
55
3.8 PRACTICE QUIZ
1. A graph is a collection of.... ?
2. In a simple graph, the number of edges is equal to twice the sum of the degrees of
the vertices.
a) True b) False
3. If a simple graph G, contains n vertices and m edges, the number of edges in the
Graph G'(Complement of G) is ___________
a) (n*n-n-2*m)/2
b) (n*n+n+2*m)/2
c) (n*n-n-2*m)/2
d) (n*n-n+2*m)/2
4. Which of the following properties does a simple graph not hold?
a) Must be connected
b) Must be unweighted
c) Must have no loops or multiple edges
d) Must have no multiple edges
5. Which of the following is true?
a) A graph may contain no edges and many vertices
b) A graph may contain many edges and no vertices
c) A graph may contain no edges and no vertices
d) A graph may contain no vertices and many edges
6. For a given graph G having v vertices and e edges which is connected and has no
cycles, which of the following statements is true?
a) v=e
b) v = e+1
c) v + 1 = e
d) v = e-1
7. A graph with all vertices having equal degree is known as a __________
a) Multi Graph
b) Regular Graph
c) Simple Graph
d) Complete Graph
56
8. The degree of any vertex of graph is....?
a)The number of edges incident with vertex
b) Number of vertex in a graph
c) Number of vertices adjacent to that vertex
d) Number of edges in a graph
9. What is the number of edges present in a complete graph having n vertices?
a) (n*(n+1))/2
b) (n*(n-1))/2
c) n
d) Information given is insufficient
10. The given Graph is regular.
a) True
b) False
11. What is the maximum number of edges in a bipartite graph having 10 vertices?
a) 24 b) 21 c) 25 d) 16
12. Which of the following ways can be used to represent a graph?
a) Adjacency List and Adjacency Matrix
b) Incidence Matrix
c) Adjacency List, Adjacency Matrix as well as Incidence Matrix
d) No way to represent
13. A simple graph G has 24 edges and degree of each vertex is 4. Find the number of
vertices
a) 20 b) 21 c) 12 d) 16.
14. A graph contains 21 edges, 3 vertices of degree 4 and all other vertices of degree
2. Find total number of vertices.
a) 18 b) 15 c) 12 d) 16
57
3.9 Assignment 1
1) There are 25 telephones in Geeks land. Is it possible to connect them with
wires so that each telephone is connected with exactly 7 others?
2) There are 9 line segments drawn in a plane. Is it possible that each line
segment intersects exactly 3 others?
3) Prove that, a graph G with n vertices has n-1 edges and no circuits are
connected.
4) Draw the graph with 3 vertices A, B, C, D & E such that the deg(A)=3,B is
an odd vertex, deg(C)=2 and D and E are adjacent.
5) Does there exist a simple graph with 5 vertices of the following degree? If
so draw such graph (a) 4,4,4,3,2 (b)3,3,3,3,3,3
6) How many paths of length 4 are there from a tod in the simple graph G
given.
Assignment 2
7) Draw the complete graph K 5 with vertices A,B,C,D,E. Draw all complete
sub graph of K 5 with 4 vertices
8) Draw the graph whose adjacency matrix given below:
0 3 0 2 0 1 1 0
3 0 1 1 1 0 0 1
a) b)
0 1 1 2 1 0 0 1
2 1 2 0 0 1 1 0
9) Define an Euler graph? Find an example of Eulerian graph which is not
Hamiltonian?
10) Give an example of a graph
(a) Eulerian circuit but not a Hamiltonian circuit.
(b) Hamiltonian circuit but not an Eulerian circuit.
(c) Euler circuit and a Hamiltonian
(d) Neither Euler circuit nor Hamilton circuit.
58
3.10 PART A QUESTION & ANSWER
K1 CO3
59
𝐕(𝐆 )
If G is a simple graph with (𝐆 ) ≥ 𝟐
. Then show that
7.
G is connected.
Solution: Let u and v be any two distinct vertices in G
𝐕(𝐆 )
Given 𝛅(𝐆 ) ≥ ----(1)
𝟐
To prove: G is connected we have to show there exist u – v
path in G. If uv is an edge the u-v is a path in G Suppose uv
is not an edge.
Let X = { set of vertices which are adjacent to u}
Y = { set of vertices which are adjacent to v}
Then u, v ∉ X ∪ Y
Therefore, |X ∪Y|≤n – 2 ⟹ – |X ∪Y|≥ – (n – 2) -----(2) K1 CO3
By Inclusion exclusion principle |X ∪Y| = |X| + |Y| – |X ∩Y|
⟹|X ∩Y| = |X| + |Y| – |X ∪Y|
⟹|X ∩Y| ≥ |X| + |Y| – |X ∪Y|
𝐧 𝐧
⟹|X ∩Y| ≥ 𝟐 + 𝟐 − 𝐧 − 𝟐 [If n is even |X ∩Y|≥ 2,
If n is odd |X ∩Y|≥ 1]
⟹ ∃ a w∈ X ∩Y ⟹ w ∈ X and w ∈ Y
⟹ w is adjacent to u, w is adjacent to Y
⟹ uvw is a path in G
Therefore, G is connected.
K1 CO3
60
9.
Define Hamiltonian
Solution: A connected graph that contains a Hamilton
circuit is called Hamilton graph or Hamiltonian graph
K1 CO3
K1 CO3
K1 CO3
61
12.
Is the directed graph given below is strongly
connected? Why or Why not?
K1 CO3
K2 CO3
62
Draw the graph represented by the given adjacency
14. matrix
𝟎 𝟏 𝟎 𝟏
𝟏 𝟎 𝟏 𝟎
𝟎 𝟏 𝟎 𝟏
v1 v2 v3 v4
𝟏 𝟎 𝟏 𝟎
v1 0 1 0 1
Solution: Let v2 1 0 1 0
v3 0 1 0 1
v4 1 0 1 0
K2 CO3
The graph of the given adjacency matrix is
63
17. Can you draw a graph of 5 vertices with degree
sequence 1,2,3,4,5?
Solution: A degree sequence is 1,2,3,4,5
deg v = 1 + 2 + 3 + 4 + 5 = 15 (odd)
We know that in any graph the number of odd degree K2 CO3
vertices is always even.
Here the number of odd degree vertices is 3 (not an even)
Therefore such a graph does not exist.
64
S.No Part B (Question) K CO
Level
1. Prove that the maximum number of edges in a simple graph with ‘n’
n(n 1)
vertices is . K2 CO3
2
5. If all the vertices of an undirected graph are each of degree k, show that the
number of edges of the graph is a multiple of k. K2 CO3
6. Prove that the connected graph is G is Eulerian if and only if all the
K2 CO3
vertices are of even degree.
7. Show that the complete graph with n vertices Kn has Hamiltonian
K2 CO3
circuit whenever n≥ 3.
8. Prove that if G is simple graph with at least three vertices and
𝐕(𝐆 ) K2 CO3
𝛿(𝐆 ) ≥ 𝟐 then G is Hamilton.
9. Let G be a simple undirected graph with n vertices. Let u and v be
two non adjacent vertices in G such that deg (u) +deg (v) ≥ n in G.
K2 CO3
Show that G is Hamiltonian if and only if G + uv is Hamiltonian.
K1 CO3
65
12. If A is adjacency matrix of a graph G with
V(G) ={ v1, v2,…..vn }, prove that for any n ≥ 1, the (i,j)th
entry of An is the number of vi - vj walks of length n in G . K2 CO3
K2 CO3
(G) (H)
14. Draw the graph whose adjacency matrix given below.
0 3 0 2 0 1 0 0
3 0 1 1 , 0 0 1 0 K2 CO3
0 1 1 2 1 1 0 0
2 1 2 0 0 1 1 0
0 1 0
1
0 1 0 1 1 K2 CO3
a) 1 0 1
0 0
b)
1 0 1
0
0 1 0
0 1 0
1
16. If G is a self-complementary graph, then prove that G
has n≡ 0 (𝑜𝑟)1(mod 4) vertices.
K2 CO3
66
Supportive online Certification Courses
https://www.udemy.com/course/discrete/?referralCode=0C16DD8E64
F9C8A66D22 (udemyCourse) by Amour Learning
Discrete Mathematics by Dr. Sugata Gangopadhyay & Dr. Aditi
Gangopadhyay,Department of Mathematics,IIT Roorkee.For more
details on NPTEL visit http://nptel.ac.in
67
Real life applications of Graph theory
in day today life and to industry
68
CONTENT BEYOND THE SYLLABUS
69
Assessment Schedule (Proposed Date &
Actual Date)
Assessment Schedule
70
PRESCRIBED TEXT BOOKS & REFERENCE BOOKS
71
Mini Project on Graphs
72
Thank you
Disclaimer:
This document is confidential and intended solely for the educational purpose of RMK Group of
Educational Institutions. If you have received this document through email in error, please notify the
system manager. This document contains proprietary information and is intended only to the
respective group / learning community as intended. If you are not the addressee you should not
disseminate, distribute or copy through e-mail. Please notify the sender immediately by e-mail if you
have received this document by mistake and delete this document from your system. If you are not
the intended recipient you are notified that disclosing, copying, distributing or taking any action in
reliance on the contents of this information is strictly prohibited.
73