Location via proxy:   [ UP ]  
[Report a bug]   [Manage cookies]                

Part 1 - Graph Theory - Chapter 1 - Unit 5

Download as pdf or txt
Download as pdf or txt
You are on page 1of 34

DISCRETE MATHEMATICS (3140708)

CHAPTER 1 – Unit 5
GRAPH THEORY

CONTENT

❖ Introduction
❖ Definition and examples
❖ Nodes, edges, adjacent nodes, Isolated nodes
❖ Directed and undirected edge
❖ Directed graph and undirected graph
❖ Initiating and terminating nodes
❖ Loop (sling), Distinct edges and Parallel edges
❖ Null graph, Multi-graph, Simple graph, Weighted graphs and Examples
❖ Isomorphic graphs and Examples
❖ Degree, Indegree, Out-degree, Total degree of a node and Examples
❖ Subgraphs: Definition and Examples
❖ Converse (reversal or directional dual) of a digraph and Examples
❖ Path: Definition, Paths of a given graph, Length of path, Examples, Simple path (edge
simple), Elementary path (node simple) and Examples
❖ Cycle (circuit), Elementary cycle and Examples
❖ Reachability: Definition, Geodesic, Distance and Examples
❖ Properties of reachability, The triangle inequality
❖ Reachable set of a given node, Examples, Node base and Examples
❖ Connectedness: Definition, Weakly connected, Strongly connected, Unilaterally
connected, Examples
❖ Strong, Weak, and Unilateral Components of a graph and Examples
❖ Applications to represent Resource allocation status of an operating system, and
detection and correction of deadlocks
❖ Matrix representation of graph: Definition, Adjacency matrix, Boolean (or bit) matrix,
examples, Determine number of paths of length 𝑛 through Adjacency matrix and
Examples
❖ Path (Reachability) matrix of a graph and Examples
❖ Warshall’s algorithm to produce Path matrix and Flowchart
❖ Trees: Definition, branch nodes, leaf (terminal) nodes, root and Examples
❖ Different representations of a tree and examples
❖ Binary tree, m-ary tree, Full (or complete) binary tree and Examples
❖ Converting any m-ary tree to a binary tree and Examples
❖ Representation of a binary tree: Linked-list
❖ Tree traversal: Pre-order, in-order, post-order traversal, Examples, algorithms
❖ Applications of List structures and graphs

Definitions with examples

Graph

In graph theory, a graph is a mathematical structure used to model pairwise relations between
objects. A graph 𝐺 = (𝑉, 𝐸) consists of two sets: a set 𝑉 of vertices (nodes) and a set 𝐸 of edges
(arcs).

Order of graph

The order of a graph is defined as the number of vertices in the graph. In other words, the order
of a graph is cardinality of a vertex set 𝑉.

Size of graph

The size of a graph is defined as the number of edges in the graph. In other words, the size of
a graph is cardinality of an edge set 𝐸.

Finite graph

A graph 𝐺 is called finite graph if it has a finite number of vertices and finite number of edges.

Adjacent nodes

Adjacent nodes (or adjacent vertices) are two vertices that are connected directly by an edge.
In other words, if there is an edge between vertex 𝑢 and vertex 𝑣 then 𝑢 and 𝑣 are said to be
adjacent.

Isolated node

An Isolated node (or isolated vertex) is a node that is not adjacent to another node.

Pendant vertex

A pendant vertex (or pendant node) is a vertex which has only one edge connected to it.
Question (JULY 2023 – 03 Marks)
Define Isolated vertex, Pendent vertex and Size of a graph.

(SEE THE ABOVE DEFINITIONS)

Undirected edge

An undirected edge is an edge that has no direction. This means that the relationship
represented by the edge is bidirectional.

Undirected graph

An undirected graph is a graph in which the edges have no direction. In other words, each
edge is associated with an unordered pair of vertices in an undirected graph.

For example,

➢ Here 𝑣1 , 𝑣2 , 𝑣3 , 𝑣4 and 𝑣5 are vertices (nodes). That is, 𝑉 = {𝑣1 , 𝑣2 , 𝑣3 , 𝑣4 , 𝑣5 } is the


set of vertices for the given graph.
➢ Also, 𝑒1 = (𝑣1 , 𝑣2 ) , 𝑒2 = (𝑣2 , 𝑣3 ) , 𝑒3 = (𝑣1 , 𝑣3 ) and 𝑒4 = (𝑣3 , 𝑣4 ) are edges. That
is, 𝐸 = {𝑒1 , 𝑒2 , 𝑒3 , 𝑒4 } is the set of edges for the given graph.
➢ Since there are five vertices, the order of the given graph is 5. That is, |𝑉| = 5.
➢ Since there are four edges, the size of the given graph is 4. That is, |𝐸| = 4.
➢ Since the given graph has a finite number of vertices and finite number of edges, the
given graph is finite graph.
➢ Since there is an edge between node 𝑣1 and node 𝑣3 , the nodes 𝑣1 and 𝑣3 are
adjacent nodes. Similarly, node 𝑣3 is adjacent to three nodes 𝑣1 , 𝑣2 and 𝑣4 . Note that
𝑣1 and 𝑣4 are not adjacent nodes. Also, node 𝑣5 is not adjacent to any other node.
➢ Since 𝑣5 is not adjacent to any other node, the node 𝑣5 is isolated.
➢ Since 𝑣4 has only one edge connected to it, the vertex 𝑣4 is pendant vertex.
➢ Here, each edge is an undirected edge because it has no direction.
➢ The given graph is an undirected graph because the edges have no direction.
Directed edge
A directed edge is an edge that has a specified direction from one vertex to another. In other
words, directed edge is an edge associated with an ordered pair of vertices.
Directed graph (Digraph)
A directed graph is a graph in which each edge has a specified direction from one vertex to
another. In other words, each edge is associated with an ordered pair of vertices in the
directed graph.
For example,

𝐞𝟑

➢ Here 𝑣1 , 𝑣2 and 𝑣3 are vertices (nodes). That is, 𝑉 = {𝑣1 , 𝑣2 , 𝑣3 } is the set of vertices
for the given graph.
➢ Also, 𝑒1 = (𝑣2 , 𝑣1 ) , 𝑒2 = (𝑣3 , 𝑣2 ) and 𝑒3 = (𝑣3 , 𝑣1 ) are directed edges. That is, 𝐸 =
{𝑒1 , 𝑒2 , 𝑒3 } is the set of edges for the given graph.
➢ Here, each edge is directed edge because it has a specified direction from one vertex
to another.
➢ The given graph is directed graph (or digraph) because each edge has a specified
direction from one vertex to another.

