0% found this document useful (0 votes)
4 views

3. Graph Theory

The document provides an overview of graph theory, focusing on undirected graphs, their definitions, and various terminologies such as adjacent vertices, edges, and graph order. It discusses different types of graphs including simple graphs, multigraphs, and pseudographs, along with properties and theorems related to graph degrees and structures. Additionally, it includes examples and solved problems to illustrate concepts like degree sequences and the handshaking theorem.

Uploaded by

saifuce1
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
4 views

3. Graph Theory

The document provides an overview of graph theory, focusing on undirected graphs, their definitions, and various terminologies such as adjacent vertices, edges, and graph order. It discusses different types of graphs including simple graphs, multigraphs, and pseudographs, along with properties and theorems related to graph degrees and structures. Additionally, it includes examples and solved problems to illustrate concepts like degree sequences and the handshaking theorem.

Uploaded by

saifuce1
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
You are on page 1/ 29

3 Graph Theory

Graph Theory In given figure, p and q are adjacent vertices,


and x1 is the common edge.
Graph theory helps in solving real time
problems. In graphs theory, we will study Adjacent edges:
mainly about undirected graphs. Adjacent edges are those edges which are
fain to the common vertex.
Undirected graph and graph models:

Definition

A graph G = (V, E) consists of V, a non-


empty set of vertices (or nodes) and E, a
set of edges and every edge is associated
with unordered pair of vertices. In the above shown figure, e1 is adjacent to
both e2 (having common vertex a) and e4
(having common vertex d).
Each edge is connected to one or two vertices,
which are referred to as its endpoints.
Order of a graph:
Order of a graph G, is the total number of
vertices present in the graph.
It is denoted by O(G).

In an undirected graph, an edge from vertex Size of graph:


v to vertex u will be same as an edge from Size of a graph G, is the total number of
vertex u to vertex v. edges present in the graph.
Example: Consider the following graph:

O(G) = 4
V = {P, Q, R, S} Size(G) = 5
E = {x1, x2, x3, x4}
Self loop:
Terminologies: It is an edge in the graph which has same
There are some terminologies in graph end points, i.e., it connects a vertex to itself.
theory:

Adjacent vertices:
Two vertices v and u, belonging to vertex set Parallel edges (multiple edges):
V of an undirected graph G(V,E), are adjacent If in a graph between two vertices, if more
if there exists an edge e, such that e belongs than one edge is there, then those edges are
to set E and connects the vertices u and v. known as parallel edges.
The graph, which contains parallel edges is
known as multigraph.

Graph Theory 55
Multiple edges from c to d are shown by e1 Simple graph:
and e2 in the diagram. Simple graph can be defined as an undirected,
unweighted graph having no self loops and
multiple/parallel edges.

Note:

Edge-labelled graphs: y A simple graph can be either connected


A graph with labelled edges is called edge or disconnected.
labelled graph. y For directed graph: E ~ V x V

Fig. 3.1 A simple Graph

Isolated vertex:
An isolated vertex does not have any vertex
adjacent to it, i.e., it is a vertex with degree     (I)                 
(II)
zero.
Fig. 3.2 Non-Simple Graphs (I) with Multiple Edges
Example: Consider the following figure: (II) with Self Loops

Properties of simple graph:


y For a simple complete graph consisting
of ‘n’ number of vertices, the maximum
possible edges are:
n(n − 1)
  =
2
y Number of simple graph possible with n
In the above figure, the isolated vertex is 'g' vertices = 2n(n–1)/2
y With ‘n’ vertices and ‘m’ edges, the number
Pendant vertex: of simple graphs that are possible:
In a graph, if any vertex has degree one, then
that vertex is known as pendent vertex.  n(n − 1) 
=C ,m 
Example:  2 
 
Example: Find the maximum number of
simple graphs possible with five vertices and
two edges.
Solution:
Maximum edges possible = C(5, 2) = 10
 n(n − 1) 5 × 4 
 = = 10
 2 2 
In the given figure, the pendent vertex is 'd'.
Maximum number of graphs = C(10, 2) = 45

56 Graph Theory
Multigraph:
Graphs that may have multiple/parallel edges
and no self loops are called multigraphs.

Fig. 3.5 Simple Directed Graph

Fig. 3.3 Example of Multigraph Directed Multigraph:


Pseudograph: A directed graph having more than one edge
A graph G consisting of self loops and between two vertices, is known as directed
parallel/multiple edges can be defined as multigraph.
pseudograph.
Note:
A graph with both directed and undirected
edges is called mixed graph.

1. Simple graph

Fig. 3.4 Pseudograph

Directed graph:
If in a graph all the edges are ordered edges,
i.e., edges with direction then the graph is
known as directed graph, i.e., edge from
vertex v to u is not same as edge from vertex
u to v.   It has undirected edges, no multiple

edges, no self loops.
2. Multigraph

Here, V = {A, B, C, D}
E = {(A, B), (B, D), (D, C), (C, A)}

Simple directed graph:


 It has undirected edges, multiple edges

