You are on page 1of 42

Module 6 Graph

Theory
TYPES OF GRAPHS
G R A P H R E P R E S E N TAT I O N
SUB GRAPHS
O P E R AT I O N S O N G R
A P H S WA L K , PAT H ,
C I R C U I T,
CONNECTED GRAP
H S , D I S CO N N E C T E D
GRAPH,
C O M P O N E N TS , H O M O M O R P H I S M A N D I S O M O R P H I S
M O F G R A P H S , E U L E R A N D H A M I LTO N I A N G R A P H S ,
P L A N A R G R A P H , C U T S E T, C U T V E R T E X , A P P L I C AT I
ONS.
Graph :
A graph consists of following parts :
i. A set V=V(G) whose elements are called vertices
ii. A collection of edges E=E(G) of unordered pairs of distinct elements
iii. A function gamma(u,v) which pairs any of the pair of vertices to edge name
Describe the following graph :
Solution :
V = { v1,v2,v3,v4,v5,v6,v7 }
E = {{v1,v2} , {v1,v3} , {v3,v4} ,
{v2,v4} , {v4,v5} , {v4,v6} , {v4,v7} ,
{v6,v7} , {v5,v7}}

v1 Gamma(v1,v2) = e1
e1 v2
Gamma(v1,v3) =
e2 Gamma(v3,v4)
e2 e4 Gamma(v2,v4)
= e3 = e4
e5 v5
Gamma(v4,v6) =
v3 e3 v4 e8 Gamma(v4,v5)
e6 = e5
e8 e9 Gamma(v4,v7) = e9
Gamma(v5,v6) =
v6 e7 e6 Gamma(v6,v7)
v7
= e7
Types of Graph :

- Undirected Graph
- Directed Graph
- Asymmetric Digraph
- Symmetric Digraph
- Simple Graph
- Connected and disconnected graph
- Complete graph
- Bipartite graph
- Multigraph
- Trivial Graph
- Empty Graph
Undirected Graph :
A graph in which the edges are not specified with direction or arrows is known as undirected graph

e1 v2

e4
e2 e5 v5
v3 e3
e9 e6
v4

e8
v6 e7 v7
Directed Graph :
A graph is said to be directed graph if the edges in the graph are directed .

2
V = { 1, 2, 3, 4}

E = { (1,3) , (1,4) , (2,2) , (2,1) , (3,4) , (4,2) , (4,3) }

1 3

The number of edges incoming to a vertex is called in-degree of


vertex
4
Number of edges outgoing from a vertex is called out – degree of
vertex
Asymmetric digraph
A digraph in which each pair of vertices have either one edge or no edges is known as asymmetric digraph .

V = {1,2,3,4}

E = {(1,2) , (2,2) , (2,3) , (3,4) , (4,2) , (1,4) }


1 3

4
Symmetric Digraph :

A digraph in which each pair of vertices (x,y) have either no edges or two edges (x,y) and (y,x) .

1 3

4
Simple Graph :
A graph which has no self loops and no parallel edges is called simple graph .

It can be undirected or directed .

2
2

1 3 1 3

4 4
Undirected Simple Graph Directed Simple Graph
Connected and Disconnected Graph :
A graph is said to be connected if every pair of vertices are connected i.e. one can
move from one node to all other nodes by following the edges . If a graph is not
connected then it is called disconnected graph .
Complete Graph
A simple graph is called complete graph , if it is undirected and there exists an edge between each pair of
vertices .

A graph with n nodes will have e number of edges = n(n-1) / 2 .

A complete graph is denoted by Kn

2 3

n=3
e=3
Bipartite Graph :
An undirected simple graph is called bipartite graph , if the vertices of the graph can be divided
into two sets , such that no two vertices in the same set have an edge connecting them

Let G(V,E) be a bipartite graph , then there exists two sets V1 and V2 such that ,

V1 is a subset of V and V2 is a subset of V


V1 intersection V2 = null
V1 union V2 = V

1 2 3

4 5 6
Check whether Bipartite graph can be drawn for the following mentioned diagram .

1 2 3

4 5 6
Multi graph :
A Multi graph G = G(V,E) consists of set of vertices V and set of edges E except that E may contain multiple
edges connecting same end points or may contain one or more loops as edges whose end points are same

e5

v1 e1 v2 V1 V2 V3 V4 E1 E2 E3 E4 E5 E6