Initiating node
An initiating node (or vertex) is a node with no incoming edges. In other words, if an edge 𝑒
has the direction from node 𝑢 to node 𝑣 then the node 𝑢 is called initiating node.
Terminating node
A terminating node (or vertex) is a node with no outgoing edges. In other words, if an edge
𝑒 has the direction from node 𝑢 to node 𝑣 then the node 𝑣 is called terminating node.
For example, the node 𝑢 is initiating node and the node 𝑣 is terminating node for the given
edge 𝑒.

For example, the node 𝑣2 is initiating node and the node 𝑣1 is terminating node for the given
edge 𝑒1 .

Loop (sling)

A loop (or self-loop) is an edge that starts and ends at the same vertex. In other words, a loop
is an edge 𝑒 = (𝑢, 𝑢) where 𝑢 is any vertex.

Question (FEB 2021 – 03 Marks)


Define self-loop, adjacent vertices and a pendant vertex.
(SEE THE ABOVE DEFINITIONS)

Distinct edges

The two edges between a pair of nodes that are directed in opposite directions are known as
distinct edges.

Parallel edges (Multiple edges)

If two nodes in a graph are connected by more than one edge, these edges are referred to as
parallel edges or multiple edges.
For example, the edges 𝑒1 , 𝑒2 and 𝑒3 are parallel edges because two nodes 𝑢 and 𝑣 are
connected by these three edges.
Null graph

A graph whose edge set is empty is called null graph. In other words, a graph containing
only isolated nodes is called a null graph.

For example, the given graph is a null graph (with five vertices) because there is no edge
between any pair of nodes. In other words, each node is isolated.

Question (JULY 2022 – 03 Marks)


Define Isolated vertex and Null graph. Identify Isolated vertex/vertices from the following
graph.

Answer

An Isolated node (or isolated vertex) is a node that is not adjacent to another node.

A graph whose edge set is empty is called null graph.

Since the vertices 𝑣4 and 𝑣7 are not adjacent to any other vertex, these vertices are isolated.
That is, 𝒗𝟒 and 𝒗𝟕 are isolated vertices.

Simple graph

A graph without any loops or parallel edges (multiple edges) is called a simple graph.

For example,

1) The given graph is simple digraph because there is no loop (self-loop) and there are
no parallel edges.
2) The given graph is simple undirected graph because there is no loop (self-loop) and
there are no parallel edges.

3) Note that the edges between nodes 𝑉3 and 𝑉4 are not parallel edges because the
directions are different. So, the given graph is simple digraph.

4) The given graph is NOT simple because there is a self-loop at node 𝑣2 .


Multi-graph

A graph which contains some parallel edges (multiple edges) is called a multi-graph.

For example, the given graph is a multi-graph because the edges between nodes 𝐸 and 𝐹 are
parallel edges. Also, the edges between nodes 𝐵 and 𝐶 are parallel edges.

Weighted graph

A graph is called weighted graph if some weight (integer) is assigned to each edge.

For example, the given undirected graph is weighted graph because some weight (integer) is
assigned to each edge. That is, weight 12 is assigned to edge (𝑣1 , 𝑣2 ), weight 7 is assigned to
edge (𝑣1 , 𝑣3 ) and weight 5 is assigned to edge (𝑣2 , 𝑣3 ).

Degree of a node

Let 𝑣 be any node (vertex) in an undirected graph 𝐺. Then, the degree of a node 𝑣 is
denoted by deg(𝑣) or 𝑑(𝑣) or 𝑑𝐺 (𝑣) and it is the number of edges connected to 𝑣.

Important note

In an undirected graph, a loop (self-loop) at a node 𝑣 contributes twice to the degree of 𝑣.

For example,

1) The graph is shown below.


In the given graph,

deg(𝐴) = 1 , deg(𝐵) = 4 , deg(𝐶) = 3 , deg(𝐷) = 3 , deg(𝐸) = 4 and


deg(𝐹) = 3

2) The graph is shown below.

In the given graph,

deg(𝑣1 ) = 2 , deg(𝑣2 ) = 𝟓 , deg(𝑣3 ) = 1 , deg(𝑣4 ) = 𝟎 , deg(𝑣5 ) = 3 ,

deg(𝑣6 ) = 3 and deg(𝑣7 ) = 𝟎.

The Handshaking theorem


Let 𝐺 = (𝑉, 𝐸) be the undirected graph with 𝑒 edges. Then, the sum of degrees of the vertices
is equal twice the number of edges. That is, ∑ deg(𝑣𝑖 ) = 2𝑒 where 1 ≤ 𝑖 ≤ 𝑛.
Proof
Since the degree of a vertex is the number of edges connected to that vertex, the sum of the
degree counts the total number of times an edge is connected with a vertex. Since every edge
is connected with exactly two vertices, each edge gets counted twice, once at each end.
Hence, the sum of the degrees of the vertices is equal twice the number of edges.
Question (FEB 2021 – 03 Marks)
Find the number of edges in 𝐺 if it has 5 vertices each of degree 2.
Answer
Step 1:
There are 5 vertices each of degree 2. So, their total degree contribution is 5 × 2 = 𝟏𝟎.
Note that the sum of the degrees of the vertices is equal twice the number of edges. That is,
∑deg⁡(𝑣𝑖 ) ⁡ = 𝟐𝒆.
Step 2:
Using the Handshaking theorem, we have, 2𝑒 = 10.
Step 3:
10
Solve the obtained equation for 𝑒. That is, 𝑒 = = 5. So, there are 𝟓 edges.
2

Question (SEP 2021 – 03 Marks)


How many nodes are necessary to construct a graph with exactly 8 edges in which each node
is of degree 2?
Answer
Step 1:
Given that the graph has 8 edges, the sum of the degrees of all nodes is 2 × 8 = 𝟏𝟔.
Step 2:
Let 𝑛 be the total number of nodes. The degree of each node is 2. So, their total degree
contribution is 𝒏 × 𝟐 = 𝟐𝒏.
Step 3:
Using the Handshaking theorem, we have,
2𝑛 = 16
16
Then, we have, 𝑛 = = 8. Therefore, the number of nodes in a graph 𝐺 is 𝟖.
2