Definition between a and b and no self loops.
3. Pseudograph
“A directed graph or (d igraph) G = (V, E)
consists of a non-empty set of vertices
V and a set of directed edge E associated
with the ordered pair (u, v) is said to start
at u and end at v. When a directed graph
has no Loops and has no multiple directed
edges, it is called a simple directed graph.”

Graph Theory 57
a) It has directed edges. For each self loop the degree is counted as 2.
b) N
 o multiple edges, first is from c to d
and second is from d to c. Min-degree: Least among the degrees of all
c) It has 2 self loops (on c and e). given vertices, represented by d.

Max-degree: Maximum among the degrees


of all the vertices in G. It is represented by D.
Rack Your Brain
Example:
What kind of graph can be used to model
a highway system between major cities
where:
1. There is an edge between the vertices,
representing cities, if there is an
interstate highway between them?
2. There is an edge between the verti-
ces, representing cities, for each Solution:
interstate highway between them.
deg(v)

a 2

b 3
Rack Your Brain
c 2
Describe a graph model that can be
d 3
used to represent all forms of electronic
communication between two people in d(G) = 2 and D(G) = 3.
a single graph. What kind of graph is
needed? Note:
Let G be a simple undirected graph with
Degree of vertex: v-vertices and e-edges.
The number of edges that are incident onto x
a vertex is termed as the degree of that
( 1-x )
2

vertex.

Solved Examples

1. What are the degree of vertices in the deg (d) = 1


graphs G and H displayed in given figure: deg (e) = 3
deg (g) = 0
In H:
deg (a) = 4
   (G) (H) deg (b) = 6
Solution: deg (e) = 6
deg (c) = 1
In G:
deg (a) = 2 deg (d) = 5
deg (b) = deg (c) = deg (f) = 4
58 Graph Theory
In and out degree of a vertex in directed
graph: Note:
In degree: This theorem is applicable even if multi-
In-degree of a vertex V in a directed graph ple edges and self loops are present
G(V, E) is the total number of incoming edges (pseudograph) in the graph.
to the vertex.
Out degree:
Out-degree of a vertex V in a directed graph Corollary 1: Let G = (V,E) be a directed graph
G(V, E) is the total number of outgoing edges with V = {V1, V2 , ..., Vn} then
from a vertex. n n

=i 1=i 1

deg + (Vi )
= ∑
deg − (Vi ) |E |
=
Note:
i.e., for a directed graph sum of all the out
y A loop at a vertex contributes one to
degrees of vertices is equal to sum of all
both the in-degree and the out degree
in degrees of the vertices, which is equal to
of this vertex.
number of edges in the graph because in
y As each edge has an initial vertex and
directed graph every edge will be counted as
a terminal vertex, the sum of the in-
in degree for some vertex and out degree for
degree and the sum of the out-degree
some other vertex.
of all vertices in a graph with directed
where e = number of edges in the graph.
edges are the same. Both of these
deg(V) = in-degree(V) + out-degree(V)
sums are the number of edges in the
Corollary 2: In an undirected graph, the
graph.
number of odd degree vertices are even.

Rack Your Brain

Determine number of vertices and edges


and find the in-degree and out-degree
of each vertex for given directed
multigraph.

Corollary 3: If G is an undirected graph with


degree of each vertex k, then k×|v| = 2|E|.
Corollary 4: If G is an undirected graph with
degree of each vertex atleast k (³ k) then
k×|v| ≤ 2|E|.

Example:

Handshaking theorem: Further consequent


theorems
Handshaking theorem states that the total
number of edges contained in a graph is half
the degree sum of all the vertices.
2×4≤2×4
∑ deg (u) = 2 | E |
u∈v
8≤8

Graph Theory 59
Corollary 5: If G is an undirected graph with Consider the degree sequences S1 and S2,
degree of each vertex atmost k (≤ k) then and assume that S1 is in descending order.
k*|v| ³ 2|E|. S1: {S, t1, t2, … tS, d1, d2, …, dn}
S2: {t1 – 1, t2 – 1, …, tS – 1, d1, d2, … dn}
Example: S1 is graphic & S2 is graphic.
Steps involved in this theorem:
y Sort given degree sequence in descending
order.
y Pick the largest element and remove it
from the list.
y Construct a new list.
2×4³2×4 y Take number of elements = largest
element chosen.
Degree sequence: y Subtract 1 from all the taken elements.
y Arrangement of degree of all the vertices y Check if obtained degree sequence is valid
either in ascending or descending order, or not (say this S2).
the sequence then obtained is called y S1 is a valid graphical degree sequence if
degree sequence. S2 is a valid graphical sequence.
y In any undirected graph, if degree of each y Repeat steps 1-7.
vertex is distinct, then simple graph does
not exist. Points to remember:
y If we get atleast one negative term in
Havell-Hakimi theorem: degree sequence, then simple graph does
The purpose of this theorem is to check if a not exist for the given degree sequence.
given degree sequence is a degree sequence y When there are not enough degree present
of a simple graph or not. in the degree sequence, then also simple
graph does not exist.

Solved Examples

2. <6, 6, 6, 6, 3, 3, 2, 2>, determine whether 3. <7, 6, 6, 4, 4, 3, 2, 2>, determine whether


