Unit V
Unit V
Unit V
Graph Theory
Birth of Graph Theory
The Konigsberg Bridge Problem
in Prussia.
exactly once from start to end of any town which made Euler to
Null graph: A graph containing only isolated vertices is called null graph.
Example:
Parallel edges: If in a directed graph or undirected graph certain pairs of vertices are joined
by more than one edge, such edges are called paralled edge. A graph which contains some
parallel edges is called a multigraph.
Pseudo graph: A graph in which loops and parallel edges are allowed.
Weighted graph: Graphs in which a number (weight) is assigned to each edge.
Degree of a Vertex: The degree of a vertex in an undirected graph is the number of edges
incident with it, with the exception that a loop at a vertex contributes twice to the degree of
that vertex. The degree of a vertex v is denoted by deg (v).Clearly the degree of an isolated
vertex is zero.
Here deg (v1)=3, deg (v2)=3, deg (v3)=2, deg (v4)=2, deg (v5)=2 and deg (v6)=2.
Pendant vertex: If the degree of a vertex is one,
it is called a pendant vertex.
Proof: Since every edge is incident with exactly two vertices, every edge contributes 2 to
Therefore all the e edges contribute (2e) to the sum of the degrees of the vertices.
is even.
Proof:
2e = deg(v ) + deg(v
vi V1
i
v j V2
j ) - (1)
Since each deg(vi) is even, deg(v )
vi V1
i is even
𝑑𝑒𝑔𝐺+ 𝑎 =1 𝑑𝑒𝑔𝐺− 𝑎 =2
𝑑𝑒𝑔𝐺+ 𝑏 =5 𝑑𝑒𝑔𝐺− 𝑏 =1
𝑑𝑒𝑔𝐺+ 𝑐 =1 𝑑𝑒𝑔𝐺− 𝑐 =2
𝑑𝑒𝑔𝐺+ 𝑑 =1 𝑑𝑒𝑔𝐺− 𝑑 =3
Theorem :
+ −
If G=(V,E) be a directed graph with e edges then 𝑣∈𝑉 𝑑𝑒𝑔𝐺 𝑣 = 𝑣∈𝑉 𝑑𝑒𝑔𝐺 𝑣 =e.
Verify handshaking theorem for the following digraph
𝑛(𝑛−1)
Note: The number of edges in Kn is nC2 or . Hence, the maximum
2
𝑛(𝑛−1)
number of edges in a simple graph with n vertices is .
2
Regular graph: If every vertex of a simple graph has the same
degree, then the graph is called a regular graph. If every vertex in a
regular graph has degree n, then the graph is called n-regular.
Bipartite graph: If the vertex set V of a simple graph G= (V, E)
can be partitioned into two subsets V1 and V2 such that every
edge of G connects a vertex in V1 and a vertex in V2, then G is
called bipartite graph.
Complete bipartite graph: If each vertex of V1 is
connected with every vertex of V2 by an edge, then G is
called a complete bipartite graph. If V1 contains m vertices
and V2 contains n vertices, then the complete bipartite
graph is denoted by Km,n.
𝑛2
Theorem: The number of edges in a bipartite graph with n vertices is at most .
4
Proof: Let the vertex set be partitioned into the two subsets V1 and V2. Let V1 contain x
vertices. Then V2 contains (n-x) vertices. The largest number of edges of the graph can be
obtained, when each of the x vertices in V1 is connected to each of the (n-x) vertices in V2.
Therefore, the largest number of edges f(x)= x(n-x), is a function of x. Now we have to find
the value of x for which f(x) is maximum. By calculus, f’(x)=n-2x and f”(x)=-2. f’(x)=0,
𝑛
when x=(n/2) and 𝑓"(2 ) <0.
𝑛
Hence, f(x) is maximum, when x=2 .
𝑛 𝑛2
Therefore the maximum number of edges required= 𝑓(2 ) = 4 .
Isomorphism: The simple graphs G1=(V1,E1) and G2=(V2,E2) are
V2 with the property that a and b are adjacent in G1, if and only if f(a)
and f(b) are adjacent in G2 for all a, b V1, such a function f is called
an isomorphism.
nonisomorphic
Example: Show that the graphs G and H are isomorphic.
In G, |V|=5 and |E|=6. In H, |V|=5 and |E|=7. The number of edges in both the graphs G and
H are not equal. Therefore the graphs G and H are not isomorphic.
Problem: Show that the graphs G and H are not isomorphic.
Problem: Show that the following graphs G and H are isomorphic.
Walk: A walk in G is a finite non-null sequence W=v0e1v1e2 v2…ekvk, whose terms are
alternatively vertices and edges, such that for 1≤i≤k, the ends of ei are vi-1 and vi. W is a walk
from v0 to vk or a (vo,vk)-walk.The vertices v0 and vk are called the origin and terminus of W
respectively and v1,v2,…,vk-1 its internal vertices. The integer k is the length of W.
If the edges e1,e2,e3,…,ek of a walk W are distinct, W is called a trail.
If the vertices v0,v1,v2,…,vk are distinct, W is called a path.
= n−k
Squaring on both sides we get,
k
ni − 2n + k (n − k ) 2
2
i =1
k
ni (n − k ) 2 + 2n − k
2
- (2)
i =1
1
Now the maximum number of edges in the ith component of G = ni (ni − 1)
2
maximum number of edges of G,
1 k
= ni (ni − 1)
2 i =1
1 k
= ni − n
2
2 i =1
1
( n − k ) 2 + 2n − k − n
2
1
(n − k ) 2 + (n − k )
2
(n − k )(n − k + 1)
2
graph
EULERIAN CIRCUIT
deg(A)=2
deg(B)=2
deg(C) =4
deg(D)=2
deg(E)=2
A-B-C-E-D-C-A
A-B-C-D-E-F
G1 G2
Hamiltonian Path: A path of a graph G is called a Hamiltonian path,
a-b-c-d-a
Hamiltonian Path
a-b-c-d
Problem:
If there exists an edge between vertex vi and vj, where i is a row and j is a column
then the value of aij=1.
Since graph G consist of four vertices. Therefore, the adjacency matrix will be 4 x 4
matrix.
𝑀𝐴 =
Incidence Matrix Representation: If an Undirected Graph G consists of n
vertices and m edges, then the incidence matrix is an n x m matrix C = [cij] and
defined by
by
Consider the undirected graph G as shown in fig. Find its incidence matrix
MI.
:
The out degree and in degree of a vertex:
𝑑𝑒𝑔𝐺+ 𝑎 =1 𝑑𝑒𝑔𝐺− 𝑎 =2
𝑑𝑒𝑔𝐺+ 𝑏 =5 𝑑𝑒𝑔𝐺− 𝑏 =1
𝑑𝑒𝑔𝐺+ 𝑐 =1 𝑑𝑒𝑔𝐺− 𝑐 =2
𝑑𝑒𝑔𝐺+ 𝑑 =1 𝑑𝑒𝑔𝐺− 𝑑 =3
Theorem :
+ −
If G=(V,E) be a directed graph with e edges then 𝑣∈𝑉 𝑑𝑒𝑔𝐺 𝑣 = 𝑣∈𝑉 𝑑𝑒𝑔𝐺 𝑣 =e.
Verify handshaking theorem for the following digraph
➢ A graph has been coloured if colour is assigned to each vertex in such a way that
adjacent vertices have different colours.
➢Vertex colouring of a graph G is a mapping from f:V(G) to S.
Here pick a vertex color it green color the next vertex with red,
proceed the same way till you reach the fourth vertex. The fifth
vertex cannot be red or green so we need a third color say purple as
shown above.
What is the chromatic number of Kn?
No two vertices can be assigned the same color because every two
vertices of this graph are adjacent. Therefore the chromatic
number of Kn is n.
Example: K5
An edge colouring of G is a mapping from the edge set E(G) to the elements of S.
The edges of one colour form a colour class.
Weisstein, Eric W. "Edge Coloring." From MathWorld--A Wolfram Web Resource. http://mathworld.wolfram.com/EdgeColoring.html
Four color theorem:
The four color theorem, or the four color map theorem, states
that, given any separation of a plane into contigious regions,
producing a figure called a map, no more than four colors are
required to color the regions of the map so that no two adjacent
regions have the same color.
A connected graph without any circuits is called a tree. It is a simple graph and has
no loops and no parallel edges.
Definition of forest:
➢ An undirected graph is a tree, if and only if, there is a unique simple path between
every pair of vertices.
➢ Any connected graph with n vertices and n-1 edges is called a tree.
Basis step:If n=1, the number of vertices is one and the number of edges is zero.
Hence the theorem is true for n=1.
Induction step: For n=2, the number of vertices is 2 and edges is 1. Hence also true for n=2
Assume that the theorem is true for .
Consider a tree with k+1 vertices. Let eij be an edge of the tree connecting vi and vj. Since G
is a tree eij is the only edge of the tree connecting vi and vj.
G1 and G4 are trees, the other two graphs contain circuit and hence are not trees.
Property 4:
Any circuitless graph with n vertices and n-1 edges is a tree.
SPANNING TREES
Example:
Since G has three vertices any
spanning tree of G will also have
three vertices and hence two
edges.
This can be done in 3C2 ways
that is 3 ways as shown in the
figure.
Definition of spanning set: Let G=(V, E) be a connected
undirected graph. A spanning set for G is a subset F of E such that
(V, F) is connected.
Number of vertices is 6 .
Hence the number of edges to be considered is 5.
1-2 1 Yes -
6-3 2 Yes -
5-4 6 Yes -
1-3 9 Yes -
5-6 9 Yes -
The other spanning trees possible for the same graph are