Question (OCT 2020 – 03 Marks)


A graph 𝐺 has 15 edges, 3 vertices of degree 4 and other vertices of degree 3. Find the
number of vertices in 𝐺.
Answer
Step 1:
Given that the graph has 15 edges, the sum of the degrees of all vertices is 2 × 15 = 𝟑𝟎.
Step 2:
There are 3 vertices of degree 4. So, their total degree contribution is 3 × 4 = 𝟏𝟐.
Let 𝑛 be the total number of vertices. Then, 𝑛 − 3 be the number of other (remaining)
vertices. The degree of other vertices is 3. So, their total degree contribution is 𝟑 × (𝒏 − 𝟑).
Step 3:
Using the Handshaking theorem, we have,
12 + 3(𝑛 − 3) = 30
Step 4:
Solve the obtained equation for 𝑛.
12 + 3𝑛 − 9 = 30
⇒ 3𝑛 + 3 = 30
⇒ 3𝑛 = 30 − 3
⇒ 3𝑛 = 27
27
⇒𝑛= ⇒𝑛=9
3
Therefore, the number of vertices in a graph 𝐺 is 𝟗.
Question (JULY 2023 – 04 Marks)
Prove that any graph has even number of odd vertices.
OR
Question (OCT 2020 – 03 Marks)
Prove that there are always an even number of vertices of odd degree in a graph.
Answer
Using Handshaking theorem, we have the sum of degrees of all vertices is even number.
Let 𝑉𝑜𝑑𝑑 be the set of vertices with odd degrees and 𝑉𝑒𝑣𝑒𝑛 be the set of vertices with even
degrees. Therefore, we have,

∑ deg(𝑣) = ∑ deg(𝑣) + ∑ deg(𝑣)


𝑣∈𝑉 𝑣∈𝑉𝑜𝑑𝑑 𝑣∈𝑉𝑒𝑣𝑒𝑛

The sum of the degrees of vertices in 𝑉𝑒𝑣𝑒𝑛 is even because each term in the sum is an even
number.
To ensure that the total sum of all degrees is even, the sum of the degrees of vertices in 𝑉𝑜𝑑𝑑
must also be even. This is because the sum of an even number and an odd number is odd, and
since the total sum must be even, the sum of the degrees of the vertices with odd degrees
must be even.
The sum of an odd number of odd numbers is odd, while the sum of an even number of odd
numbers is even. Since the sum of the degrees of the vertices in 𝑉𝑜𝑑𝑑 is even, the number of
vertices in 𝑉𝑜𝑑𝑑 must be even.
Therefore, any graph must have an even number of vertices with odd degrees. This completes
the proof.

In-degree of a node

Let 𝑣 be any node (vertex) in directed graph 𝐺. Then, the In-degree of a node 𝑣 is denoted
by deg − (𝑣) or 𝑑− (𝑣) or 𝑑𝐺− (𝑣) and it is the number of incoming edges to 𝑣.

Important note

In directed graph, a loop (self-loop) at a node 𝑣 contributes one to the in-degree of 𝑣.

Out-degree of a node

Let 𝑣 be any node (vertex) in directed graph 𝐺. Then, the Out-degree of a node 𝑣 is denoted
by deg + (𝑣) or 𝑑+ (𝑣) or 𝑑𝐺+ (𝑣) and it is the number of outgoing edges from 𝑣.

Important note

In directed graph, a loop (self-loop) at a node 𝑣 contributes one to the out-degree of 𝑣.

Total degree of a node

Let 𝑣 be any node (vertex) in directed graph 𝐺. Then, the total degree of a node 𝑣 is denoted
by deg(𝑣) or 𝑑(𝑣) or 𝑑𝐺 (𝑣) and it is the sum of in-degree and out-degree of a node 𝑣. That
is, deg(𝑣) = deg − (𝑣) + deg + (𝑣).

For example,

1) The directed graph is shown below.

In the given directed graph,

deg − (𝑣1 ) = 0 and deg + (𝑣1 ) = 3. So, deg(𝑣1 ) = 0 + 3 = 3.

deg − (𝑣2 ) = 3 and deg + (𝑣2 ) = 0. So, deg(𝑣2 ) = 3 + 0 = 3.

deg − (𝑣3 ) = 0 and deg + (𝑣3 ) = 3. So, deg(𝑣3 ) = 0 + 3 = 3.

deg − (𝑣4 ) = 3 and deg + (𝑣4 ) = 0. So, deg(𝑣4 ) = 3 + 0 = 3.


deg − (𝑣5 ) = 0 and deg + (𝑣5 ) = 3. So, deg(𝑣5 ) = 0 + 3 = 3.

deg − (𝑣6 ) = 3 and deg + (𝑣6 ) = 0. So, deg(𝑣6 ) = 3 + 0 = 3.

2) The directed graph is shown below.

In the given directed graph,

deg − (𝑎) = 2 and deg + (𝑎) = 1. So, deg(𝑎) = 2 + 1 = 3.

deg − (𝑏) = 𝟏 and deg + (𝑏) = 𝟓. So, deg(𝑏) = 1 + 5 = 6.

deg − (𝑐) = 2 and deg + (𝑐) = 1. So, deg(𝑐) = 2 + 1 = 3.

deg − (𝑑) = 3 and deg + (𝑑) = 1. So, deg(𝑑) = 3 + 1 = 4.

Question (DEC 2022 – 07 Marks)


Define the terms: Simple Graph, Multi-Graph, Weighted Graph, Degree of a vertex, in degree
and out degree of a vertex. Illustrate each with an example.
(SEE THE ABOVE DEFINITIONS)
Question (FEB 2021 – 03 Marks)
Define indegree and outdegree of a vertex in a graph with example.
(SEE THE ABOVE DEFINITIONS)
Question (DEC 2021 – 07 Marks)
Show that sum of in-degrees of all the nodes of simple digraph is equal to the sum of out-
degrees of all the nodes and this sum equal to the number of edges in it.
Answer
Let us consider a simple digraph 𝐺 = (𝑉, 𝐸) where 𝑉 is the set of vertices and 𝐸 is the set of
edges.
Each edge 𝑒 = (𝑢, 𝑣) ∈ 𝐸 is counted exactly once in the sum of the out-degrees and exactly
once in the sum of the in-degrees.
Since every edge contributes to both an out-degree and an in-degree,
∑ deg − (𝑣) = ∑ deg + (𝑣) = |𝐸|
𝑣∈𝑉 𝑣∈𝑉