the given degree sequence represents a the given degree sequence represents a
simple undirected graph. simple undirected graph.
Solution: Solution:
<6, 6, 6, 6, 3, 3, 2, 2> <7, 6, 6, 4, 4, 3, 2, 2>
<5 5 5 2 2 1 2> <5 5 3 3 2 1 1>
<5 5 5 2 2 2 1>
<4 4 1 1 1 1> <4 2 2 1 0 1>
<3 0 0 0 1> <4 2 2 1 1 0>
<3 1 0 0 0>
<1 1 0 0 0>
<0 –1 –1 0> As, it is visible that there are
<0 0 0 0>- All zeros present, therefore, it
two negative integers present in degree
represents a simple undirected graph.
sequence. Therefore it can not represent a
simple undirected graph.

60 Graph Theory
4. <8, 7, 7, 6, 4, 2, 1, 1>, determine whether Some special simple graphs:
the given degree sequence represents a Null graph:
simple undirected graph. A graph having ‘V’ vertices and zero edges is
Solution: known as null graph.
In the above given degree sequence, after
choosing 8 we need to subtract 1 from 8 Trivial graph:
elements out of remaining elements but Trivial graph consists of one vertex and zero
there are only 7 elements left. Therefore, edges.
given degree sequence is not valid sequence Regular graph:
for simple undirected graph. A graph in which all the vertices have same
OR degree is known as regular graph.

If we have 8 vertex maximum degree is 7, not


Note:
8. So simple graph does not exist.
Every polygon is a 2-regular graph.
5. How many edges are there in a graph
with 10 vertices each of degree six?

Solution:

2e = 60(Using handshaking theorem).


Therefore e = 30.

Note:
Note:
In a simple graph with n vertices at least
The undirected graph that results from
ignoring directions of edges is called the two vertices should have same degree.
underlying undirected graph.
Complete graph:
A simple graph with V vertices where every
vertex has an edge with all the other vertices
Previous Years’ Question is known as complete graph. The graph kn,
for n = 1, 2, 3, 4, 5, 6 as shown in the given
The degree sequence of a simple graph figure.
is the sequence of the degrees of the
nodes in the graph in decreasing order.
Which of the following sequences can
not be the degree sequence of any
graph?  [GATE CSE 2010]
I. 7, 6, 5, 4, 4, 3, 2, 1
II. 6, 6, 6, 6, 3, 3, 2, 2
III. 7, 6, 6, 4, 4, 3, 2 ,2
IV. 8, 7, 7, 6, 4, 2, 1, 1
(A) I and II (B) III and IV
(C) IV only (D) II and IV
Solution: (D)

Graph Theory 61
Wheel graph:
Note:
Wheel graph represented by wn, where n is
y A complete graph is a simple graph greater than or equal to four, can be obtained
with maximum number of edges. by adding a vertex to the cycle graph such
y A complete graph is a simple graph that the new vertex is adjacent to all vertices.
with every vertex having maximum
degree.

Properties of complete graph:


y Every complete graph is a regular graph,
but every regular graph need not be
complete.
y A complete graph is a simple graph with
maximum number of edges.
n(n − 1)
y Number of edges in kn =
2
y Degree of each vertex = (n – 1)

Cycle graph:
The cycle graph Cn, for n ≥ 3, is a simple
connected graph with degree of every vertex
as 2.

Note:
Number of edges in Wn = 2(n - 1)

Cyclic graph:
A cyclic graph is a simple graph which
contains atleast one cycle.

Acyclic graph:
Simple graph having no cycle is known as
acyclic graph.

Note:
If a graph is a cycle graph then number of
vertices is equal to number of edges but
not vice versa.

62 Graph Theory
Bipartite graph:
Solution:
The vertex set of the following graph can be
Definition partitioned into two sets, V1 = {a,b,d} and V2
= {c,e,f,g}.
"A simple graph G is called a bipartite
graph if its vertex set V can be partitioned Since, there is no edge between the vertices
into two disjoint sets V1 & V2 such that of same set, so the given graph is bipartite
every edge in the graph connects a graph.
vertex in V, and a vertex in V2 (so that no
edge in G connects either two vertices Note:
in V1 or two vertices in V2). When this
y A simple graph is bipartite if and only
condition holds, we call the pair (V1, V2 )
if it is possible to assign one of two
a bipartition of the vertex set V of G." different colours to each vertex of the
graph so that no two adjacent vertices
Example: are assigned he same colour.
Consider the following cyclic graph C6. The y A graph is bipartite iff it has no odd
length cycle.
vertex set of C6 can be partitioned into two
sets V1 = {1,3,5} and V2 = {2,4,6}, such that
Complete bipartite graph:
there is no edge between vertices of same
The complete bipartite graph Km,n is a graph
set: therefore C6 is a bipartite graph.
in which vertex set V is divided into two
subsets, P having m vertices and Q having n
vertices respectively, such that every vertex
from set P is connected to every other vertex
1 • • 2
in set Q and there is no edge between the
vertices from same subset.
3 • • 4
Example:

5 • • 6

Fig. 3.6 C6 is Bipartite

6. Determine if given graph is bipartite?

Note:
Km, n has (m + n) vertices and m*n edges.

