0% found this document useful (0 votes)
56 views10 pages

Graph Theory

This document defines and provides examples of key concepts in graph theory: 1) A graph G consists of a set of nodes V and a set of edges E that connect the nodes. Nodes are also called vertices. 2) An edge is a line that connects two nodes. 3) A subgraph H is a subset of nodes V' and edges E' from a larger graph G. 4) An undirected graph is one where the edges connect nodes regardless of direction. The examples provided are all undirected graphs.

Uploaded by

Gunjan
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)
56 views10 pages

Graph Theory

This document defines and provides examples of key concepts in graph theory: 1) A graph G consists of a set of nodes V and a set of edges E that connect the nodes. Nodes are also called vertices. 2) An edge is a line that connects two nodes. 3) A subgraph H is a subset of nodes V' and edges E' from a larger graph G. 4) An undirected graph is one where the edges connect nodes regardless of direction. The examples provided are all undirected graphs.

Uploaded by

Gunjan
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/ 10

Ur Per as

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

12) Edge: Nodes are points which may be


4 connected by lines are
shown by
small dots
-- node (arc) called as or
small circles
edge.
20
--edge
3

1
Graph G

() Graph: A graph G=(V, E,


¢) is a
verertices or
s

points)and set of edged mathematical


or points)and
with structure
ordered or
unorderedG. pair of nodes. Sometimeassociation an
consisting of non-empty
apping from setmpty
or
G (V, E) simply
or mapping
graph is denoted of
of nodes
set of

In other words, A graph by edges to set edges set off

vertices or points and E is the (V,E) consists of aa


G (V,E) is
set of
edges whose non-empty set V,
elements are pairs of whose elements
a
graph where V =set of
vertices or nodes elements ofV.
are called nodes or
or points
E-set of edges.
Following are some of the examples of
graph.
)
Note: If (u, v) is an edge in a graph G (V, E), then u =
and v are said to be adjacent nodes.

4) Sub-graph: Let V' be


subset ofV and E' be a subset of E whose end vertices
a
belongs to V then H=
(,E)is called a sub graph of the graph G= (V, E).
4
-> node

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)

The is an ordered pair


where u is called the initial node bde (or vertex)
edge (u, v) of a diagraph G= (V, E) and
v is called the terminal node (or vertex).
if t 1s neither
digraph nonor n a
A graph G (V, E) is said to be a mixed graph
ixedgraph.
ancdirected
Graph:
(Some edges are directed and
=

some are undirected) Following are the exa

of
nples
a mixed graph.
b

v to itself is called a loop. ie.


(S Loop: Let G (V, E) bè a graph. An edge of G, which joins a node
= an
with just one end point is called a loop. An edge that is not a loop is called a proper edge.

For example consider the


graph.

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.

Here x is an isolated node


(12) Null or Void Graph:
Let G (V, E) bé a graph. If the sët of edges E is
empty, then the
graph. In ofthet words, graph which containis only isolated node is graph
G is said to be null
graph or vold
called null graph.

150 Altahce &Co


GraphTheory

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

paralleledges edge. But (d, c) and


b,c) arenot

14) Multi graph:


- graph: Let G= (V, E) be a
-

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.

(1 Weighted Graph: Let G= (V, E) be graph. If every edge in G is


a
to be a weighted graph. assigned some weight, then G is said

are weighted graphs.

(16) Finite Graph: Let G =


(V, E) be a graph. Then G is said to be finite if both the sets V and E are finite.
Otherwise it is said to be an infinite
graph.
For example consider the graphs.

1 This is a finite graph.

(i) This is an infinite graph.

and multiple edges are allowed is said to be a pseudo graph.


(17) Pseudo Graph: A graph in which loops

For example is a pseudo graph

A simple graph is said to be complete


if every node is adjacent to all other nodes of the
(18) Complete graph:
graph.
Allianre &Co.
151
Discrete Mathematic
and GraphThegn

O-

4.2 Incidence and


Degree: is an edge incident on u and v,
Let G(V, E) be an undirected graph. Then the ordered pair (u,v)
For example
Let G (V, E) be a digraph Then the ordered pair (u, v) is an edge and is said to be incider
dent from u and
be incident to v.
For example

Indegree and out degree of a Digraph:


Let G .(V, E) digraph. Then the number of edges ending at a vertex v is called the
be a he indepT
of v. indegree
the number of edges called the outdegree of
milarly
Sum of
beginning at a vertex v is v.

indegree and outdegree of a node is called total degree.


For example consider the graph.

Vertex Indegree Outdegree TotalDegree


1 2

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

Example (1): Represent the following graphs using


adjacency matrix.

(i)

Solution: (i) Here we order the vertices as


v1, v2, v3, V4. Since there are
Four vertices, the adjacency matrix
representing the graph will be a squaree
,Discretel
aph IheonyN

iatrIN of order 4 (i.e. 4 x 4 matrix), There quired adjacency matri

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

matrix of order 5 (5 x 5 matrix). The required adjacency matrix 1sS

V0 1 1 0 0
2 1 0 1 0
10 1
o 0 1 0
V'sl0 10 1

(i) Representation of Directed Graph (Digraph):


Let G= (V, E) be a simple graph withn vertices. Then an n x n matrix

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

154 Aliahce & C


Graph Theory

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

(i) f (a, b)e E1 (f (a), f (b)=E2, for a, beV1


If Gjis isomorphic to G2, then it is denoted by G1G2
Note:
or G1=G2
(1)If the number of vertices in G1and G2 are unequal, then G1 and G2 cannot be isomorphic.
(i) If the number of edges in Gjand G2 are unequal, then G1 and G2 cannot be
isomorphic.
Example (3): Show that digraphs are isomorphic

2 Or
p3

Graph A Graph BB

Solution: Number of nodes in graph A= Number of nodes in graph B=4

Number of edges in graph A= Number of edges in graph B-4

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

, 2)(u3,u,). (1, 3)+(u,, U,), (2, 4)+{u,


U2), (3,4)+{u4,u2
serves tthe
which preserves
As there exist one to one rrespondence
between the nodes
of two graph
adjacency of
the nodes as well as the direction of a edges.

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

Nodes Indegree Outdegree Nodes | Indegree Outdegree


2
U2
V2
Graph 1
Graph u3
A V3 B
U4
V4
V5
Total 8 8
Total 8
between the nodes
Let be a mapping from graph Ato Graph B and correspondence

isgiven by

1 U2, V2U] , V3Us, V U3 , Vsu4

corresspondence between the edges is given by


ATliauce Co
Graph neoiy

(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

Nodes Indegree Outdegree


Nodes Indegreee Outdegree
2
3
aphThepty
2
Graph b Graph
AT BT u3

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

corresspondence between the edges is given by


(a, b)ug, u,). (b, c}+{uy,ua), tb, dy+»(y,u,). {¢, bj>{42,41)

(c,a)(u,u,) (c, d}+-{u2, u) (d,a)+(u4,u)


As there exist
the nodes
one to one
correspondence between the nodes of two graph which preserves the
the adi
adjacen
as well as the direction of y ot
a
edges.
:G(A')EG(B)
Example (6): Show that following digraphs are isomorphic
V6

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

You might also like