Therefore, the sum of the in-degrees of all nodes is equal to the sum of the out-degrees of all
nodes, and this sum is equal to the total number of edges in the digraph. This completes the
proof.

Complete graph

A complete graph is a graph in which each vertex is connected to every other vertex. That is,
there is an edge between each pair of vertices in complete graph. The complete graph with 𝑛
vertices is denoted by 𝐾𝑛 .

Question (OCT 2020 – 03 Marks)


Define simple graph, degree of a vertex and complete graph.
(SEE THE ABOVE DEFINITIONS)

Regular graph

A regular graph is a graph where every vertex has the same degree. If the degree of each
vertex is 𝑟 then it is called 𝒓-regular graph.
Bipartite graph

A bipartite graph is a graph in which the set of vertices can be divided into two distinct and
disjoint subsets such that no two vertices within the same subset are adjacent. In other words,
all edges in the graph connect a vertex in one subset to a vertex in the other subset.

Question (SEP 2021 – 04 Marks)


Draw a graph which is regular but not bipartite.
Answer

The above graph is 𝟐 - regular graph because the degree of every vertex is 2.

Since the above graph contains a triangle, it is NOT bipartite graph.

Question (OCT 2020 – 03 Marks)


Find the number of edges in a 𝑟 - regular graph with 𝑛 - vertices.
Answer
The degree of every vertex is 𝑟 in 𝑟 - regular graph.
Let 𝑛 be the number of vertices. Then, their total degree contribution is 𝑛 × 𝑟 = 𝑛𝑟.
We know that the sum of degrees of vertices is equal twice the number of edges. That is,
𝑛×𝑟 𝒏×𝒓
𝑛 × 𝑟 = 2𝑒. So, 𝑒 = . That is, the number of edges is in a 𝑟 - regular graph with 𝑛 -
2 𝟐

vertices.
Question (FEB 2021 – 03 Marks)
Does a 3 - regular graph with 5 vertices exist?
Answer
The degree of every vertex is 3 in 3 - regular graph.
Let 𝑛 = 5 be the number of vertices. Then, their total degree contribution is 5 × 3 = 15.
We know that the sum of degrees of vertices is always even. Here 15 is not an even number.
So, it is impossible to construct a 3 - regular graph with 5 vertices. Hence, a 3 - regular graph
with 5 vertices does not exist.
Question (JULY 2023 – 04 Marks)
Does there exist a 4 - regular graph with 6 vertices? If so, construct the graphs.
Answer
The degree of every vertex is 4 in 4 - regular graph.
Let 𝑛 = 6 be the number of vertices. Then, their total degree contribution is 6 × 4 = 24.
We know that the sum of degrees of vertices is always even. Here 24 is an even number. So,
it is possible to construct a 4 - regular graph with 6 vertices. Hence, a 4 - regular graph with
6 vertices exist.
𝑛×𝑟 6×4
Let 𝑒 be the number of edges. Then, 𝑒 = = = 12. That is, a 4 - regular graph with 6
2 2

vertices contain 12 edges. One of the graphs is shown below:

Subgraph
Let 𝐺 and 𝐻 be two graphs. Then, 𝐻 is said to be a subgraph of 𝐺 if the vertex set of 𝐻 is a
subset of vertex set of 𝐺 and the edge set of 𝐻 is a subset of edge set of 𝐺. That is, 𝑉(𝐻) ⊆
𝑉(𝐺) and 𝐸(𝐻) ⊆ 𝐸(𝐺). Note that here 𝐺 is called super graph of 𝐻.
For example, 𝐻1 , 𝐻2 and 𝐻3 are subgraphs of a graph 𝐺.
Vertex disjoint subgraph
Let 𝐻1 and 𝐻2 be two subgraphs of a graph 𝐺. Then, 𝐻1 and 𝐻2 are called vertex disjoint
subgraphs if there is no common vertex in 𝐻1 and 𝐻2 . That is, 𝑉(𝐻1 ) ∩ 𝑉(𝐻2 ) = ∅.

Edge disjoint subgraph


Let 𝐻1 and 𝐻2 be two subgraphs of a graph 𝐺. Then, 𝐻1 and 𝐻2 are called edge disjoint
subgraphs if there is no common edge in 𝐻1 and 𝐻2 . That is, 𝐸(𝐻1 ) ∩ 𝐸(𝐻2 ) = ∅.
For example, the vertex disjoint and edge disjoint subgraphs are shown below:

Question (OCT 2020 – 04 Marks)


Define vertex disjoint and edge disjoint subgraphs by drawing the relevant graphs.
(SEE THE ABOVE DEFINITIONS)
Complement of a subgraph
Let 𝐺 be the graph and 𝐻 be the subgraph of a graph 𝐺. Then, the complement of a subgraph
𝐻 with respect to the graph 𝐺 is another subgraph in which two vertices are adjacent only
̅.
when they are not adjacent in 𝐻. The complement of a subgraph 𝐻 is denoted by 𝐻
For example, the graph 𝐺, the subgraph 𝐻 and the complement of a subgraph 𝐻 are shown
below:

Question (FEB 2021 – 04 Marks)


Define complement of a subgraph by drawing the graphs.
(SEE THE ABOVE DEFINITION)

Converse (reversal or directional dual) of a digraph