Graph Theory 63
Rack Your Brain

Determine whether the graph is bipartite or not.

Star graph:
Star graph is a special type of graph in which
a single vertex is connected to all the other
vertices.
For a graph having n vertices, n – 1 vertices
will have degree 1 and one vertex will have
degree n – 1.
It is represented as: k(1, n – 1). Connected graph:
y Used in client server architecture. y A graph having V vertices and E edges,
is said to be connected if there is a path
between all the pairs of vertices in the
graph.
y Maximally connected subgraph of a graph
is a component.
y Every connected graph has exactly one
component.
y If G is a simple graph with n vertices, e
edges, and k components.
Hypercube graph/n dimensional cube:
(n − k) (n − k + 1)
In hypercube graph, there is an edge between n−k ≤ e ≤
two vertices only if the vertices differ by 2
single bit position. Examples of connected graph:
y The hypercube graph is represented by Qn.
y Order of hypercube graph O(Qn) = number
of vertices = 2n
y Qn is a n degree regular graph.
y Number of edges in Qn = n × 2n–1 (using
handshaking lemma i.e., in every finite
undirected graph, the number of vertices Fig. 3.6 Connected Graphs
that touch an odd number of edges is
even).

64 Graph Theory
Disconnected graph: Example: Consider a simple graph G having
For a disconnected graph (k > 1 or k ³ 2), 8 vertices and 15 edges. Calculate the number
the path is not available between atleast one of edges in G (|E( G )|).
pair of vertices. Solution:
We have
Examples of disconnected graph:
|E(G)| + |E( G )| = |E(kn)|
n(n − 1) 8 × 7
15 + |E( G )| = = = 28
2 2
|E( G )| = 28 – 15
|E( G )| = 13

Self complementary:
When a graph is isomorphic to its complement
Fig. 3.7 Disconnected Graphs is called self complementary graph.

Note:
y If G is a simple graph with n-vertices

and IEI edges, |E| >


(n-1)(n-2) , then G
2
is connected (sufficient condition)
y in simple connected graph with n
G≅G
n (n-1)
vertices, n − 1 ≤ e ≤
2
Note:
y The number of edges in a self
n ( n − 1)
Rack Your Brain complementary graph is =
2
y The number of vertices in a self
Which of the following graph is always
complementary graph is of the form 4k
connected?
or 4k + 1, k is an any positive integer.
(A) G with 5 vertex and 5 edges
(B) G with 5 vertex and 12 edges New graph from old graph:
(C) G with 5 vertex and 10 edges Sometimes only a part of the graph is
(D) G with 10 vertex and 18 edges needed to solve a problem. In this case, we
can remove some vertices, and all edges
Complement of a graph:
incident on that vertex are removed. This will
The complement of an undirected graph
help in obtaining a smaller graph, called as a
having v vertices is denoted by G , which have
subgraph of the original graph.
the same number of vertices as that of G and
an edge {u, v} ∈ G iff {u, v} Ï G.
Definition
Note:
A subgraph of a graph G (V, E) is a graph
y G ∪ G = kn, where n = number of H (W, F) where, W ⊆ V and F ⊆ E.
vertices. A subgraph H of G is a proper subgraph
y |E(G)| + |E(G)| = |E(kn)| , where n = |v(G)| of G if H ≠ G.

Graph Theory 65
The following graph is subgraph of K5. Union of graphs:
Two or more graphs can be combined in
various ways; the new obtained graph after
combining all the vertices and edges is called
the union of graph(s).

Definition
    The union of two simple graphs G1 = (V1,
E1) and G2 = (V2, E2) is a simple graph
with vertex set V, u V2 and edge set E1 u
E2• The union of G1 and G2 is denoted by
G1 u G2.

Fig. 3.8 Subgraph of K5

Solved Examples

7. Determine the union of the following Representing graphs:


graphs? A graph can be represented in many ways:
y One way to represent a graph without
multiple edges is to list all the edges of
the given graph. Another way is to use an
adjacency list.

Example:

Solution:
The vertex set of G1 ∪ G2 is the
union of the two vertex sets, namely,
{a, b, c, d, e, f}. The edge set of G1 ∪ G2 is the
union of the two edge sets.

Fig. 3.10 A Simple Graph

The adjacency list for the following simple


Fig. 3.9 G1 ∪ G2 graph will be.

66 Graph Theory
Solution:
Initial Vertex Terminal Vertices For the given directed graph, the adjacency
list representation will be as follows:
a b, c, e
Initial Vertex Terminal Vertices
b a
a b, c, d, e
c a, d, e
b b, d
d c, e
c a, c, e
e a, c, d
d
Fig. 3.11 An Adjacency List

Example: Consider the following graph. What e b, c, d


will be its adjacency list representation?
y Another method used for representing
graphs is the adjacency matrix.
For a simple graph whose vertices are
listed as 1, 2, ..., n. The adjacency matrix
A with respect to the listing of vertices is
nxn zero-one matrix.

 1 if {i, j} is anedge of G
aij = 
0 otherwise

Solved Examples

8. Consider the following pseudo graph. Solution:


What will be the adjacency matrix
The adjacency matrix for the following graph
representation of the following graph?
will be:
a b c d
a 0 3 0 2
 