e4 V1 0 1 1 0 V1 1 1 0 0 1 0
e2
V2 1 0 0 1 V2 1 0 0 1 1 0
v4
v3 e3 V3 1 0 0 1 V3 0 1 1 0 0 0
V4 0 1 1 1 V4 0 0 1 1 0 1
e6
Trivial Graph :
A graph with one vertex and no edges is called trivial graph .
V = {1}
1
E= {null}

Isolated Vertex / Pendant Vertex :


Vertex that is isolated and does not belong to any edge
B
Pendant Vertex : E
V = {A , B , C , D ,E}
A C E= {{A,B} , {B,C} ,
{C,D} , {A,D} ,
{B,D}}
E
D
Empty Graph :
A graph with no vertex or no edges is called Null Graph / Empty Graph

Degree of a vertex :
It is equal to the number of edges which are incident on V or in other words , the number of edges
which contain V as end point
v1 e1 v2

e4 Deg(V1) Deg(V2) Deg(V3) Deg(v4)


e2
v4 2 2 2 4

v3 e3
Property 1 : Sum of degree of vertices = Twice the number of
edges In a graph , every edge is counted twice as it is incident on two vertices
Problem type 1 :
Describe the graph . Find degree and parity of each vertex . Verify sum of degree of vertices is equal
to twice the number of edges

V={a,b,c,d,e}
E= {{a,b} , {a,d} , {a,c} , {e,b} ,{e,c} , {d,c} , b
{c,b}}
e2
Odd parity : a,b e1 e7
Even parity : c, d,e e3
a c
Sum of degree of vertices : 3+3+4+2+2 =14 e6
e4
2*no. of edges = 2*7 =14 e5
Hence , sum of degree of vertices is equal to twice the number of edgees
d
Problem type 2 :
A connected graph has 9 vertices having degrees 2,2,2,3,3,3,4,4,5 . How many edges are there in the
said graph ?
Summation degree of (vi) = 2 * E
28 = 2 * E
E = 28 / 2 =14
Problem type 3 :

Find the number of vertices of graph having 16 edges if degree of each vertex 2 ?
Summation degree of vertex = 2*E
2*x=2*E
2 * x = 2 * 16
hence , x = 16
Practice problem :
How many vertices are necessary to construct a graph with exactly 6 edges in which each vertex is of
degree 2 .
How many vertices are necessary to construct a graph with exactly 6 edges in which each vertex is of
degree 2 .
Summation degree of each vertex = 2 * number of edges
2*x=2*6
X=6
Related Graphs :

Two graphs may be related to each other in the following mentioned ways :

i. Isomorphic graphs
ii. Subgraph
iii. Complement of a graph
Isomorphic Graph :

Let G1 and G2 be any two given graphs they are said to be isomorphic to each other or logically
equivalent , if following conditions are satisfied :
i. No. of vertices in G1 = No. of vertices in G2
ii. No. of edges in G1 = No. of edges in G2
iii. There exists one-to-one correspondence between vertices and edges of both the graphs
No. of Vertices in G1 = 5
Show that the following graphs are isomorphic No. of Vertices in G2 = 5

No. of edges in G1 = 8
V5
No. of edges in G2 = 8
V4 V3

V4 V3
No. of vertices having degree 3 in G1 = 4
V5 No. of vertices having degree 4 in G1 =
1 No. of vertices having degree 3 in G2
= 4 No. of vertices having degree 4 in
V1 V2 G2 = 1
G1 V2
V1 V1  V1
G2 V2 
V2 V3
Hence , the given graph is isomorphic  V3
V4  V4
V5 
V5
No. of Vertices in G1 = 5
No. of Vertices in G2 = 5

No. of edges in G1 = 8
No. of edges in G2 =
V5 8

No. of vertices having degree 3 in G1 = 4


V4 V3 V4 V3 No. of vertices having degree 4 in G1 =
1 No. of vertices having degree 3 in G2
= 4 No. of vertices having degree 4 in
V5 G2 = 1
V1  V1
V1 V2 V2 V2 
V1
V2 V3
G1 G2  V3
Hence , the given graph is isomorphic V4  V4
V5 
V5
V6 V8 V6 V8
V1 V3 V4 V1 V2 V3 V4
V2
V5 V5

V7 V9
V9

V7

No. of Vertices in both the graphs = 9 No. of edges in both the graphs = 8

No. of vertices of Degree 1 = 5