̃ = (𝑉, E
The converse of a digraph 𝐺 = (𝑉, 𝐸) is denoted by G ̃) in which the relation E
̃
̃ is obtained from 𝐺 by simply reversing the
is the converse of the relation 𝐸. The diagram G
̃ is also called the reversal or directional dual of
directions of the edges in 𝐺. The converse G
a digraph 𝐺.
For example, the graph 𝐺 and the converse of a graph 𝐺 are shown below:
Walk
A walk is a sequence of vertices and edges in a graph where each edge's endpoints are
consecutive vertices in the sequence. That is, a walk is a finite alternating sequence 𝑣0 , 𝑒1 ,
𝑣1 , 𝑒2 , 𝑣2 , 𝑒3 , …, 𝑒𝑛 , 𝑣𝑛 in which 𝑣0 and 𝑣𝑛 are end (terminal) vertices.
Important note
1) Here 𝑣1 , 𝑣2 , 𝑣3 , …, 𝑣𝑛−1 are called internal vertices.
2) A walk is called open walk if end (terminal) vertices are distinct.
3) A walk is called closed walk if end (terminal) vertices are same.
4) A walk may repeat both vertices and edges.
5) The number of edges in a walk is called the length of a walk.
Path
A path is a finite alternating sequence 𝑣0 , 𝑒1 , 𝑣1 , 𝑒2 , 𝑣2 , 𝑒3 , …, 𝑒𝑛 , 𝑣𝑛 in which all
vertices are distinct and all edges are distinct.
Important note
1) A path does not repeat any vertex or edge.

Length of path
The number of edges in a path is called the length of a path.
Simple path (edge simple)
A path in which all the edges are distinct is called a simple path (edge simple).
Elementary path (node simple)
A path in which all the nodes are distinct is called an elementary path (node simple).
Cycle (circuit)
A path which originates and ends in the same node is called a cycle (circuit).
Cyclic graph
A cyclic graph is a graph containing at least one cycle which is a path that originates and
ends in the same node.
Simple cycle
A cycle in which all the edges are distinct is called a simple cycle.
Elementary cycle
A cycle is called elementary if it does not traverse through any node more than once. In other
words, a cycle in which all the nodes are distinct is called an elementary cycle.
For example,

➢ 𝑉1 - 𝑒1 - 𝑉2 - 𝑒7 - 𝑉4 - 𝑒6 - 𝑉1 - 𝑒1 - 𝑉2 - 𝑒2 - 𝑉3 - 𝑒5 - 𝑉5 is a walk of length 6 from


node 𝑉1 to node 𝑉5. Note that a walk may repeat both vertices and edges.
➢ 𝑉1 - 𝑒1 - 𝑉2 - 𝑒2 - 𝑉3 - 𝑒3 - 𝑉4 - 𝑒4 - 𝑉5 is a path of length 4 from node 𝑉1 to node 𝑉5.
Note that a path does not repeat any vertex or edge.
➢ 𝑉1 - 𝑒1 - 𝑉2 - 𝑒2 - 𝑉3 - 𝑒5 - 𝑉5 is another path of length 3 from node 𝑉1 to node 𝑉5.
Note that a path does not repeat any vertex or edge.
➢ 𝑽𝟏 - 𝑒1 - 𝑉2 - 𝑒2 - 𝑉3 - 𝑒3 - 𝑉4 - 𝑒6 - 𝑽𝟏 is cycle of length 4. Note that a cycle
originates and ends in the same node.

Question (FEB 2021 – 04 Marks)


Define path and circuit of a graph by drawing the graphs.
(SEE THE ABOVE DEFINITIONS)
Question (JULY 2023 – 02 Marks)
Define cycle and walk.
(SEE THE ABOVE DEFINITIONS)
Question (JULY 2022 – 03 Marks)
Explain Path and Circuit of a graph.
(SEE THE ABOVE DEFINITIONS)

Isomorphic graphs
A graph 𝐺1 = (𝑉1 , 𝐸1 ) is said to be isomorphic to the graph 𝐺2 = (𝑉2 , 𝐸2 ) if there exist a
bijection (or mapping) between the set of nodes 𝑉1 and 𝑉2 and a bijection (or mapping)
between the set of edges 𝐸1 and 𝐸2 such that if 𝑒1 = (𝑢1 , 𝑣1 ) is an edge in 𝐺1 then the
corresponding edge 𝑒2 = (𝑢2 , 𝑣2 ) in 𝐺2 which correspond to (𝑢1 , 𝑣1 ).
Important points
1) Isomorphic graphs have the same number of nodes and edges.
2) If the two graphs have same number of nodes and edges then the graphs may or may
not be isomorphic.
3) The concept of isomorphic graphs also defines in undirected graphs with the same
definition given for directed graphs.
4) Isomorphic graphs have the same degree sequence.
For example,
1) Two graphs 𝐺1 and 𝐺2 are given below:

Mapping between vertices:


1 → 𝑢3 , 2 → 𝑢1 , 3 → 𝑢4 , 4 → 𝑢2
Mapping between edges:
(1, 2) → (𝑢3 , 𝑢1 ) , (1, 3) → (𝑢3 , 𝑢4 ) , (2, 4) → (𝑢1 , 𝑢2 ) , (3, 4) → (𝑢4 , 𝑢2 )
The mapping between the set of nodes and between the set of edges exists. So, the
given graphs are isomorphic graphs.

2) Two graphs 𝐺1 and 𝐺2 are given below:

In the graph 𝐺1 , there is directed edge (3, 1) between 1 and 3.

In the graph 𝐺2 , there is directed edge (𝑣1 , 𝑣3 ) between 𝑣1 and 𝑣3 .

That is, (3, 1) ↛ (𝑣1 , 𝑣3 ). That is, the directions are different for these two edges.

So, the given graphs are NOT isomorphic graphs.

3) Two graphs 𝐺1 and 𝐺2 are given below:


Mapping between vertices:
1→𝑎,2→𝑑,3→𝑏,4→𝑒,5→𝑐
Mapping between edges:
(1, 3) → (𝑎, 𝑏) , (3, 5) → (𝑏, 𝑐) , (5, 2) → (𝑐, 𝑑) , (2, 4) → (𝑑, 𝑒) , (4, 1) → (𝑒, 𝑎)
The mapping between the set of nodes and between the set of edges exists. So, the
given graphs are isomorphic graphs.

Question (FEB 2024 – 04 Marks)


Check whether the following graphs are isomorphic.