b 3 0 1 1 
c 0 1 1 2
 
d 2 1 2 0

When a graph contains relatively fewer edges,


i.e., when it is sparse, it is preferable to use
an adjacency list rather than an adjacency
matrix to represent a graph.

Graph Theory 67
9. Represent the following graph with an
incidence matrix.
Rack Your Brain

What will be the adjacency list


representation of the following graph?

Solution:
The incidence matrix for above graph is:

Rack Your Brain

What will be the adjacency matrix


representation of the following graph?

Note:
Incidence matrix can also be used to
represent multiple edges and self loops.
Multiple edges are represented in the
incidence matrix using columns with
identical entries. Loops are represented
using a column with exactly one entry
= 1, corresponding to the vertex that is Walk, trail, circuit, path, and cycle:
incident with this loop. Walk:
A walk is an alternative sequence of vertices
and edges, which begins and end with a
vertex. Both edges and vertices can be
repeated in a walk.

68 Graph Theory
Trail: It is also called cycles.
A walk is said to be a trail when there is
no repetition of edges, but vertex can be
repeated.

Closed trail:
A trail starting and ending at the same vertex
is known as a closed trail.
A closed trail is called a circuit.

Path: Walk (u, v) = u – a – b – d – a – b – v


It is a walk in which repetition of vertices Trail (u, v) = u – a – b – d – c – b – v
and edges is not allowed. Circuit (a, a) = a – b – v – c – b – d – a
Path (u, v) = u – a – b – v
Closed path: Closed path (d, d) = d – a – e – b – d
A path that starts at a vertex and ends in the
same vertex is called a closed path.

Graph Repetition of Edge Repetition of Vertex

Walk Allowed Allowed

Trail Not allowed Allowed

Path Not allowed Not allowed

Note:
A cycle is a part of circuit but a circuit
can’t always be a cycle.

Euler graph:
If a graph contains Euler circuit, then it is
known as an Euler graph.
Or
A graph is an Euler graph if it has a closed
trail containing all edges. The above graph has Euler circuit V1 – e1 – V2
– e9 – V8 – e8 – V6 – e11 – V4 – e10 – V2 – e2 –
V3 – e3 – V4 – e4 – V5 – e5 – V6 – e6 – V7 – e7
– V8 – e12 – V1

Graph Theory 69
Solved Examples

10. Which of the following are Euler graph?


Note:
y Euler circuits are also applicable
to the graph with loops (unless it
is a loop in a component with one
vertex).
y Euler circuits are also applicable
Solution: to the Multigraph.
Graph G1 has an Euler circuit (a – e – d –
c – e – b – a), i.e., there is a closed trail
that covers all the edges. Therefore, it Result:
is an Euler graph. But G2 and G3 do not A graph is an Euler graph if and only if it is
contain Euler circuit. So G2 an G3 are not connected and ∀ V ∈ G, degree (V) is even.
Euler graph.

Rack Your Brain

Determine whether the given graph is


Euler graph?

The given graph is a Hamiltonian graph


because of Hamiltonian cycle
V1 – V5 – V6 – V8 – V7 – V4 – V3 – V2 – V1.

Hamiltonian graph: Sufficient condition for hamiltonian graph:


A graph is said to be a Hamiltonian graph, if DIRAC’s theorem:
it contains a Hamiltonian cycle. A simple connected graph G having ‘v’
Hamiltonian cycle, in a connected graph, is a vertices (v ³ 3), is said to have a Hamiltonian
cycle that covers all the vertices. cycle if the minimum degree of every vertex
If any edge is removed from the Hamiltonian in the graph is n/2.
cycle, then it gets converted into Hamiltonian
path. ORE’s theorem:
If G is a simple connected graph with n
vertices (n ³ 3), such that deg(u) + deg(v) ³ n
for every pair of non-adjacent vertices u and
v in G, then G has a Hamiltonian cycle.

70 Graph Theory
Solved Examples

11. Which of the following simple graphs Solution:


have a Hamiltonian cycle or Hamiltonian
G1 has a Hamiltonian cycle (a – b – c – d –
path?
e – a). There is no Hamiltonian cycle in G2
but G2 has a Hamiltonian path (a – b – c –
d). G3, neither has a Hamiltonian cycle nor a
Hamiltonian path because edges {a – b}, {e
– f}, and {e – d} are covered more than one
time.

Example:

Rack Your Brain

Determine whether the following graph is


Hamiltonian graph?

The given graph G is a planar graph because


in planar representation, no edges intersect
each other.

Euler’s formula:
As we have already seen, a planar graph
splits the plane into regions, including an
Planar graph:
unbounded region. According to Euler, for any
y A graph having a planar representation is
simple connected graph having ‘V’ vertices
called a planar graph.
and ‘e’ edges, the number of regions ‘r’ in the
y Planar representation means drawing a planar representation of graph is given by:
graph on a plane without crossing the V–e+r=2
edges.
y The planar representation of a planar
graph divides the entire plane into regions
or faces.

Definition Fig. 3.12 The Regions of Planar Representation


