03. Graph Theory
03. Graph Theory
03. Graph Theory
MA253
UNIT 3
Graph Theory
INTRODUCTION TO GRAPH THEORY
In a hockey tournament there are 8 teams which
are denoted by S,T,U,V,W,X,Y,Z. Let the following
games has been played.
S X, Z T W, X, Z
U Y, Z V W,Y
W T, V, Y X S, T
Y U, V, W Z S, T, U
We may illustrate this situation by following
diagram
Or one can draw in the following way
Graphical Representation
The team are represented by dots. Two such dots
are join by line segment wherever the
corresponding teams have played each other. In
figure 1 dots have been joined by straight line
while in figure 2 some of the line segment are
straight but some are not. But since we are simply
interested in which games have been played. The
manner in which the pair of dots is joined is of no
importance so it does not matter whether the line
segments are straight or not. Many real world
situations can be described by means of such type
of diagram which are called graph.
Definition of GRAPH
A graph G=(V(G), E(G)) consist of two finite set V(G)
and E(G), where V(G)= The vertex set of graph, often
denoted by just V which is non-empty set of elements
called vertices or nodes and E(G)= The edge set of
the graph often denoted by E which is possibly empty
set elements called edges or arc such that e in E
assigned an unordered pair of vertices (u, v) called
the end vertices of e.
Order of a Graph G
The order of a graph G, written as n(G), is no. of
vertices in the graph G. It is denoted by |V(G)|.
The size of the graph G
The size of the graph G, written as e(G), is no. of
edges in graph. It is denoted by |E(G)|.
For the above example
V={S, T, U, V, W, X, Y, Z}
E={e1, e2, e3, e4, e5, e6, e7, e8, e9, e10}
e1 (S,Z)
e2 (S,X) ( UNORDERED PAIR )
e3 (T,Z)
e4 (T,X)
e5 (T,W)
e6 (U,Y)
e7 (Y,V)
e8 (V,W)
e9 (W,Y)
e10 ( U,Z)
The order of Graph is 8 and the size of Graph is
10.
Remark: If e is an edge with end vertices u and v
then e is said to join u and v.
Example 1: Let G=(V,E) .V={a, b, c, d, e} and
E={e1, e2, e3,e4,e5,..........e8} and the ends of the edges
are given by
e1 (a,b), e2 (b,c), e3 (c,c), e4 (c,d),
e5 (b,d), e6 (d,e), e7 (b,e), e8 (b,e).
Solution:
Example 2: Draw a diagram for each of the
following graph G(V,E) (i) V={a, b, c, d, e ,f} and
E={(a, d), (a, f) ,(b, c), (b ,f),(c, e)}.
Solution:
Loop (self loop) : An edge of graph which join a
vertex to itself is said to be a loop i.e., an edge of
the graph having identical end vertices is said to
be loop. In figure given below e is the loop:
Vertex Adjacent
Vertex
a b, c, e
b a
c a, e, d
d c ,e
e a, d, c
f (Isolated ----------
vertex)
Neighbour of a vertex: Let v be a vertex of a
graph G. If vertex v is joined by an edge to a vertex
u of g, then u is said to be neighbour of vertex v.
In graph G neighbour of a vertex a are b, c, e.
Neighbourhood set of vertex: The set of all
neighbour for fixed vertex v of a graph G is said to
be neighbourhood set for vertex v. It is denoted by
N(v). In graph G N(a)={b ,c, e}
Incident Edge: An edge e of a graph G is said to
be incident with vertex v if v is an end vertex of e.
Adjacent Edges: Two edges e and f of the graph
G which are incident with a common vertex is said
to be adjacent edges.
TYPES OF GRAPH
SIMPLE GRAPH: A Graph which neither contains loop nor
parallel edges (end points are same), is known as Simple
Graph. For example , the following graph is a simple graph.
with finite number of vertices must contain finite number of edges; this
the edges have a direction associated with them. The notation e says e
non empty disjoint subset X and Y (i.e. V= XUY, ) such that each edge of G has one
end point in X and one end point in Y then G is said to be bipartite graph. The
Note: The number total edges in a complete bipartite graph are mn because each m
complete bipartite graph K2,3, K3,3, K3,4, K2,6 are display in the figure
DEGREE OF VERTEX FOR UNDIRECTED GRAPH
Let G be a graph and v be any vertex of G. The number
of edges of G connected with the vertex v is called
degree of a vertex. Loop is counted twice. It is denoted
by d(v) or deg(v) or dG(v).
Remark: The degree of a vertex of a simple graph G
on n vertices cannot exceed n-1.
ODD VERTEX & EVEN VERTEX: In a graph a vertex
with odd degree is said to be odd vertex and vertex
with even degree is said to be even vertex.
Remark:
1. The degree of vertex is also known as its valency.
2. The degree of isolated vertex is zero.
3. The vertex with degree one is known as Pendant
vertex.
Example: Find the degree of the vertices in the
given graph. Also find the even and odd vertex in
the given graph.
FOR DIRECTED GRAPH
INDEGREE OF VERTEX: The in degree of a
vertex in directed graph is the number edges
ending at it and it is denoted by indeg(v) or d +(v).
Solution:
THEOREM: If G=(V,E) be a directed graph with e
edges, then
G G ( v ) e
deg
vV
( v ) deg
vV
Number of edges=16/2=8.
Solution: Suppose that there are n vertices say v1, v2, v3, v4, ..., vn.
2+2+....+2(n times)=16
2n=16n=8.
vertices each of degree 3 and rest have Equal degree less than 3. Find
9 vertices.
vertices.
respectively.
REGULAR GRAPH: In a graph if all vertices are
of same degree then graph is said to be regular
graph.
Remark:
1)If every vertex has degree r , then graph is
called regular graph of degree r.
2)Every null graph is a regular graph of degree
zero.
3)If a graph has n vertex and is regular of degree
r, then it has rn/2 edge.
4)All regular graphs need not to be complete but
all complete graph are regular.
K- REGULAR GRAPH: If The degree of every
vertex of graph G is K , then G is said to be K-
regular graph.
Solution:
CONDITION 1: Check no. of vertices and edges in
both the graph are same or not. If same, then
check condition 2.
Both G and H have six vertices and seven edges.
Both have four vertices of degree two and two
vertices of degree three.
CONDITION 2: Find one to one correspondence between
ONE TO ONE ONE TO ONE
CORRESPONDENCE OF CORRESPONDENCE OF EDGE
VERTEX SET SET
u1 v6 (u1 , u2 ) (v6 , v3 )
u2 v3 (u2 , u3 ) (v3 , v4 )
u3 v4 (u3 , u4 ) (v4 , v5 )
u4 v5 (u4 , u5 ) (v5 , v1 )
u5 v1 (u5 , u6 ) (v1 , v2 )
u6 v2 (u6 , u2 ) (v2 , v3 )
(u1 , u4 ) (v6 , v5 )
Since One to One correspondence exist between vertex as well
as edge set of the given graph, therefore the graph G and H are
isomorphic.
Solution: CONDITION 1: Check no. of vertices and edges in both the graph are same or not.
If same, then check condition 2
The graphs G and H both have eight vertices and 10 edges. They also both have four vertices
of degree two and four of degree three.
.
CONDITION 2: Find one to one correspondence between vertex set and edge set of both
graph.
However, G and H are not isomorphic. To see this, note that because deg(a) = 2 in G, a must
correspond to either t, u, x, or y in H, because these are the vertices of degree two in H.
However, each of these four vertices in H is adjacent to another vertex of degree two in H,
which is not true for a in G.
Since One to One correspondence between vertexes does not exit therefore G
and H are not isomorphic.
G
• Let G be a simple graph with n vertices and be its complement.
Suppose G has exactly one even vertex then G have (n-1) odd
vertices.
• The complement of graph G with n vertices can be obtained from
the complete graph Kn by rubbing out all the edges of G. i.e. Null
graph generated from Complete graph G BY REMOVING EDGES is
a complement graph of G.
Example: Find the complement of the graph and also find
whether it is self complementary or not.
R
MATRIX REPRESENTATION OF GRAPH
A diagrammatic representation of a graph has limited
usefulness; such representation is only possible when the
number of vertices and number of edges are reasonably small.
Also their representation in computer memory requires lot of
storage space. So a matrix is a convenient and useful way of
representing a graph to a computer. There are two different
ways of representing a graph inside a computer namely by using
1. Adjacency Matrix
REMARKS:
1. In A(G) we have aij=aji for each i and j i.e., adjacency matrix for a graph is symmetric.
2. If G has no loops then all the entry of the main diagonal of A(G) are zero.
3. For a simple graph, the entries of A(G) are either zero or one.
INCIDENCE MATRIX FOR UNDIRECTED GRAPH: Let v1, v2,v3,........vn be the n vertices of a graph G
and e1, e2, e3,.....em be the m edges of G. Then the incidence matrix of G w.r.t to this particular
listing of vertices and edges is m matrix(vertices edges). The entries of a matrix can be derived
by using
0, if vi is not end po int of e j
I (G ) M (G ) mi j .
1, if vi is end po int of e j
REMARKS: R
1. The sum of the elements in the ith row of M(G) gives the degree of vertex v i.(vi does not
contain loop)
2. The sum of the elements in each column is 2 (corresponding to 2 ends of the edges)
R
Example: Determine the number of loops and multiple edges in a
multi graph G from its adjacency matrix.
1 1 3 0
1 2 1 3
A G
3 1 0 1
0 3 1 0
Solution: Since adjacency matrix A is a square matrix of order 4, graph G has four vertices v 1,
v2,v3, v4. The diagonal of A is indicating the vertices having loops because these entries
indicate the number of edges originating and terminating at the same vertex. Thus, there are
three loop: one at v1 and two at v2 .
Multi edges are 6.
MATRIX REPRESENTATION OF DIRECTED GRAPH
ADJACENCY MATRIX FOR DIRECTED GRAPH: For
a directed graph
m if m edges G at
begining consists
vertex vi andof n at
ending vertices,
vj an
aij
adjacency
0 matrix A=[a ij ] is defined as:
, otherwise
REMARKS:
• Every graph is its own sub graph.
• A sub graph of a sub graph of G is a sub graph of
G.
• Any simple graph with n vertices is a sub graph of
the complete graph Kn.
H G
PROPER
H G SUBGRAPH:
H G Let
V (H ) VH
(Gbe
) a sub
E ( H )graph
E (G ) of G
i.e., . If , but i.e.
and then H is said to be a proper sub
graph of G.
SPANNING SUBGRAPH: A sub graph H of graph
G is said to be a spanning sub graph of G if
V(H)=V(G) i.e. sub graph of a graph G is said to be
spanning sub graph if it contain all vertices of G.
VERTEX DELETED SUBGRAPH:
Definition 1: Let G=(V,E) be a graph and V has at
least two elements. For any vertex v of G , G-v
denotes the sub graph of G with vertex set V-{v}
and whose edges are all those edges of G which
are not incident with vertex v .i.e., graph G-v is
obtained from graph G by removing vertex v and
all the edges of G connected to v. Graph G-v is said
to be vertex deleted sub graph.
Definition 2: Let G=(V,E) be the given graph and
U be a proper subset of V, then G-U denotes the
sub graph of G with vertex set V- U and whose
edges are all those of G which are not incident
with any vertex of U. For example
EDGE DELETED SUBGRAPH: Let G=(V,E) be
the given graph and e be the edge of G then G-e
denotes the subgraph of G having V as its vertex
set and E-{e} as it edge set. i.e. G-e is obtained
from G by removing edge e (but not the end
point of e) G-e is said to be edge deleted sub
graph of G.
Definition 2: Let G =(V,E) be the given graph. F
be a subset of edge set E. G-F denoted the sub
graph of G with vertex set V and edge set E-F i.e.
G-F is obtained by deleting all the edges in F but
not their end point. G-F is also said to be edge
deleted sub graph G.
WALK: A walk in a graph G is a finite alternating
sequence of vertices and edges beginning and
ending with vertices such that each edge is
incident with vertices preceding and following it.
R
Open walk-A walk is said to be an open walk if the
starting and ending vertices are different i.e. the
origin vertex and terminal vertex are different.
Closed walk-A walk is said to be a closed walk if the
starting and ending vertices are identical i.e. if a
walk starts and ends at the same vertex, then it is
said to be a closed walk.
Cycle or Circuit
In graph theory, a cycle in a graph is a non-empty
trail in which the only repeated vertices are the first
and last vertices.
K-CYCLE: A cycle of length k is said to be K- cycle
i.e. A cycle with K edge are said to be K cycle.
REMARK:
• If K is odd then K- cycle is said to be an odd and
K is even then K-cycle is said to be even.
• An n-cycle is denoted by Cn.
• A loop is just a 1-cycle.
E.g. W=3c1a2d3 is a cycle and its length is 3.
E.g. C3 =3c1a2d3 is a 3-cycle
CONNECTED GRAPH
PATH: A path is a walk in which no vertex is repeated.
CONNECTED VERTEX: A vertex u is said to be
connected to vertex v in a graph G if there is a path in
G from u to v.
NOTE:
1.An vertex u is connected to itself by trivial path P=u.
2. If u is connected to v and v is connected to w then u
is connected to w.
Remarks:
1. Not all graph have cut vertices.
2. The complete graph ,has no cut vertices.
VERTEX CONNECTIVITY
Let G be a simple graph. The smallest number of vertices in
G whose deletion from G leaves either a disconnected graph
or complete graph with one vertex is said to be vertex
connectivity of G. It is denoted by
The graph G given in the above figure has no cut
vertex. But a disconnected sub graph is obtained
when two of these vertices 2 and 6 or 2 and 5 are
deleted. Therefore for this graph G ,
REMARKS
1.For the deletion of any vertex from Kn result in
Kn-1 and in general the deletion of t vertices (t<n)
result in Kn-t therefore , =n-1.
2. A connected graph G has =1 iff G=K 2 (i.e.
complete graph with 2 vertices) or G has a cut
vertex.
3. = 0 iff G=K1 or G is disconnected.
CUT EDGE( BRIDGE) OR ISTHMUS
A bridge is an edge whose removal increases number
of connected components of given graph.
REMARK: It is not necessary that all the graph have
cut edge.
EDGE CONNECTIVITY
Let G be a simple graph. The smallest number of edges
in G whose deletion from G leaves either a
disconnected graph or complete graph with one vertex
is said to be edge connectivity of G. It is denoted by.
REMARKS:
If G is a graph with n vertices, is either 0 or 1.
G is disconnected graph iff
G is disconnected graph, =
For any graph
Example : Find the cut vertices , cut edges,
vertex connectivity and edge connectivity in
the following figure
Solution:
PLANAR GRAPHS
A graph is said to be planar if there exists some
geometric representation of G which can be drawn
on a plane such that no two of its edges crossovers
to each other. OR A graph that cannot be drawn
on a plane without a crossover between it edges is
called planar graph.
REGION OF A GRAPH
A region of a planar graph is defined to be an
area of the plane that is bounded by edges and is
not further divided into subareas.
EULER’S FORMULA
If a connected planar graph G has ‘n’ vertices, ‘e’
edges and ‘r’ number of regions, then
Result: If a planar graph has ‘k’ number of
components, then
Result: If G is connected simple planar graph with
If G is connected simple planar graph with vertices
and ‘e’ edges and
Example: A connected planar graph has 10
vertices each of degree 3. Into how many regions
does a representation of this planar graph split
the plane?
Solution: Here
. Hence using first theorem of graph theory, the sum
of degrees of all the vertices will be 30, so number of
edges in a graph is 15.
Using Euler’s formula,
10
r
Note: we include the outside area of a graph as
region.
Examples
Cycle or Circuit : In graph theory, a cycle in
a graph is a non-empty trail in which the only
repeated vertices are the first and last vertices.
TRAIL: A Trail is a walk in which no edges are
repeated.
EULERIAN AND HAMILTONIAN GRAPH
EULERIAN PATH: Eulerian trail (or Eulerian
path) is a trail in a finite graph that visits every
edge exactly once (Repetition of vertices is allowed.
Path in title is a word and it is not a definition of a
Path)
EULERIAN CIRCUIT: Eulerian
circuit or Eulerian cycle is an Eulerian trail that
starts and ends on the same vertex.
EULERIAN GRAPH: Eulerian graph is a graph
FOR EXAMPLE
EXERCISE
Path : - A F B C G D E ;
Circuit :- A F B C G D E A
EXERCISE
Maximal Matching
A matching M of graph ‘G’ is said to maximal if no
other edges of ‘G’ can be added to M.
Example: Find the Maximal Matching graph of
following graph.
Answer:
Maximum Matching
It is also known as largest maximal matching.
Maximum matching is defined as the maximal
matching with maximum number of edges.
The number of edges in the maximum matching of
‘G’ is called its matching number.
Perfect Matching
A matching (M) of graph (G) is said to be a perfect
match, if
deg(V) = 1, for every vertex of M.
Example: Find the matching number of following
graph.
Answer:
Edge coloring
The most common type of edge coloring is similar to vertex
colorings. Each edge of a graph has a color assigned to it in
such a way that no two adjacent edges are the same color. Such
a coloring is a proper edge coloring or edge coloring. The
minimum required number of colors for the edge coloring of a
given graph is called the chromatic index of the graph.
The chromatic index is 4.