Answer
Find the appropriate mapping between the set of nodes and between the set of edges if exists.
Mapping between vertices:
𝑎 → 𝑣1 , 𝑏 → 𝑣6 , 𝑐 → 𝑣3 , 𝑑 → 𝑣2 , 𝑓 → 𝑣4 , 𝑒 → 𝑣5
Mapping between edges:
(𝑎, 𝑏) → (𝑣1 , 𝑣6 ) , (𝑎, 𝑑) → (𝑣1 , 𝑣2 ) , (𝑎, 𝑓) → (𝑣1 , 𝑣4 ) ,
(𝑐, 𝑏) → (𝑣3 , 𝑣6 ) , (𝑐, 𝑑) → (𝑣3 , 𝑣2 ) , (𝑐, 𝑓) → (𝑣3 , 𝑣4 ) ,
(𝑒, 𝑏) → (𝑣5 , 𝑣6 ) , (𝑒, 𝑑) → (𝑣5 , 𝑣2 ) , (𝑒, 𝑓) → (𝑣5 , 𝑣4 )
The mapping between the set of nodes and between the set of edges exists. So, the given graphs
are isomorphic graphs.
Question (JULY 2023 – 07 Marks)
Define Isomorphic Graphs. Determine whether the following graphs are isomorphic or not.

Answer
TRY YOURSELF
Hint: Mapping between vertices: 𝑎 → 1 , 𝑏 → 2 , 𝑐 → 3 , 𝑑 → 4 , 𝑒 → 5. Use this mapping to
redraw the graph 𝐻 with the same orientation of the graph 𝐺.

Question (JULY 2022 – 04 Marks)


Define Isomorphic Graphs and verify the following graphs are Isomorphic or not (Justify).

Answer
A graph 𝐺1 = (𝑉1 , 𝐸1 ) is said to be isomorphic to the graph 𝐺2 = (𝑉2 , 𝐸2 ) if there exist a
bijection (or mapping) between the set of nodes 𝑉1 and 𝑉2 and a bijection (or mapping) between
the set of edges 𝐸1 and 𝐸2 such that if 𝑒1 = (𝑢1 , 𝑣1 ) is an edge in 𝐺1 then the corresponding
edge 𝑒2 = (𝑢2 , 𝑣2 ) in 𝐺2 which correspond to (𝑢1 , 𝑣1 ).

In graph - 1, the degree of vertex 𝑥 is 𝟑. The degree of vertices 𝑢 and 𝑣 is 𝟏. Note that 𝑥 is
adjacent to two pendant vertices 𝑢 and 𝑣.
In graph - 2, the degree of vertex 𝑦 is 𝟑. The degree of vertex 𝑤 is 𝟏. Note that 𝑦 is adjacent
to only one pendant vertex 𝑤.
Here the preservation of adjacency of the vertices is NOT maintained.
Hence, the given graphs are NOT isomorphic.

Question (SEP 2021 – 07 Marks)


Define Isomorphic Graphs. Verify the following graphs are Isomorphic or not (Justify).
𝒃 𝒃
𝒂 𝒄 𝒂 𝒄

Answer
A graph 𝐺1 = (𝑉1 , 𝐸1 ) is said to be isomorphic to the graph 𝐺2 = (𝑉2 , 𝐸2 ) if there exist a
bijection (or mapping) between the set of nodes 𝑉1 and 𝑉2 and a bijection (or mapping) between
the set of edges 𝐸1 and 𝐸2 such that if 𝑒1 = (𝑢1 , 𝑣1 ) is an edge in 𝐺1 then the corresponding
edge 𝑒2 = (𝑢2 , 𝑣2 ) in 𝐺2 which correspond to (𝑢1 , 𝑣1 ).

In graph - 1, the degree of vertex 𝑎 is 3. The vertex 𝑎 is adjacent to 𝑏 and 𝑐. The degree of
vertices 𝑏 and 𝑐 is 3.
In graph - 2, the degree of vertex 𝑎 is 3. The vertex 𝑎 is adjacent to 𝑏 and 𝑐. The degree of
vertex 𝑏 is 3 but the degree of vertex 𝑐 is 2.
That is, the preservation of adjacency of the vertices is NOT maintained.
Hence, the given graphs are NOT isomorphic.

Reachability of a vertex
In a simple digraph, a node 𝑢 is said to be reachable from the node 𝑣 if there exists at least
one path from 𝑣 to 𝑢.
For example, the vertex 3 is reachable from the vertex 1 because there is a path 1 - 4 - 3
from 1 to 3. Note that the vertex 1 is not reachable from the vertex 3 because there is no path
from 3 to 1.
Reachable set of a given node
The set of nodes which are reachable from a given node 𝑣 is said to be the reachable set of 𝑣.
It is denoted by 𝑅(𝑣).
For example, the graph is shown below:

There is a path 𝑣1 - 𝑣2 - 𝑣3 - 𝑣4 - 𝑣1 from 𝑣1 to 𝑣1 . So, 𝑣1 is reachable from 𝑣1 .

There is a path 𝑣1 - 𝑣2 from 𝑣1 to 𝑣2 . So, 𝑣2 is reachable from 𝑣1 .

There is a path 𝑣1 - 𝑣2 - 𝑣3 from 𝑣1 to 𝑣3 . So, 𝑣3 is reachable from 𝑣1 .

There is a path 𝑣1 - 𝑣2 - 𝑣3 - 𝑣4 from 𝑣1 to 𝑣4 . So, 𝑣4 is reachable from 𝑣1 .

There is a path 𝑣1 - 𝑣2 - 𝑣5 from 𝑣1 to 𝑣5 . So, 𝑣5 is reachable from 𝑣1 .

There is a path 𝑣1 - 𝑣2 - 𝑣5 - 𝑣6 from 𝑣1 to 𝑣6 . So, 𝑣6 is reachable from 𝑣1 .

There is no path from 𝑣1 to 𝑣7 , 𝑣1 to 𝑣8 , 𝑣1 to 𝑣9 and 𝑣1 to 𝑣10 . So, 𝑣7 , 𝑣8 , 𝑣9 and 𝑣10 are not
reachable from 𝑣1 . That is, only the vertices 𝑣1 , 𝑣2 , 𝑣3 , 𝑣4 , 𝑣5 and 𝑣6 are reachable from 𝑣1 .
Hence, the reachable set of 𝑣1 is given by 𝑅(𝑣1 ) = {𝑣1 , 𝑣2 , 𝑣3 , 𝑣4 , 𝑣5 , 𝑣6 }.

Similarly,

𝑅(𝑣2 ) = {𝑣1 , 𝑣2 , 𝑣3 , 𝑣4 , 𝑣5 , 𝑣6 }

𝑅(𝑣3 ) = {𝑣1 , 𝑣2 , 𝑣3 , 𝑣4 , 𝑣5 , 𝑣6 }