of Graph
"A graph is called planar, if it can be
Results for planar graph:
drawn on the plane without any edges
Minimum degree for region k
crossing (where a crossing of edges
y V–e+r=2
is the intersection of the Lines or arcs
y kr ≤ 2e
representing them at a point other
than their common end point). Such a y e ≤ k (V − 2)
drawing is called planar representation k−2
of a graph."

Graph Theory 71
Polyhedral graph:
A planar graph in which every interior region Rack Your Brain
is polygon is called polyhedral graph.
y In a polyhedral graph degree of every Determine which of the following graphs
vertex, i.e., deg(V) ³ 3 ∀ V ∈ G are planar?
y For a polyhedral graph, the following
inequality must hold:
| V – e + r = 2

| 3r ≤ 2e

| e ≤ 3V – 6

Previous Years’ Question

Let G be a connected planar graph with


10 vertices. If the number of edges on
each face is three, then the number of
edges in G is  [2015 Set 1]
Solution: 24

Note:
y K5 is a non planar graph with minimum number of vertices.
y K3.3 is non planar graph with minimum number of edges.

Solved Examples

12. Which of the following graphs are planar?

G2 is also planar because it can also be drawn


without any edge crossings.

Solution:
G1 is planar because it can be represented
without edge crossings.

72 Graph Theory
13. Suppose that a connected planar Tree can be defined as a minimally connected
simple graph has 10 vertices, each of acyclic graph.
degree 3. Into how many regions does a For every (u, v), there exists exactly one
representation of this planar graph split path between u and v or it is a 1-connected
the plane? graph.
Solution: Every tree is bi-chromatic and bipartite.
Using Handshaking theorem, S degree (V) = 2
× number of edges Fundamental cycle:
A cycle obtained by adding a single edge is
3 * 10 = 2 × e
called a fundamental cycle.
e = 15
Now, number of fundamental cycles = nc2
From Euler’s formula the number of region
when n = number of vertices.
is
r=e–v+2
Rooted tree:
r = 15 – 10 + 2
A tree with a specific vertex is chosen as a
r=7
root.
Kuratowski’s theorem:
“If a graph is planar, so will be any graph
obtained by removing an edge {u, v} and
adding a new vertex w together with edges
{u, w} and {w, u}. Such an operation is called
an elementary subdivision. The graphs G1 =
(V1, E1), G2 = (V2, E2) are called homeomorphic
if they can be obtained from the same graph
by a sequence of elementary subdivision.” Root, siblings (having a common parent), leaf
node can be only defined for a rooted tree.
A graph is planar if it does not contain any
graph homeomorphic to K5 or K3,3. depth (u) = distance (u, root), where u is node
height (T) = Maximum of depth (u), where u
is node and T is a tree
level (u) = 1 + depth (u)
Rack Your Brain
OR
Determine whether the given graph is level (T) = 1 + height (T), where u is node and
homeomorphic to K3, 3. T is a tree
K-ary tree:
It is a rooted tree.
0 ≤ number of children (u) ≤ k

Trees:
Basically, this is the topic of data structure
and algorithms but here, we will study this
topic in terms of Discrete Mathematics.

Graph Theory 73
Full k-ary tree: kh+ 1 − 1
y It is a rooted tree. 2. n ≤
k−1
y Number of children (u) = 0 or k h
k −1
3. i ≤
k−1
For minimum number:
1. n ³ h + 1
2. i ³ h
3. log kl ≤ h

Spanning tree:
A spanning tree of G is a subgraph of G which
Complete k-ary tree: includes every vertex of G.
y It is a rooted tree.
y All levels except the last one are Note:
completely filled. Every connected graph has a spanning
y Last level is left adjusted. tree.

Left adjusted: Example:


When we start filling from left to right, then
it is called left adjusted.

Solution:

Note: Possible spanning trees:

Complete k-ary tree does not implies a


full k-ary tree and vice versa.

Properties of k-ary tree:


Considering, l = number of leaves
n = Number of nodes
h = Height of tree
i = Number of internal nodes
For maximum number:
1. l ≤ kh

Circuit rank: The circuit rank of any given


graph can be defined as the number of
edges that are required to remove in order
to obtain a spanning tree that is equal to [m-
(n-1)], where m is the number of edges, and
n equals to the number of vertices.

74 Graph Theory
Example: Number of spanning trees in a complete
graph
= nn–2 (Cayley’s formula)
= 16

Kirchoff’s theorem:
Circuit rank (G) = m – (n – 1) For a connected graph G, let A be its adjacency
=4 matrix representation.
Consider a matrix M obtained by replacing all
Example: For the given graph, calculate the 1’s in matrix A with -1 and all 0’s in principle
total number of spanning trees possible. diagonal of matrix A with the degree of the
corresponding vertex.
Cofactor of any element of M is equal to the
number of spanning trees in G.

Example: Consider the following matrix


(A) 6 representation of a graph. Calculate the
(B) 12 number of possible spanning trees for the
(C) 8 graph.
(D) 16
Solution:

2 −1 −1 will be needed to colours all the vertices of