No. of vertices of degree 2 =
2 No. of vertices of Degree 4
=1 No. of vertices of Degree 3
=1

Although the required conditions are satisfied the


given two graphs are not
isomorphic as adjacency is not preserved
Subgraph :

A graph G1 = <V1 , E1> is said to be subgraph of a graph G = <V,E> if V1 is a subset of V and E1 is a


subset of E such that edges in E , are incident only with the vertices in V1 .

2 3 2

1 4 1 4

6 5
6 6
Complement of a graph :

A graph G1 = (V1 , E1) is said to be the complement of graph G=(V,E) if V1 = V and E1 = V * V - E

2 3
2 3
1 4
1 4

6 5
6 5
Representation of Graphs :
i. Incidence matrix
ii. Adjacency matrix
Practice problems :

Determine if the following graphs are isomorphic or not . Find its one – to – one correspondence

Prove that a connected graph with n vertices must have atleast n-1 edges .
Draw graph corresponding to each adjacency matrix
Euler Graph , Euler Circuit and Euler Path :

Euler Graph :
A graph is said to be euler if there exists a euler circuit in it
Euler Circuit :
A Euler circuit is a Euler path that is closed
Euler Path :
Euler path in a graph is a path in which every edge is travelled only once
Necessary and sufficient conditions for a Euler Circuit :

• Every vertex must have an even degree

• If there are exactly two vertex of odd degree , then the euler path exists which
begins with one vertex of odd degree and ends with another of odd degree .
Which of the following graphs have Euler path and Euler Circuit ?

a b

d g

e f
I
In Graph I , Deg (a) = 3 , Deg (b) = 2 , Deg (c) = 2 , Deg (d) = 6 , Deg (e) =
2 , Deg (f) = 3 , Deg (g) = 2

There are two vertices of odd degree . Hence , euler path exists .

Euler path is a-c-d-e-f-g-d-b-a-d-f


Which of the following graphs have Euler path and Euler Circuit ?

a
1

b c

2 3 d e
II III
In Graph II , Deg (1) = 3 , Deg (2) = 3 , Deg (3) = 3 , Deg (4) =3
There are more than two vertices of odd degree . Hence , euler path doesn’t exists .

In Graph III , Deg(a) = 4 , Deg(b) = 4 , Deg(c) =4 , Deg(d) =4 , Deg(e)=4


Every vertex has even degree . Hence , euler path exists
Euler path is a-b-d-e-c-a-d-c-b-e-a
Hamiltonian Graph , Hamiltonian Path and Hamiltonian Circuit

Hamiltonian Graph :
A graph is said to be Hamiltonian if it has a Hamiltonian circuit in it.
Hamiltonian path :
A Hamiltonian path in a graph is a path in which each vertex is visited only once
Hamiltonian circuit :
Hamiltonian circuit is a Hamiltonian path that is closed meaning the initial and final vertex are same and only
this vertex is visited twice .
Conditions for Hamiltonian circuit :

• If the sum of degree of any two adjacent vertices is greater than or equal to ‘n’ where n is the number of
vertices , the graph is said to be Hamiltonian

OR

• If the degree of each vertex is greater than or equal to (n/2) where n is the number of vertices then the
graph is said to be Hamiltonian

• These are only sufficient conditions but not necessary to prove that a graph has Hamiltonian circuit in it
1
N= 4
Deg(1) = 3 Deg(2) = 3
Deg(3) = 3 Deg (4) = 3

3
(1) Sum of degree of adjacent
2 4 vertices = 3 + 3 =6 > N

(2) N/2 = 4/2 = 2 < 3

Hamiltonian circuit and path exist :


Hence ,
Path : 1-3-4-2
Circuit : 1-3-4-2-1
N= 8
Deg(1) = 3 Deg(2) = 3 Deg(3) = 3 Deg (4) = 3
1 2 Deg(5) = 3 Deg(6) = 3 Deg(7) = 3 Deg (8) = 3

7
8
(1) Sum of degree of adjacent
6 vertices = 3 + 3 =6 < N
5

4 3
(2) N/2 = 8/2 = 4 > 3

Hamiltonian circuit and path exist :


Hence ,
Path : 5-8-7-6-3-2-1-4
Circuit : 5-8-7-6-3-2-1-4-5
Practice Problems
: Based on Euler Path and Euler Circuit Based on Hamiltonian Path and Hamiltonian Circuit

You might also like