U-3 Class Notes
U-3 Class Notes
A Graph in which every edge is an undirected edge then it is called an Undirected graph.
Mixed Graph:
Some edges are directed and some are undirected.
Self Loop:
If there is an edge from Vi to Vj then that edge is called Self Loop
Parallel Edges:
If two edges have same end points then the edges are called Parallel edges.
Edge e6 is called self loop.The edge e3 and e4 are called edges
1
V1 e1 e6
V2
e2
e2
e3
V4 V3
e4
Simple graph:
A graph which has neither self loops nor parallel edges is called a simple graph.
Isolated Vertex:
A Graph having no edge incident on it is called an isolated vertex
V4 e3 V3
e4
e2
V5
V1 V2
e1
V5 is isolated vertex
Pseudo-graph:
A graph is called a pseudo-graph if it has both parallel edges and self loops.
2
Degree of a vertex:
The number of edges incident at the vertex vi is called the degree of the
vertex with self loops counted twice and it is denoted by d(vi)
Example:
v1 v2
v3
v4 v5
deg v1 = 2
deg v2 = 1
deg v3 = 6
deg v4 = 2
deg v5 = 3
Types of Graphs:
(i) Complete graph
A graph of n vertices having each pair of distinct vertices joined by an edge is called a
Complete graph and is denoted by Kn.
(ii)Bipartite Graph
A graph G is called a bipartite graph if V can be partitioned into two disjoint subsets V1
and V2 such that each edge of G has one end in V1 and another end in V2.
Example: The bipartite graph of K3,4 is
V1
V2
3
(iii) Complete Bipartite Graph
A complete bipartite graph is a bipartite graph with bipartition V1 and V2 in which each
vertex of V1 is joined by an edge to each vertex of V2, there should be no adjacent vertices
within V1 and V2. It is denoted by 𝐾𝑚,𝑛 .
Example. The complete bipartite graph of K3,4 is
V1
V2
Regular graph:
A graph in which each vertex has the same degree is called a regular graph. A regular graph
has k – regular if each vertex has degree k.
Connected graph:
A graph for which each pair of vertices is joined by a trail is called connected graph.
a b
c d
v1 v2
v6 v3
v5 v4
4
Handshaking theorem
If G = (V, E) is an undirected graph with e edges, then deg(vi ) = 2e
i
Proof:
Since every edge is incident with exactly two vertices
every edge contributes 2 to the sum of the degree of the vertices.
Therefore, all the e edges contribute (2e) to the sum of the degrees of the vertices.
Hence deg(vi ) = 2e .
i
5
2e = deg(v ) + deg(v ) .
vi v1
i
v j v2
j
How many edges are there in a graph with 10 vertices each of degree 7 ?
Answer:
n
deg(v ) = 2e
1
i
10 7 = 2e
2e = 70
e = 35
How many edges are there in a graph with ten vertices each of degree six.
Answer:
Let e be the number of edges of the graph
2e = sum of all degrees
= 10× 6
= 60
e=30
Therefore there are 30 edges.
Does a simple graph exist with the following degree sequence {3,3,3,3,2}. If yes draw
the graph.
Answer:
The degree sequence is 3,3,3,3,2
deg v i = 3+3+3+3+ 2
= 14 = even
The number of odd degree vertices is even.
6
Hence there is a graph with 5 vertices and with the given degree sequence.
n
If G is a simple graph with n vertices, show that if (G ) then G is connected where
2
(G ) is the minimum degree of the graph.
Answer:
Let G be a simple graph with n vertices.
To prove that G is connected
let u and v be any 2 distinct vertices
If uv is an edge in G then u-v path in G
Hence G is connected.
Suppose uv is not a path in G
X={set of all edges adjacent to u}
Y = {set of all edge adjacent to v}
u X v Y u, v X Y
X Y n − 2
n
X = deg(u ) (G )
2
n
Y = deg(v) (G )
2
𝑛 𝑛
|𝑋 ∪ 𝑌| ≥ + ≥𝑛−1
2 2
𝐴𝑙𝑠𝑜 |𝑋 ∪ 𝑌| = |𝑋| + |𝑌| − 𝑋 ∩ 𝑌
⇒ |𝑋 ∪ 𝑌| ≥ 1 ⇒ 𝑋 ∩ 𝑌 ≠ 𝜑
Therefore there exist a w∈ 𝑋 ∩ 𝑌
⇒ 𝑢𝑣𝑤 𝑖𝑠 𝑎 𝑝𝑎𝑡ℎ 𝑖𝑛 𝐺
G is connected
7
n2
Prove that for a bipartite graph with n vertices has a maximum of edges
4
Proof:
Let G be a bipartite graph with n vertices.let V1 and V2 be two bipartite set of G. let V1contain
x vertices and V2 (n-x) vertices
The largest number of edges of the graph can be obtained when each of the vertices in V1 is
connected to each of the vertices in V2
f ( x) = x(n − x)
f ( x) = n − 2 x
f ( x) = −2
n
f ( x) = 0 when x = and f ( x) 0
2
n
hence f(x) is maximum when x =
2
n n n n2
maximum edge required
f = n − =
2 2 2 4
Show that a simple graph G with n vertices is connected if it has more than
( n − 1)(n − 2)
edges.
2
Solution:
Suppose G is not connected. Then it has a component of k vertices for some k,
The most edges G could have is
k (k − 1) + (n − k )(n − k − 1)
C (k , 2) + C (n − k , 2) =
2
n −n
2
= k 2 − nk +
2
This quadratic function of f is minimized at k = n/2 and maximized at k = 1
or k = n – 1
Hence, if G is not connected, then the number of edges does not exceed the value of this
(n − 1)(n − 2)
function at 1 and at n-1, namely .
2
8
Prove that a simple graph with n vertices and k components can have at most
(n − k)(n − k + 1)
edges.
2
Proof:
Let G be graph with n vertices and k components
Let n1 , n 2 ,....n k be the no of vertices in each of k components of G
Then
n1 + n 2 + ....n k = n = v(G)
k
n i = n − − − − − − − −(1)
i =1
k
(n
i =1
i − 1) = (n1 − 1) + (n 2 − 1) + ....(n k − 1)
= n1 + n 2 ... + n k − 1 − 1....k
k
= ni − k
i =1
k
(n
i =1
i − 1) = n − k
(ni − 1) = n 2 − 2nk + k 2
k
i =1
k
(i.e) ( ni − 1) 2 n 2 − 2nk + k 2
i =1
k
n n 2 − 2nk + k 2 + 2n − k
2
i
i =1
Since G is simple
The maximum no of edges of G in its components is
n(n − 1)
2
Now the maximum number of edges in the ith component of
ni (ni − 1)
2
ni (ni − 1) 1 k 2 n
G= = ni −
2 2 i =1 2
(n − 2nk + k + 2n − k ) n
2 2
−
2 2
(n − k )(n − k + 1)
2
Hence simple graph with n vertices and k components can have at most
( n − k )( n − k + 1)
edges.
2
9
Adjacency matrix and Incidence matrix:
Let G = (V, E) be a graph with n vertices. Let V = v1 ,v2 ,...,vn . The n n matrix
1 if vi ,v j are adjacent
A = ( aij ) where aij =
0 otherwise
is called the adjacency matrix of the graph G.
Let 𝐺 = (𝑉, 𝐸) be an undirected graph with ‘n’ vertices V1 , V2 ,...Vn and m
edges e1 , e2 ,...em then n m matrix B = b where
ij
e3
e2 e4
e1
0 0 1 1 1 1 0 0
0 0 1 1 0 0 1 1
Adjacency matrix = Incident matrix =
1 1 0 0 1 0 0 1
1 1 0 0 0 1 1 0
Find the incidence matrix of
How many vertices does a regular graph of degree four with 10 edges have ?
Answer:
Given r = 4, q = 10
To find p:
We know that
2q = pr
2q 2(10) 20
p= = = =5
r 4 4
p=5
Self-complementary graph:
A simple graph 𝐺 is called self-complementary if 𝐺 and 𝐺 𝐶 are isomorphic.
𝐺 𝐺𝐶
If G is a self-complementary graph, then prove that G has 𝒏 ≡ 𝟎 (or) 1(mod 4)
vertices.
Proof:
Suppose G is be a self complementary graph with n-Vertices
C
Therefore no of edges of G and G are equal
then E G = E G − − − − − − − − − − − − − − (1)
C
11
So,
n(n − 1)
E G + E GC =
2
By equation (1)
n(n − 1)
E G +E G =
2
n(n − 1)
2E G =
2
n(n − 1)
EG =
4
n(n − 1)
Therefore no of edges of self complementary graph G is
4
n(n − 1)
(i.e) is an integer and one of n or n-1 is odd.
4
=> either n or n-1 is divisible by 4.
i.e., G is a self-complementary simple graph with n vertices,
Then 𝑛 ≡ 0 𝑜𝑟 1 (𝑚𝑜𝑑 4).
Isomorphism of two graphs:
Two graphs G1 = (V1, E1) and G2 = (V2, E2) are said to be isomorphic to each other, if
there exists a one-to-one correspondence between the vertex set.
Solution:
The given two graphs have
G H
Number of vertices 7 7
Number of edges 12 12
Degree Sequence of G and H
G H Deg Seq
v3 , v4 u6 , u4 1
12
v4 u2 2
v4 , v3 u4 , u6 3
v5 u5 , v5 4
v1 u6 5
v3 u2 6
Mapping:
(U 6 ) = V3 , (U1 ) = V7 , (U 2 ) = V2 ,
(U 7 ) = V1 , (U 3 ) = V6 , (U 5 ) = V5 (U 4 ) = V4
Adjacency matrix:
0 0 0 0 0 0 1 0 0 0 0 0 0 1
0 0 0 0 0 1 1 0 0 0 0 0 1 1
0 0 0 0 1 1 1 0 0 0 0 1 1 1
G = 0 0 0 0 1 1 1 H = 0 0 0 0 1 1 1
0 0 1 1 0 1 1 0 0 1 1 0 1 1
0 1 1 1 1 0 1 0 1 1 1 1 0 1
1 0 1 0
1 1 1 1 1 1 1 1 1 1
The Mapping G and H are isomorphic.
When do we say two simple graphs are isomorphic. Check whether the 2 graphs are
isomorphic or not justify your answer
Solution:
G H
Number of vertices 7 7
Number of edges 12 12
Degree seq
G H
V(G)={U1,U2,U3,U4,U5,U6} V(H)={V1,V2,V3,V4,V5,V6}
13
Deg(U1) = 1 Deg(V7) = 1
Deg(U2) = 2 Deg(V1) = 2
Deg(U3) = 4 Deg(V3) = 4
Deg(U4) = 4 Deg(V6) = 4
Deg(U5) = 6 Deg(V5) = 6
Deg(U6) = 5 Deg(V2) = 5
Deg(U7) = 4 Deg(V4) = 4
The Mapping is 𝜙: 𝐺 → 𝐻
𝜙(𝑈5 ) = 𝑉5 , 𝜙(𝑈6 ) = 𝑉2 , 𝜙(𝑈7 ) = 𝑉4 , 𝜙(𝑈3 ) = 𝑉3 , 𝜙(𝑈4 ) = 𝑉6 , 𝜙(𝑈2 ) = 𝑉1
𝜙(𝑈1 ) = 𝑉7
Adjacency matrix:
0 0 0 0 1 0 0 0 0 0 0 1 0 0
0 0 0 0 1 1 0 0 0 0 0 1 1 0
0 0 0 0 1 1 1 0 0 0 0 1 1 1
G = 0 0 0 0 1 1 1 H = 0 0 0 0 1 1 1
1 1 1 1 0 1 0 1 1 1 1 0 1 0
0 1 1 1 1 0 1 0 1 1 1 1 0 1
0 0 0 0
0 0 1 1 1 0 0 1 1 1
Are the simple graphs with the following adjacency matrices isomorphic?
0 1 0 0 0 1 0 1 0 0 0 1
1 0 1 0 1 0 1 0 1 0 0 1
0 1 0 1 0 1 0 1 0 1 1 0
0 0 1 0 1 0 0 0 1 0 1 0
0 1 0 1 0 1 0 0 1 1 0 1
1 0 1 0 1 0 1 1 0 0 1 0
Answer:
Two graphs G1 = (V1,E1) and G2 = (V2,E2) are the same or isomorphic, if there is a
bijection
F: V1 → V2 such that (u, v) E1 if and only if (F(u), F(v)) E2..
14
The given two graphs have
G1 G2
Number of vertices 6 6
Number of edges 8 8
Euler Graph:
Eulerian path:
A path of a graph G ia called an eulerian path, if it contains each of edge of the graph
exactly once.
Eulerian Circuit.
A circuit in a graph that includes each edge exactly once is called an Eulerian circuit.
Prove that a given connected graph G is Euler graph if and only if all vertices of G
are of even degree.
Proof:
Suppose G is an Euler graph.
G contains an Euler circuit.
G contains a closed walk covering all edges.
To prove:
All vertices of G is of even degree.
In training the closed walk, every time the walk meets a vertex v, it goes through two new
edges incident on V with one we ‘entered ‘ and other ‘exited’. This is true, for all vertices,
because it is a closed walk. Thus the degree of every vertex is even.
Conversely, suppose that all vertices of G are of even degree.
To prove:
G is an Euler graph.
(i.e) to prove: G contains an Euler circuit.
Construct a closed walk starting at an arbitrary vertex v and going through the edge of G
such that no edge is repeated. Because, each vertex is of even degree, we can exit from
each end, every vertex where we enter, the tracing can stop only at the vertex v. Name the
closed walk as h
15
Case (i) If h covers all edges of G, then h becomes an Euler line, and hence, G is an Euler
graph.
Case (ii) If h does not cover all edges of G then remove all edges of h from g and obtain
the remaining graph G ’. Because both G and G ‘ have all their vertex of even degree.
Every vertex in G ‘ is also of even degree.
Since G is connected, h will touch G ‘ atleast one vertex v ‘. Starting from v ‘, we can again
construct a new walk h ‘ in G ‘. This will terminate only at v ‘, because, every vertex in G ‘ is
also of even degree.
Now, this walk h’ combined with h forms a closed walk starts and ends at v and has more
edges than h. This process is repeated until we obtain a closed walk covering all edges of
G. Thus G is an Euler graph.
Hamiltonian Graph:
Hamiltonian path:
A path of a graph G is called an Hamiltonian path, if it contains each of vertex of the graph
exactly once.
Hamiltonian Circuit.
A circuit in a graph that includes each vertex exactly once is called an Hamiltonian circuit.
State the condition for Hamiltonian cycle.
Answer:
(i) Starting and ending vertex are same.
(ii)Cycle should contain all vertex of graph but exactly once
Let G be a simple undirected graph with n vertices. Let u and v be two non adjacent
vertices in G such that deg(u) + deg(v) ≥ n in G. Show that G is Hamiltonian if and only
if G + uv is Hamiltonian.
Answer:
If G is Hamiltonian, then obviously G + uv is also Hamiltonian.
Conversely, suppose that G + uv is Hamiltonian, but G is not Hamiltonian.
Then by Dirac theorem, we have
deg(u) + deg(v) < n
which is a contradiction
our assumption is wrong.
Thus G + uv is Hamiltonian implies G is Hamiltonian.
Give an example of a graph which is Eulerian but not Hamiltonian.
b d
c
a e
g f
16
b
c
a
d
Identify the Hamilton path and Hamilton cycle in the given graph ?
b
g
a h c
f
d
Solution:
Hamilton cycle of the given graph is a,b,c,d,e,h,g,f,a
Hence the graph is a Hamilton graph
Also it contains Hamilton path
Hamilton path is a,b,c,d,e,f,g,h
If G is a connected simple graph with n vertices with n 3, such that the degree of
𝒏
every vertex in G is at least 𝟐, then prove that G has Hamilton cycle.
Solution:
Suppose that the theorem is false, and let G be a maximal non Hamiltonian simple
𝒏
graph with n ≥ 3 and the degree of each vertex is atleast 𝟐.Since n ≥ 3 , G cannot be
complete.
Let u and v be non adjacent vertices in G, Since G is the maximal Non-Hamiltonian, G + uv
is Hamiltonion , each Hamilton cycle of G + uv must contain the edge uv.
Thus there is a Hamilton path v1 v2….. vn in G with origin u=vi and terminus v= vn
Let S={𝑣𝑖 ∈ 𝑉(𝐺)/ 〈𝑢, 𝑣 𝑖 + 1〉 ∈ 𝐸(𝐺)
And T={𝑣𝑖 ∈ 𝑉(𝐺)/ 〈𝑣𝑖, 𝑣〉 ∈ 𝐸(𝐺) where i=1 to n
Since vn ∉ S ∪ T we have |S ∪ T| < 𝑛 and |S ∪ T| = 0
Since if S∩T contains some vertex vi ,then G would have the Hamilton cycle v1 v2….., vn vn-
1…...vi+1 v1,
which is a contradiction to the assumption(fig)
Since |S ∪ T | < 𝑛 and |S ∩ T| = 0
we get d(u) + d(v) =|𝑆|+|𝑇|=|S ∪ T | + |S ∩ T| < 𝑛
17
𝒏
This also contradicts the hypothesis that the degree of the vertex is atleast
𝟐
18