Cofactor of M11 = (–1)1+1 −1 3 −1 the graph such that no two vertices have the
−1 −1 3
same colour. It is denoted as l(G)
y l(G) = 1 if G is a null graph
= 2(9 – 1) + 1(–3–1) – 1(1 + 3) y If G is not a null graph, then l(G) ³ 2
= 16 – 4 – 4 = 8 y A graph G is said to be n-colourable, if
there exists a vertex colouring that uses
Graph colouring:
atmost n colours, i.e., l(G) ≤ n
Vertex colouring: In vertex colouring, every
vertex of the graph is given a colour such Four colour theorem:
that the vertices adjacent to each other Every planar graph G is 4-colourable, i.e.,
must have different colours. l(G) ≤ 4.

Chromatic number: Chromatic number is a


number that tell minimum how many colours

Graph Theory 75
Welsh-Powell algorithm:

Example: Consider the following graph, what Further, we have 4 mutually adjacent vertices
will be its chromatic number? {b, c, d, e}
\ l(G) = 4 ... (ii)
From (i) and (ii)
l(G) = 4

Connectivity:
Vertex connectivity:
In a connected graph G, the minimum
(A) 2 number of vertices whose deletion makes
graph disconnected or reduces G into a
(B) 3
trivial graph is called vertex connectivity of a
(C) 4 connected graph G. It is denoted by k(G)
(D) 5 y If G has a cut vertex, then k(G) = 1

Answer: (C) Edge connectivity:


Solution: y In a connected graph G, the minimum
number of edges whose deletion makes
Vertex a b c d e
the graph disconnected is called edge
Color C1 C2 C3 C1 C4
connectivity of G.
As the graph is planar, we will apply four- It is denoted by l(G).
colour theorem chromatic number y If G has a cut edge, then edge connectivity
l(G) ≤ 4 ... (i) l(G) = 1 (also known as bridge).

76 Graph Theory
y The number of edges in the smallest cut Cut set:
set of G is said to be edge connectivity of It is the minimum set of edges whose removal
G. will disconnect the graph.
Example: For complete graph kn
Vertex connectivity of kn = n – 1 Matching and covering:
Edge connectivity of kn = n – 1 y Matching: If every vertex of given graph G
is incident with at the most one vertex,
i.e., deg(V) £ 1, then that subgraph is called
matching of the given graph.

In a matching, no two edges are adjacent, so y Kn has a perfect matching iff n is even.
deg(V) ≤ 1
y Maximal matching: If in any matching
M of graph G, further no more edges can Previous Years’ Questions
be included then M is said to be maximal
matching. How many perfect matching are there in
M1 and M2 are the maximal matching of G a complete graph of 6 vertices?
in the above example.  [GATE CSE 2003]
y Maximum matching: For any matching M (A) 15
of Graph G, if M consists of the maximum (B) 24
number of edges. (C) 30
y Matching number: It is the number of edges (D) 60
included in a maximum matching of G. Solution: (A)
Matching number of M1 = 2
y Perfect matching: A matching of a graph Covering:
in which every vertex is matched is called Line covering:
perfect matching. A subset S(E), of graph G(V, E), will be a
Example: What is the matching number of line covering of G if all the vertices of G will
star graph with n vertices (n ³ 2) is: incident with a minimum one edge in S, i.e.,
degree of each vertex will be atleast 1.

Solution: 1
d c d c d c d c d c

a b a b a b a b a b
G C1 C2 C3 C4

Graph Theory 77
If, in any case, graph G has an isolated vertex, Maximum independent line set: The largest
line covering will not exist. maximal independent line set L of graph G
which contains a maximum number of edges,
is known as the maximum independent line
set.
y Number of edges present in the maximum
independent line set of a graph is known
G as the line independent number of G. It is
Minimal line covering: Line covering is denoted by b1
minimal if the deletion of any edge from the y Line independent number = matching
line cover is not possible. number of G1
For the graph in above example L3 is a
Minimum line covering: maximum independent line set and b1 = 3.
y The number of edges present in minimum
y For any graph G1 α 1 + β1 =| V | where a1 is
line covering is called the line covering
number of a graph G = a1 the line covering number.
The graph above example has a1 = 2.
(C1 graph is minimum line covering). Vertex covering: Let G = (V, E) be graph then
y Line covering of graph with n vertices a subset k of V is called a vertex covering of
G, if every edge of G is incident with a vertex
contains atleast n edges. in k.
2
y No minimal line covering contains a cycle.
y In a line covering, if there is no path of
length 3 or more, then C is minimal.
y In the line covering, if there are no paths
of length 3 or more, then all components
of C are star graphs. Then from those star
graphs, no edge can be deleted.

Independent line set:


Let, G = (V, E) be a graph, then a subset L of
E is called an independent line set if no two
k1 = {b, d}
edges in L are adjacent.
k2 = {a, b, c}
k3 = {b, c, d}

Minimal vertex covering: The vertex covering


k is said to be minimal vertex covering if no
vertex can be eliminated from it.
k1 and k2 are minimal vertex covering.
L1 = {b, d}
Minimum vertex covering: The minimum
L2 = {(b, d), (e, f)}
number of vertices in the vertex covering of
L3 = {(a, d), (b, c), (e, f)}
a graph is called minimum vertex covering.
L4 = {(a, b), (e, f)}
y The vertex covering a number of graph
Maximal independent line set: For a graph G G is denoted by a2, which is defined as
having an independent line set L, if no more the total number of vertices present in
edges of G can be included in L, then L is minimum vertex covering.
said to be a maximal independent line set. In the above graph G for k, a2 = 2

