01 Graph Theory - Types of Graphs
01 Graph Theory - Types of Graphs
There are various various types of graphs depending depending upon the number of vertices, vertices,
number of edges, interconnectivity, and their overall structure. We will discuss only a certain few important
types of graphs in this chapter.
Null Graph
Example
In the above graph, there are three vertices vertices named ‘a’, ‘b’, and ‘c’, but there are no edges among
them. Hence it is a Null Graph.
Trivial Graph
Example
In the above shown graph, there is only one vertex ‘a’ with no other edges. Hence it is a Trivial graph.
Non-Directed Graph
A non-directed graph contains edges but the edges are not directed ones.
Example
In this graph, ‘a’, ‘b’, ‘c’, ‘d’, ‘e’, ‘f’, ‘g’ are the vertices, vertices, and ‘ab’, ‘bc’, ‘cd’, ‘da’, ‘ag’, ‘gf’, ‘ef’ are the
edges of the graph. Since it is a non-directed non-directed graph, the edges ‘ab’ and ‘ba’ are same.
Similarly Similarly other edges also considered in the same way.
Directed Graph
Example
In the above graph, we have seven vertices vertices ‘a’, ‘b’, ‘c’, ‘d’, ‘e’, ‘f’, and ‘g’, and eight edges ‘ab’,
‘cb’, ‘dc’, ‘ad’, ‘ec’, ‘fe’, ‘gf’, and ‘ga’. As it is a directed directed graph, each edge bears an arrow mark that
shows its direction. Note that in a directed graph, ‘ab’ is different from ‘ba’.
Simple Graph
A graph with no loops and no parallel edges is called a simple graph.
n n
2 2
The maximum number of edges possible in a single graph with ‘n’ vertices is C where C = n(n –
1)/2.
cn2 n(n-1)/2
The number of simple graphs possible with ‘n’ vertices = 2 = 2 .
Example
In the following following graph, there are 3 vertices vertices with 3 edges which is maximum maximum
excluding excluding the parallel parallel edges and loops. This can be proved by using the above
formulae.
n
2
C == nn((nn––11))//22
== 33((33––11))//22
== 66//22
== 33 eeddggeess
Cn2 nn((nn--11))//22
2 = 2
33((33--11))//22
== 22
3
== 22
== 88
A graph G is said to be connected connected if there exists a path between between every pair of
vertices vertices. There should be at least one edge for every vertex in the graph. So that we can say
that it is connected connected to some other vertex at the other side of the edge.
Example
In the following following graph, each vertex has its own edge connected connected to other edge. Hence
it is a connected connected graph.
Disconnected Graph
A graph G is disconnected, if it does not contain at least two connected vertices.
Example 1
The following following graph is an example example of a Disconnected Disconnected Graph, where there
are two components, components, one with ‘a’, ‘b’, ‘c’, ‘d’ vertices and another with ‘e’, ’f’, ‘g’, ‘h’ vertices.
The two componen components are independent independent and not connected connected to each
other. Hence it is called disconnected disconnected graph.
Example 2
In this example, example, there are two independent independent components, components, a-b-f-e
a-b-f-e and c-d, which are not connected connected to each other. Hence this is a disconnected graph.
Regular Graph
A graph G is said to be regular regular, if all its vertices vertices have the same degree. In a graph, if
the degree of each vertex is ‘k’, then the graph is called a ‘k-regular graph’.
Example
In the following graphs, all the vertices have the same degree. So these graphs are called regular
graphs.
In both the graphs, all the vertices have degree 2. They are called 2-Regular Graphs.
Complete Graph
A simple graph with ‘n’ mutual vertices vertices is called a complete complete graph and it is denoted by
‘K ’. In the graph,
n
a vertex should have edges with all other vertices, then it called a complete graph. In other words, if
a vertex is connected to all other vertices in a graph, then it is called a complete graph.
Example
In the following following graphs, each vertex in the graph is connected connected with all the remaining
remaining vertices vertices in the graph except by itself.
In graph I,
a b c
Cycle Graph
A simple graph with ‘n’ vertices vertices (n >= 3) and ‘n’ edges is called a cycle graph if all its edges form a
cycle of length ‘n’.
If the degree of each vertex in the graph is two, then it is called a Cycle Graph.
Notation − C
n
Example
Wheel Graph
A wheel graph is obtained obtained from a cycle graph C by adding a new vertex. vertex. That new vertex
is called a
n-1
Hub which is connected to all the vertices of C .
n
Notation − W
n
NNoo.. ooff eeddggeess iinn WW == NNoo.. ooff eeddggeess ffrroomm hhuubb ttoo aallll ootthheerr
vveerrttiicceess ++
n
NNoo.. ooff eeddggeess ffrroomm aallll ootthheerr nnooddeess iinn ccyyccllee
ggrraapphh wwiitthhoouutt aa hhuubb..
== ((nn––11)) ++ ((nn––11))
== 22((nn––11))
Example
Take a look at the following graphs. They are all wheel graphs.
In graph I, it is
obtained from C by adding an vertex at the middle named as ‘d’. It is denoted as W . 3 4
In graph II, it is obtained from C by adding a vertex at the middle named as ‘t’. It is denoted as W .
45
In graph III, it is obtained from C by adding a vertex at the middle named as ‘o’. It is denoted as W .
67
Cyclic Graph
Example
In the above example graph, we have two cycles a-b-c-d-a and c-f-g-e-c. Hence it is called a cyclic graph.
Acyclic Graph
Example
In the above example graph, we do not have any cycles. Hence it is a non-cyclic graph.
Bipartite Graph
A simple graph G = (V, E) with vertex partition partition V = {V , V } is called a bipartite bipartite graph if
every edge of E
12
joins a vertex in V to a vertex in V .
12
In general, a Bipertite graph has two sets of vertices, vertices, let us say, V and V , and if an edge is drawn,
it
12
should connect any vertex in set V to any vertex in set V .
12
Example
In this graph, you can observe observe two sets of vertices vertices − V and V . Here, two edges named
‘ae’ and ‘bd’ are
12
connecting the vertices of two sets V and V
1 2.
A bipartite bipartite graph ‘G’, G = (V, E) with partition partition V = {V , V } is said to be a complete bipartite
bipartite graph if every
12
vertex in V is connected to every vertex of V .
12
In general, a complete bipartite graph connects each vertex from set V to each vertex from set V .
12
Example
The following following graph is a complete complete bipartite bipartite graph because because it has
edges connecting connecting each vertex from set V to each vertex from set V .
12
K7, 3=21
K8, 2=16
K9, 1=9
22
n 9
If n=9, k5, 4 = ⌊ 4⌋ = ⌊ 4⌋ = 20
Similarly K6, 3=18
K7, 2=14
K8, 1=8
‘G’ is a bipartite graph if ‘G’ has no cycles of odd length. A special case of bipartite graph is a star graph.
Star Graph
A complete omplete bipartite bipartite graph of the form K is a star graph with n-vertices. n-vertices. A star
graph is a complete complete
1, n-1
bipartite graph if a single vertex belongs to one set and all the remaining vertices belong to the other
set. Example
In the above graphs, graphs, out of ‘n’ vertices, vertices, all the ‘n–1’ vertices vertices are connected
connected to a single vertex. vertex. Hence it is in the form of K which are star graphs.
1, n-1
Complement of a Graph
Let 'G−' be a simple graph with some vertices vertices as that of ‘G’ and an edge {U, V} is present in 'G−',
if the edge is not present present in G. It means, two vertices vertices are adjacent adjacent in 'G−' if the
two vertices vertices are not adjacent adjacent in G.
If the edges that exist in graph I are absent in another another graph II, and if both graph I and graph II are
combined combined together together to form a complete complete graph, then graph I and graph II are
called complements complements of each other.
Example
In the following example, graph-I has two edges ‘cd’ and ‘bd’. Its complement graph-II has four
edges.
Note that the edges in graph-I graph-I are not present present in graph-II graph-II and vice versa. Hence,
the combination combination of both the graphs gives a complete graph of ‘n’ vertices.
Example
Let ‘G’ be a simple graph with nine vertices and twelve edges, find the number of edges in
'G-'. You have, |E(G)| + |E('G-')| = |E(K )|
n
12 + |E('G-')| =
9
2
9(9-1) / 2 = C
12 + |E('G-')| = 36
|E('G-')| = 24
‘G’ is a simple graph with 40 edges and its complement complement 'G−' has 38 edges. Find the number
of vertices vertices in the graph G or 'G−'.
40 + 38 = n(n-1)
2
156 = n(n-1)
13(12) = n(n-1)
n = 13