𝑅(𝑣4 ) = {𝑣1 , 𝑣2 , 𝑣3 , 𝑣4 , 𝑣5 , 𝑣6 }

𝑅(𝑣5 ) = {𝑣1 , 𝑣2 , 𝑣3 , 𝑣4 , 𝑣5 , 𝑣6 }

𝑅(𝑣6 ) = {𝑣6 }
𝑅(𝑣7 ) = {𝑣6 , 𝑣7 }

𝑅(𝑣8 ) = {𝑣6 , 𝑣7 , 𝑣8 }

𝑅(𝑣9 ) = {𝑣9 } and 𝑅(𝑣10 ) = {𝑣10 }

Reachable set of a given subset


Let 𝑆 be any subset of 𝑉 where 𝑉 is a vertex set. Then, the reachable set of subset 𝑆 is the set
of nodes which are reachable from any node of 𝑆. It is denoted by 𝑅(𝑆).
Node base
Let 𝑋 be any subset of 𝑉 where 𝑉 is a vertex set. Then, a subset 𝑋 is called a node base if the
reachable set of 𝑋 is 𝑉 and no proper subset of 𝑋 has this property.
For example, the graph is shown below:

Here 𝑉 = {𝑣1 , 𝑣2 , 𝑣3 , 𝑣4 , 𝑣5 , 𝑣6 , 𝑣7 , 𝑣8 , 𝑣9 , 𝑣10 } is the vertex set.


Let 𝑋 = {𝑣5 , 𝑣8 , 𝑣9 , 𝑣10 } be the subset of 𝑉.
The reachable set of 𝑋 is 𝑉. That is, 𝑅(𝑋) = 𝑉. Hence, {𝑣5 , 𝑣8 , 𝑣9 , 𝑣10 } is a node base.
Let 𝑋 = {𝑣1 , 𝑣8 , 𝑣9 , 𝑣10 } be the subset of 𝑉.
The reachable set of 𝑋 is 𝑉. That is, 𝑅(𝑋) = 𝑉. Hence, {𝑣1 , 𝑣8 , 𝑣9 , 𝑣10 } is also a node base.

Question (FEB 2024 – 04 Marks)


Find reachable set of each node of the given digraph. Also find 𝑑(𝑉1 , 𝑉3 ), 𝑑(𝑉3 , 𝑉1 ).

Answer

There is a path 𝑉1 - 𝑉2 from 𝑉1 to 𝑉2. So, 𝑉2 is reachable from 𝑉1.


There is a path 𝑉1 - 𝑉2 - 𝑉3 from 𝑉1 to 𝑉3. So, 𝑉3 is reachable from 𝑉1.

There is a path 𝑉1 - 𝑉4 from 𝑉1 to 𝑉4. So, 𝑉4 is reachable from 𝑉1.

That is, all the vertices 𝑉1, 𝑉2, 𝑉3, 𝑉4 are reachable from 𝑉1. Hence, the reachable set of 𝑉1 is
given by 𝑅(𝑉1 ) = {𝑉1, 𝑉2, 𝑉3, 𝑉4 }.
Similarly,
𝑅(𝑉2 ) = {𝑉2, 𝑉3, 𝑉4 }
𝑅(𝑉3 ) = {𝑉3, 𝑉4 }
𝑅(𝑉4 ) = {𝑉3, 𝑉4 }

The shortest path from vertex 𝑉1 to vertex 𝑉3 is 𝑉1 - 𝑉2 - 𝑉3. The number of edges in the
shortest path is 2. So, the distance between the vertex 𝑉1 and vertex 𝑉3 is 2. That is,
𝑑(𝑉1 , 𝑉3 ) = 𝟐.
There is no path from vertex 𝑉3 to vertex 𝑉1. So, 𝑑(𝑉3 , 𝑉1 ) = ∞.

Question (JULY 2023 – 03 Marks)


Find reachable set of all the vertices and node base of following graph.

Answer
TRY YOURSELF
Hint: 𝑅(1) = {1, 2, 3, 4} , 𝑅(2) = {2, 3, 4}, 𝑅(3) = {3, 4} , 𝑅(4) = {1, 2, 3, 4}

Geodesic
If a node 𝑢 is reachable from the node 𝑣 then a path of minimum length from 𝑣 to 𝑢 is called
a geodesic.
Distance
The distance between two vertices 𝑢 and 𝑣 is the number of edges in a shortest path from 𝑢
to 𝑣. It is denoted by 𝑑(𝑢, 𝑣).
For example,

The shortest path from vertex 1 to vertex 5 is 1 - 2 - 5. The number of edges in the shortest
path is 2. So, the distance between the vertex 1 and vertex 5 is 2. That is, 𝑑(1, 5) = 𝟐.

Eccentricity
Eccentricity of vertex 𝑣 is defined as the maximum distance of vertex 𝑣 from another vertex.
It is denoted by 𝑒(𝑣).
For example,

Here 𝑑(𝐴, 𝐵) = 1. That is, the distance between 𝐴 and 𝐵 is 1.

Also, 𝑑(𝐴, 𝐶) = 𝟐 and 𝑑(𝐴, 𝐷) = 1.

The maximum distance of vertex 𝐴 from another vertex is 2. So, eccentricity of vertex 𝐴 is 2.
That is, 𝑒(𝐴) = 2.

Centre of a graph
The centre of a graph is the set of all vertices of minimum eccentricity.
For example,
Here the centre is 𝑨. The eccentricity of vertex 𝐴 is 1 and that is minimum.

Important note

To find the centre of the graph, we need to find the eccentricity of each vertex and find
minimum among all of them.

Question (FEB 2024 – 03 Marks)


Define null graph, centre of a graph and complete graph.
(SEE THE ABOVE DEFINITIONS)
Question (FEB 2021 – 02 Marks)
Define centre of a graph.
(SEE THE ABOVE DEFINITION)

Connectedness in undirected graphs


Connected graph
An undirected graph is connected if there is a path for any pair of vertices. That is, an
undirected graph is connected if for any pair of vertices, the two vertices are reachable from
one another.
Disconnected graph
An undirected graph is disconnected if there exist at least two vertices having no path
between them.
For example,
1) The given graph is connected because there is a path for any pair of vertices.