78 Graph Theory
Independent vertex set: Example: For the star graph with n
Let G = (V, E) be a graph, then the subset S vertices (n ³ 2).
of V is called an independent set if no two Solution: a2 = 1
vertices in S are adjacent. b2 = n – 1
a2 + b2 = n

Example: For the cycle graph Cn (n ³ 3)


Solution: a2 = n/2
b2 = n/2

S1 = {b} Example: Wheel graph wn (n ³ G).


S2 = {d, e} Solution: α2 =n + 1
S3 = {a, c} 2
n−1
Maximal independent vertex set: An β2 =
2
independent vertex set is said to be maximal,
if no other vertex of G can be added to the
set.
Example: S1 = {b} Rack Your Brain
S2 = {d, e}
S3 = {a, c, e} Find the chromatic number of the given
graph.
Maximum independent vertex set:
y Vertex independent number tells total
how many vertices are there in the
maximal independent vertex set. Vertex
independent number of G denoted by b2.

Example: S3 = {a, c, e}
\ b2 = 3 Shortest path algorithms:
y For any graph a2 + b2 = |v| In order to find the shortest path between
y For any graph if S is independent set any two vertices in a graph, Dijkstra algorithm
of G then V – S = A vertex covering is used.
of G.

Graph Theory 79
Solved Examples

14. Use Dijkstra's algorithm to find the VI)


length of the shortest path between
the vertices a and z in a weighted graph
given below:

Solution:

VII)
I)

The algorithm terminates at step (VII) when


z is circled.
Therefore, the shortest path from a to z is
II)
a, c, b, d, e, z with length 13.
y The travelling salesman problem requires a
circuit in a weighted, complete, undirected
graph that visits each vertex exactly once
and returns to its starting place with the
least total weight. Because each vertex is
visited exactly once in the circuit, this is
III) equal to requesting a Hamiltonian circuit
with the lowest total weight in the whole
graph.

Rack Your Brain

IV) Find the shortest path between a and z in


the given weighted graph.

V)

80 Graph Theory
Grey Matter Alert!
Previous Years’ Questions
Floyd Warshell’s Algorithm
Let G = (V, G) be a weighted undirected
This algorithm can also be used to find
graph and Let T be a Minimum Spanning
the length of the shortest path between
Tree (MST) of G maintained using
all pairs of vertices in a weighted
adjacency Lists. Suppose a new weighed
connected simple graph. However, this
edge (u, v) E VxV is added to G. The worst
algorithm cannot be used to construct
case time complexity of determining if
shortest paths.
Tis still an MST of the resultant graph is:
 [GATE CSE 2020]
(A) Θ(|E| + |V|)
(B) Θ(|E|.|V|)
Previous Years’ Questions
(C) Θ(|E| Log |V|)
(D) Θ(|V|)
Let G be a finite group on 84 elements. Solution: (D)
The size of a largest possible proper sub-
group of G is _______. [GATE CSE 2018]
Solution: 42

Previous Years’ Questions

Let G be an undirected complete graph


on n vertices, where n > 2. Then, the
number of different Hamiltonian cycles
in G is equal to:  [GATE CSE 2019]
(A) n!
(B) 1
(C) (n - 1)!

(D)
 n  1 !
2
Solution: (D)

Graph Theory 81
Chapter Summary

y An undirected graph G = (V,E) consists of V, a non-empty set of vertices (or nodes) and
E, a set of edges, and every edge is associated with unordered pair of vertices.
y Types of graphs.

y Adjacent vertices: If two vertices have an edge in between.


y Adjacent Edges: If two edges have common vertices in between.
y A vertex with 0 edges is called the isolated vertex.
y A vertex with one edge is called a pendant vertex.
y A complete graph is a simple graph with a maximum number of edges possible.
n(n − 1)
|E | in Kn =
2

Graph Multiple Edges Loops

Simple  

Multigraph  

Pseudo graph  

82 Graph Theory
y If G is a simple graph G ∪ G =
Kn
y Isomorphic graphs must have:
| Same number of vertices.

| Same number of edges.

| Same degrees of corresponding vertices.

y If closed trail, every edge is coverable



Euler circuit

Euler graph
y If closed path, every vertex is coverable

Hamiltonian cycle

Hamiltonian Graph
y K5 and K3, 3 are known as Kuratowski’s two graphs. These two graphs are special since,
K5 is a non–planar graph with minimum number of vertices and K3, 3 is the non–planar
graph with minimum number of edges.
y Every tree with 2 or more vertices is 2-chromatic.
y Every bipartite graph is 2 colourable and vice versa.

y Cut vertex: V3
y Bridge: e4
y Vertex Cut Set: {V3}, {V3, V1}, {V3, V2}
y Edge Cut Set: {e1, e3}, {e1, e2}, {e4}, {e1, e2, e3, e4}

Graph Theory 83

You might also like