Graph Theory
Graph Theory
Slours in
Ugraphical
4.1 Definition: different colounng
colouring of thecan befour Connect
different
a
to thecommunication area of
this
1) Nodes: Every frequencies ot
for
used to
regiGMS frequency
ons. Hence,colcolour
anyregions.
GSM
network by tower which
searching
known as nodes orgraph consists of set of
co
the
the anges,
cellular
it is
clear
vertices. mobile vertex
phone network.
colous regiorions. Theseby four
ouring algorithm
the
1
Graph G
edge
20 >03
Graph H
Discrete Mathematics and
Graph Thepr
represented by unorde
heory
elements of E are
red pairs e
5) Undirected Graph: Let G(V, E) be a graph. If the ich every
in which edge
vertices of G, then G is called an undirer
called undirected graph. The above three graphs (i), (i),
graph. In
(ii) a
other words graph
are
u n d i r e c t e d graphs
undirected
the elements of E a r e represented by ordered
(6) Directed Graph: graph. If
Let G (V, E)
vertices of G, then G is called a
be
directed
a
graph. Following
are the examples
of directed
graphs digraphs,
(or dP
graphs (or
(1)
of
nples
a mixed graph.
b
3
Here node 1 has one loop, node 3 has 2 loops and node 2 does not have a loop.
9) Parallel or multi-edges: 1f Two or more edges of a graph have same vertices then such
edges are called Parallel or multi-edges.
(10) Adjacent nodes: Two nodes that are connected by an edge are called
adjacent.
(11) Isolated node: In a
graph a node that is not adjacent to another node is called isolated
node.
Simple
Tet
G
Graph: Let G
=
(V, E) be a graph. Then G
edge between any
one is said to be
hereisph without multiple
ThusGra
ere is exactly
given pair of vertices. a simple graph if () G has no
edge (parallel egdes) and loops
x loop is called
Forexample (i) (i) N are simple graphs. simple graph.
(a, b)
is a parallel edge. Also (a, d) is a parallel
Here
graph.
es, In mutli graph no loops are allowed, Then Gis said to be a multi
graph if it has some
parallel
For example (i) -are multi graphs.
O-
W
2
X 2
A vertex whose
indegreeis zero is called a source and a vertex whose
outdegree is zero is called a sink.
Degree of a vertex in an undirected
Let G (V, E) is
Graph:
undirected graph. Then the number of
an
counted twice is called the edges incident with a vertex v with self loops
For
degree of the vertex v.
example consider the graph.
P
Graph Theory
Vertex
Degree
P 3
S
2
A Vvertex whose degree is zero is
called
pendant vertex.
an isolated vertex. A vertex whose
degree is one is called a
Note:
1 In digraph, loop contributes 1 to indegree and 1 to
a a
Sum of all indegree of all nodes (or all outdegree of the vertex.
3. In case of undirected graph the total oudegree of all
nodes) gives the total number
degree of node is of edges in graph a
v
equal to number of edges incident with v.
Handshaking Theorem:
IfG= (V, E) is
undirected graph with
an
i.e. the sum ofdegrees of the vertices in an edges, then 2vEv deg(v)= 2e
Proof: We know that the degree of vertex in an undirected graph is even.
Number of edges incident with it, hence the sum undirected graph is the
of the
Total number of times an edge is
incident with a vertex.
degree counts the
Now since every edge is incident
with exactly two
vertices, each edge gets counted twice.
Sum of degrees =2 number of x
edges.
i.e.
2vevdeg(v) =
2e
4.3 Matrix
Representation
of
By representing graphs by the means of Graphs:
matrices, we can study the structural
algebraic point of view. There are various of
properties of graph from
following ways. ways representing graphs by matrices. We study the
Adjancency Matrix:
i) Representation of Undirected Graph:
Let G (V, E) be a
simple graph withn vertices. Then ann x n matrix
A- [aijl
1 if there is a n edge from ith to jth node
Where jLo otherwise
Is called the
adjancency matrix. Hence adjacency matrix is a bit matrix
are either 0 or 1. or a Boolean matrix as the elements
(i)
V20 0 1 0
'31 1 0 1
0 1 0 are five
e r e we order the vertices as a, b, c, d, e. Since there
matri
will be a square
ertices, the adjacency matrix representing the graph
is
of order 5 (5 x 5 matrix). The required adjacency matrix
ab c d e
as0 1 1 101
b1 0 0 11|
Cl0 0 0 11
d 1 1 1 01
elo 1 1 10
ii) Here we order the vertices as v1, v2, v3, v4, v5. Since there
are
TIve vertices the adjacency matrix representing the graph will be a square
V0 1 1 0 0
2 1 0 1 0
10 1
o 0 1 0
V'sl0 10 1
A-lai
(1 ifthere is a directed edge from ith to jth node
Where a lo
Where a: =
otherwise
Example (2): Write the adjacency matrix for the graph given below. Also find in-degree and out-degreet
each vertex.
U4
U3
U2
Solution:
u0 1 1 1
U2 |1 0 1 0
M 00 1
u 1 00 0
Nodes Indegree
U2
2 Outdegree
u3
u4
| Total
Here Indegree=Outdegree=
Number of edges
4.4. Isomorphism of
Two Graph G1=(V1,E1) and
graphs or Isomorphic Graphs:
a
G2=(V2E2) said be if
are to
isomorphic there exist one-one
between nodes of the two
graphs which preserves correspondence
edges If any. the adjacency of the nodes as well as
direction of the
Or
Let G1 (V1, E1) and G2 (V2, E2) be=
two
exists a function f: V1 -V2 such that
any graphs. Then G1 and G2 are said to be isomorphic if there
(i) fis one - one and onto
2 Or
p3
Graph A Graph BB
Graph
NodesIndegree Outdegree Graph Nodes Indegree Outdegree
B 1
A
2
155 11
n Graph Theury
Discrete Mathematics and Gr.
Total 4
Total and
correspondence
between the node
Let O be to Graph B
a mapping from graphA
Isgiven by1uz, 2u,3+U4,4°U2
oy
corresspondence between the edges given
is
G(A)2G(B)
Example (4): Show that following digraphs are isomorphic
OV3
4
V's
1
Graph A Graph B
B=5
Solution: Number of nodes in graph A= Number of nodes in graph
B=8
Number of edges in graph A= Number of edges in graph
isgiven by
(VV)a,l). (v,,i
(,Patu
us,u).
ist one
As there exist one to one o
to one
the nodes
as well a
the correspondence
direction of a between the nodes of
edges. two
graph whichch
.G(AJG(B) preserves the adjacency otof
preserves
adjacency
(Sl: Draw
Example (5): Dr
diagraphs corresponding to
0 11 1 adjacency matrices A, B, AT, BT
1 01 O 11 1 where
A=
0 10 oand B =
|1 00
lo 11 ol 0 10 1
10 0
Show that diagraphs
corresponding to AT and BT are
isomorphic.
Solution: AT= 01 1 0 10 1
101
110 1 and BT= 1 00 o
100 01 o
Number of nodes in graph AT= Number of
nodes in graph BT4
Number of edges in graph Af= Number of
edges in graph Br=7
U4
b d
Graph A Graph B
Graph AT Graph B
Discrete M tics ana Graph
d 2 7
Total Total
DE a mappingfrom graph A' to Graph B and correspondence betwear
een
the nodes is given bya++Ug , beu. Ceu dUs
V2 V5
l 0e-
V3
Graph A Graph B
Solution: Number of nodes in
graph A= Number of nodes in
Number of edges in
graph A= Number of edges in
graph B=6
B=-9 graph
Nodes
Indegree Outdegree Nodes
u2
0 3
V
Outdegree Indegree
Graph U3 V2
A U4 Graph B V3
U5 V4
V5
Total V6
Total
9