Graph Theory-Module 1
Graph Theory-Module 1
1
Introduction to Graphs
Definition: A graph is collection of points called vertices &
collection of lines called edges each of which joins either a pair of
points or single points to itself.
2
Introduction to Graphs
v1
In Fig. G is graph with 4 vertices namely e1
e2
v2
3
Self Loops & Parallel Edges
Definition: If the end vertices Vi & Vj of any edge eij are same, then
edge eij called as Self Loop.
Definition: If there are more than one edge is associated with given
pair of vertices then those edge called as Parallel or Multiple edge.
For Example, In graph G, e4 & e7 has (v3, v4) are called as Parallel
edge.
4
Simple & Multiple Graphs
Definition: A graph that has neither self loops or parallel
edge is called as Simple Graph otherwise it is called as.
Multiple Graph
For Example,
G1 (Simple Graph )
G2 (Multiple Graph)
5
Weighted Graph
Definition: If each edge or each vertex or both are associated with
some +ve no. then the graph is called as Weighted Graph
1.4
For Example, V1 V2
6
1.5
V4 V3
1.7
6
Finite & Infinite Graph
Definition: A graph is Finite no. of vertices as well as finite no. of
edges called as Finite Graph otherwise it is Infinite Graph.
7
Adjacency & Incidence
Definition: Two vertices v1 & v2 vertices of G joins directly by at
least one edge then there vertices called Adjacent Vertices.
v4 e3
e5
e4 v3
e6 8
Degree of a Vertex
Definition: The no. of edges incident on a vertex vi with self loop
counted twice is called as degree of vertex vi.
v4 e3
e5
e4 v3
Definition : e7
e6
A vertex with degree zero is called as Isolated Vertex & A vertex
with degree one is called as Pendant Vertex.
9
Matrix Representation of Graphs
A graph can also be represented by matrix.
Two ways are used for matrix representation of graph are given as
follows,
1. Adjacent Matrix
2. Incident Matrix
10
1. Adjacent Matrix
The A.M. of Graph G with n vertices & no parallel edges is a
symmetric binary matrix A(G)=[aij] or order n*n where,
For Example,
A(G)=
11
1. Adjacent Matrix
The A.M. of multigraph G with n vertices is an n*n matrix
A(G)=[aij] where,
aij=N, if there one or more edge are there between vi &vj
& N is no. of edges between vi & vj.
aij=0, otherwise.
For Example,
A(G)=
12
2. Incident Matrix
Given a graph G with n vertices , e edges & no self loops. The
incidence matrix x(G)=[Xij] of the other graph G is an n*e matrix
where,
Xij=0, otherwise.
X(G)=
13
Directed Graph or Diagraph
Definition: If each edge of the graph G has a direction then graph
called as diagraph.
14
Directed Graph or Diagraph
Example: What are the in-degrees and out-degrees of the vertices a,
b, c, d in this graph:
deg-(a) = 1 a
deg-(b) = 4
deg+(a) = 2 b deg+(b) = 2
deg-(d) = 2 d c
deg-(c) = 0
deg+(d) = 1 deg+(c) = 2
15
Adjacency Matrix of a diagraph
It is defined in similar fashion as it defined for undirected graph.
For Example,
A(D)=
16
Incident matrix of diagraph
Given a graph G with n, e & no self loops is matrix x(G)=[Xij] or
order n*e where n vertices are rows & e edges are columns such
that,Xij=1, if jth edge ej is incident out ith vertex vi
17
Null Graph
Definition: If the edge set of any graph with n vertices is an empty
set, then the graph is known as null graph.
N3 N4
18
Complete Graph
Definition: Let G be simple graph on n vertices. If the degree of
each vertex is (n-1) then the graph is called as complete graph.
n(n-1)/2,For example,
K1 K2 K3 K4 K5
19
Regular Graph
Definition: If the degree of each vertex is same say ‘r’ in any graph
G then the graph is said to be a regular graph of degree r.
For example,
K3 K4 K5
20
Bipartite Graph
Definition: The graph is called as bipartite graph , if its vertex set
V can be partitioned into two distinct subset say V1 & V2. such that
V1 U V2=V & V1 V2 = & also each edge of G joins a vertex of
V1 to vertex of V2.
22
Bipartite Graphs
Example I: Is G1 bipartite?
v1 No, because there is no way to partition the
vertices into two sets so that there are no edges
v2 with both endpoints in the same set.
v3
23
Bipartite Graphs
• A graph G is bipartite if V(G) is the union of two disjoint
independent sets called partite sets of G
• Also: The vertices can be partitioned into two sets such that
each set is independent
• Matching Problem
• Job Assignment Problem
Workers
Boys
Girls Jobs
It is denoted by G1=G2
25
Isomorphism
For Example,
1 2 a b 1 a
2 b
3 d
4 3 d c
4 c
It is immediately apparent by definition of isomorphism that two
isomorphic graphs must have,
26
Isomorphism
• An isomorphism from a simple graph G to a simple graph H is a
bijection f:V(G)V(H) such that uv E(G) if and only if f(u)f(v)
E(H)
• We say “G is isomorphic to H”, written G H
w y c f1: w x y z
d
c b d a
G H
x z a b f2: w x y z
a d b c
• The petersen graph is the simple graph whose vertices are the
2-element subsets of a 5-element set and whose edges are
pairs of disjoint 2-element subsets
• Three drawings
For Example:
G G1 G2
30
Spanning Graph
Definition: Let G=(V, E) be any graph. Then G’ is said to be the
spanning subgraph of the graph G if its vertex set V’ is equal to
vertex set V of G.
For Example:
G G1 G2
31
Complement of a Graph
Definition: Let G is a simple graph. Then complement of G
denoted by ~G is graph whose vertex set is same as vertex set of G
& in which two vertices are adjacent if & only if they are not
adjacent in G.For Example:
G ~G H ~H
32
Operations on Graphs
Definition: The union of two simple graphs G1 =
(V1, E1) and G2 = (V2, E2) is the simple graph with vertex set V1 V2
and edge set E1 E2.
G1 G2 G1 G2
33
Operations on Graphs
Definition: The Intersection of two simple graphs G1 =(V1, E1) and
G2 = (V2, E2) is the simple graph with vertex set V1 V2 and edge set
E1 E2.
G1 G2 G1 G2
34
Path and Cycle
a b
e d
Graph Theory Ch. 1. Fundamental Concept 35
Walks, Trails 1.2.2
• A walk: a list of vertices and edges v0, e1, v1, …., ek, vk such
that, for 1ik, the edge ei has endpoints vi-1 and vi.
• A trail : a walk with no repeated edge.
• An example:
Delete
W
u
P
v
a b
G c
e d
a b
a b
c H3 c
H1 H2
d e d
e d
39
Connected and Disconnected
• Connected: There exists at least one path between two
vertices.
• Disconnected: Otherwise
• Example:
• H1 and H2 are connected.
• H3 is disconnected.
a b a b
c H3
H1 H2 c
d e
d d
e
Theorem: A graph is bipartite if and only if it has no odd
cycle. 1.2.18
• Examples:
A B
A B
F C
E D
D C
A B
A B
C D
C D
E F
Fundamental theorem of Graph theory
Handshaking Theorem
Statement: Sum of degree of all the vertices is twice the number of
edges contained in it.
41
e