2) The given graph is disconnected because there is no path between vertices 𝑏 and ℎ.
Question (DEC 2021 – 07 Marks)
Explain the following terms with proper illustrations.
a) Directed graphs
b) Simple and elementary path
c) Reachability of a vertex
d) Connected graph
(SEE THE ABOVE DEFINITIONS)

Connectedness in directed graphs


Weakly connected digraph
A directed graph (or digraph) is called weakly connected (or connected) digraph if it is
connected when the graph is treated as an undirected graph. In other words, it is connected
when the direction of edges is neglected.
Unilaterally connected digraph
A directed graph (or digraph) is called unilaterally connected digraph if for any pair of
vertices, at least one of the vertices of the pair is reachable from the other vertex. In other
words, there is either forward path or backward path for any pair of vertices.
Strongly connected digraph
A directed graph (or digraph) is called strongly connected digraph if for any pair of vertices,
both the vertices of the pair are reachable from one another. In other words, there are both
forward path and backward path for any pair of vertices.
Important points
1) A unilaterally connected digraph is weakly connected.
2) A weakly connected digraph is not necessarily unilaterally connected.
3) A strongly connected digraph is both unilaterally and weakly connected.
For example,
1) The given graph is NOT unilaterally connected because there is no forward or
backward path between the vertices 2 and 4. That is, there is no path from 2 to 4 and
there is no path from 4 to 2. The given graph is weakly connected graph.
2) The given graph is unilaterally connected because there is either forward or
backward path for any pair of vertices.

Pairs of vertices Forward path Backward path


(1, 2) NO YES. 2 - 1
(1, 3) YES. 1 - 4 - 3 NO
(1, 4) YES. 1 - 4 NO
(2, 3) YES. 2 - 3 NO
(2, 4) YES. 2 - 1 - 4 NO
(3, 4) NO YES. 4 - 3

3) The given graph is strongly connected because there are both forward path and
backward path for any pair of vertices.

Pairs of vertices Forward path Backward path


(1, 2) YES. 1 - 2 YES. 2 - 3 - 1
(1, 3) YES. 1 - 2 - 3 YES. 3 - 1
(1, 4) YES. 1 - 4 YES. 4 - 3 - 1
(2, 3) YES. 2 - 3 YES. 3 - 1 - 2
(2, 4) YES. 2 - 3 - 1 - 4 YES. 4 - 2
(3, 4) YES. 3 - 1 - 4 YES. 4 - 3

Question (SEP 2021 – 03 Marks)


Define Cyclic graph, Null graph and strongly connected graph.
(SEE THE ABOVE DEFINITIONS)
Weak Component of a graph
A weak component of a directed graph (or digraph) is a maximal subgraph that is weakly
connected.
Unilateral Component of a graph
A unilateral component of a directed graph (or digraph) is a maximal subgraph that is
unilaterally connected.
Strong Component of a graph
A strong component of a directed graph (or digraph) is a maximal subgraph that is strongly
connected.
For example,
1) The below graph has two strongly connected components {1, 2, 3, 4} and {5, 6, 7}
because there is a path from each vertex to every other vertex.

2) For the digraph given in below figure,


the strong components are {1, 2, 3}, {4}, {5}, {6}. Note that there are both forward
path and backward path for any pair of vertices 1, 2 and 3.
The unilateral components are {1, 2, 3, 4, 5}, {6}. Note that there is either forward or
backward path for any pair of vertices 1, 2, 3, 4 and 5.
The weak component is {1, 2, 3, 4, 5, 6} because the graph is weakly connected.

Question (OCT 2020 – 04 Marks)


Define the following by drawing graphs (i) weak component (ii) unilateral component (iii)
strong component.
(SEE THE ABOVE DEFINITIONS)
Question (FEB 2024 – 07 Marks)
Define Strong, unilateral, weak component. Also Find strong, unilateral, weak component
from the given digraph.

Answer
A weak component of a directed graph (or digraph) is a maximal subgraph that is weakly
connected.
A unilateral component of a directed graph (or digraph) is a maximal subgraph that is
unilaterally connected.
A strong component of a directed graph (or digraph) is a maximal subgraph that is strongly
connected.
For the digraph given in above figure,
the strong components are {𝑉1 , 𝑉2 , 𝑉3 , 𝑉4 } and {𝑉5 }. Note that there are both forward path and
backward path for any pair of vertices 𝑉1, 𝑉2, 𝑉3 and 𝑉4.
The unilateral component is {𝑉1 , 𝑉2 , 𝑉3 , 𝑉4 , 𝑉5 }. Note that there is either forward or backward
path for any pair of vertices 𝑉1 , 𝑉2 , 𝑉3 , 𝑉4 and 𝑉5.
The weak component is {𝑉1 , 𝑉2 , 𝑉3 , 𝑉4 , 𝑉5 } because the graph is weakly connected.
Cut vertex
A cut vertex (also known as an articulation point) in a graph is a vertex that, when removed
along with all its incident edges, disconnects the graph or increases the number of connected
components in the graph. In other words, removing a cut vertex increases the number of
disjoint subgraphs.
For example, the graph 𝐺 is shown below:
In the above graph, vertex 𝒆 is a cut-vertex because after removing a vertex 𝑒 along with all
its incident edges from the above graph, the given graph will become a disconnected graph.
The result is shown below:

Note that there is no path from vertex 𝑏 to vertex ℎ. So, it is disconnected graph.

Note that in the given graph, vertex 𝒄 is also cut-vertex.

Question (DEC 2022 – 03 Marks)


Define cut vertex. List out all the cut vertices of the graph given in figure.

Answer
A cut vertex (also known as an articulation point) in a graph is a vertex that, when removed
along with all its incident edges, disconnects the graph or increases the number of connected
components in the graph. In other words, removing a cut vertex increases the number of
disjoint subgraphs.
In the above graph, vertex 𝑩 is a cut-vertex because after removing a vertex 𝐵 along with all
its incident edges from the above graph, the given graph will become a disconnected graph.
Similarly, vertex 𝑫 is a cut-vertex because after removing a vertex 𝐷 along with all its
incident edges from the above graph, the given graph will become a disconnected graph.
Similarly, vertex 𝑬 is a cut-vertex. Hence, the vertices 𝐵, 𝐷 and 𝐸 are cut vertices.

You might also like