UNIT 3 GRAPHS Class Notes
UNIT 3 GRAPHS Class Notes
Define Graph.
A graph G = (V,E) consists of a finite non empty set V, the element of which are the
vertices of G, and a finite set E of unordered pairs of distinct elements of V called
the edges of G.
V1 e1 e6
V2
e2
e2
e3
V4 V3
e4
Edge e6 is called self loop.The edge e3 and e4 are called parallel edges
Page No: 1
Discrete Mathematics dept of mathematics
Defn:Incident:
If the vertex Vi is an end vertex of some edge ek then ek is said to be incident
with Vi
Define simple graph
A graph which has neither self loops nor parallel edges is called a simple graph.
e4
e2
V5
V1 V2
e1
V5 is isolated vertex
Define Pseudo-graph.
A graph is called a pseudo-graph if it has both parallel edges and self loops.
Defn :Digraph:
A Graph in which every edge is directed edge is called a Digraph
Defn Undigraph:
A Graph in which every edge is undirected edge is called a Undirected graph
Page No: 2
Discrete Mathematics dept of mathematics
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
Let G = (V,E) be a graph. G is bipartite graph if its vertex set V can be partitioned
into two nonempty disjoint subsets V1 and V2 , called a bipartition, such that each
edge has one end in V1 and in V2 . For eg C6
V2 V3
V1 V4
V6 V5
A1 A2
K2,3
B1 B2 B3
Page No: 3
Discrete Mathematics dept of mathematics
Example:
Page No: 4
Discrete Mathematics dept of mathematics
Define Subgraph.
A graph H = (V1,E1) is a subgraph of G = (V,E) provided that V1 ,E1 and for each e
E1 , both ends of e are in V1.
1.Find the subgraph of the following graph by deleting an edge.
Solution:
The subgraph by deleting the edge is shown below
Page No: 5
Discrete Mathematics dept of mathematics
(a)
𝑣1 𝑣2 𝑣3 𝑣4
𝑣1 0 1 1 0
𝑣 1 0 0 1
A=(𝑎𝑖𝑗)=𝑣 2 [ ]
3 1 0 0 1
𝑣4 0 1 1 0
(b)
𝑣1 𝑣2 𝑣3 𝑣4
𝑣1 0 1 0 0
𝑣 0 0 1 0]
A=(𝑎𝑖𝑗)=𝑣 2 [
3 1 1 0 0
𝑣4 0 1 1 0
(i) (ii)
Answer:
Page No: 6
Discrete Mathematics dept of mathematics
0 2 0 0 0 0
1 1 0 1 2 0 1 1 0 0
0 0 0 1 0 1 2 1 0 0
(i) 0 0 0 0 (ii) 0 1 1 2 0 0
1 0 1 0 0 0 0 0 0 3
0 0 0 1 3 0
1 e j directed fromv i
B 1 e directed fromv
0
ij j i
otherwise
Page No: 7
Discrete Mathematics dept of mathematics
Define Path:
A Path in a Graph is a Sequence v1 , v2 ,.....vk of vertices each adjacent to the next.
Defn:Cycle or Circuit:
A Path which originates and ends in the same node is called a Cycle or Circuit
Page No: 8
Discrete Mathematics dept of mathematics
A circuit in a graph that includes each edge exactly once, the circuit is called an
Eulerian circuit.
State the condition for Eulerian cycle.
Ans: (i) Starting and ending pts are same.
(ii) Cycle should contain all edges of graph but exactly once
PART-B
5.State and prove Handshaking Theorem.
If G = (V, E) is an undirected graph with e edges, then i deg(vi ) 2e
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
6.In any graph show that the number of odd vertices is even.
Proof:
Let G = (V, E) be the undirected graph. Let 𝑣1 and 𝑣2 be the set of vertices of G of
even and odd degrees respectively. Then by hand shaking theorem,
Page No: 9
Discrete Mathematics dept of mathematics
2e = deg(v ) deg(v ) .
vi v1
i
v j v2
j Since each deg(vi) is even, deg(v ) is even.
vi v1
i Since LHS
is even, we get deg(vj ) is even. Since each deg(vj) is odd, the number of terms
v j v2
contain in deg(v )j
v j v2
|𝑽(𝑮)|
7.If G is a simple graph with 𝜹(𝑮) ≥ then show that G is connected
𝟐
Page No: 10
Discrete Mathematics dept of mathematics
Then for n = k + 1, let G be a graph having n vertices and G be the graph obtained
from G, by deleting one vertex say, ‘v’ V(G).
k(k 1)
Since G has k vertices then by the hypothesis, G has atmost edges. Now add
2
the vertex v to G. ‘v’ may be adjacent to all the k vertices of G.
k(k 1) k (k 1)
Therefore the total number of edges in G are +k= .
2 2
Therefore the result is true for n = k+1.
n(n 1)
Hence, the maximum number of edges in a simple graph with ‘n’ vertices is .
2
9.Prove that a simple graph with at least two vertices has at least two vertices of
same degree.
Proof:
Let G be a simple graph with n 2 vertices.
The graph G has no loop and parallel edges. Hence the degree of each vertex
is n-1.
Suppose that all the vertices of G are of different degrees.
Following degrees 0, 1, 2, …, n-1 are possible for n vertices of G.
Let u be the vertex with degree 0. Then u is an isolated vertex.
Let v be the vertex with degree n-1 then v has n-1 adjacent vertices.
Page No: 11
Discrete Mathematics dept of mathematics
Because v is not an adjacent vertex of itself, therefore every vertex of G other than u
is an adjacent vertex of G.
Hence u cannot be an isolated vertex, this contradiction proves that simple graph
contains two vertices of same degree.
11.Prove that a graph G is connected if and only if for any partition of v into
subsets V1 and V2 there exists an edge joining a vertex of V 1 to a vertex of V2
Proof:
Let G be connected graph and V=V1 ∪ V2 be a partition of V into two subsets.
Let u ∈ V1 and v ∈ V2 .
Page No: 12
Discrete Mathematics dept of mathematics
Since the graph G is connected there exists a u-v path in G say u=v0,v1,v2,…..vn=v
Let I be the least positive integer such that vi ∈ V2
Conversely ,suppose for any partition of V into subsets V 1 and V2 there is an
edge joining a vertex of V1 to a vertex of V 2
Assume that G is disconnected .Then there exists at least two components in
G.Let V1 be the set of all vertices of a component of G and V 2 =V(G)-V1.Then any
edge joining one vertex in V1 and one vertex in V2.A contradiction to the hypothesis
Hence G is connected
12.If a graph G has exactly two vertices of odd degree, then prove that there is
a path joining these two vertices.
Proof:
Case (i): Let G be connected.
Let v1 and v2 be the only vertices of G with are of odd degree. But we know that
number of odd vertices is even. So clearly there is a path connecting v1 and v2,
because G is connected.
Case (ii): Let G be disconnected
Then the components of G are connected. Hence v1 and v2 should belong to the
same component of G. Hence, there is a path between v1 and v2.
13.If all the vertices of an undirected graph are each of degree k, show that the
number of edges of the graph is a multiple of k.
proof : Let 2n be the number of vertices of the given graph….(1)
Let ne be the number of edges of the given graph.
By Handshaking theorem, we have
Page No: 13
Discrete Mathematics dept of mathematics
2n
deg v 2n
i 1
i e
14.Show that a simple graph G with n vertices is connected if it has more than
(n 1)(n 2)
edges
2
Proof:
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
nn
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 function at 1 and at n-1, namely (n 1)(n 2) .
2
15.Prove that a simple graph with n vertices and k components can have at
( n k )( n k 1)
most edges.
2
Proof:
Let the number of vertices of the ith component of G be 𝑛𝑖, 𝑛𝑖 ≥ 1..
Page No: 14
Discrete Mathematics dept of mathematics
k k
n n (n 1) (n k)
i1
i
i1
i
k 2
Then
(ni 1) n 2 2nk k 2
i1
k
that is (ni 1) 2 n 2 2nk k 2 n
k
i2 n 2 2nk k 2 2n k
i1 i1
Solution:
The graphs G and G’ both have eight vertices and ten edges
In G ,degree (a)=2.
Since each of the vertices v2,v3,v6 and v7 is of deg 2 in G’
Therefore,a in G must correspond to either v2,v3,v6 and v7 of G’
Each of the vertices v2,v3,v6 and v7 in G’ are adjacent to another vertex of degree
2 in G’ ,which is not true for a in G
Therefore G and G’ are not isomorphic
17.Define isomorphism between two graphs. Are the simple graphs with the
following adjacency matrices isomorphic?
Page No: 15
Discrete Mathematics dept of mathematics
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..
Page No: 16
Discrete Mathematics dept of mathematics
Solution:
U1 V1
V1
U5 U2 V5 V4 V3
V2
U4 U3 V4 V3 V2 V5
G1 G2
V(G1)={U1,U2,U3,U4,U5} V(G2)={V1,V2,V3,V4,V5}
Deg(U1) = 2 Deg(V1) = 2
Deg(U2) = 2 Deg(V2) = 2
Deg(U3) = 2 Deg(V3) = 2
Deg(U4) = 2 Deg(V4) = 2
Deg(U5) = 2 Deg(V5) = 2
The Mapping is : G1 G2
U1 V1 , U 2 V3 , U 3 V5 , U 4 V2 , U 5 V4
The Mapping G1 and G2 are isomorphic.
Page No: 17
Discrete Mathematics dept of mathematics
19. Determine whether the following pairs of graph G and H are isomorphic
Solution:
Both the graph G and H have
(1) Same number of vertices (6)
(2) Same number of edges (7)
If f:u→v is defined as
u1→v2
u2→v3
u3→v4
u4→v1
u5→v5
u6→v6
Then the adjacency is preserved
∴ Given 2 graphs G and H are isomorphic.
20.Prove that a given connected graph G is Euler graph if and only if all
vertices of G are of even degree.
Answer:
Suppose G is an Euler graph.
G contains an Euler line
To prove:
All vertices of G is of even degree.
Page No: 18
Discrete Mathematics dept of mathematics
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 line.
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
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.
Page No: 19
Discrete Mathematics dept of mathematics
21. 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 n 2 , then prove that G has Hamilton
cycle
Answer:
We prove this theorem by contradiction. Suppose that the theorem is false and
let G be a non-Hamiltonian simple graph with 𝑛 ≥ 3, G cannot be complete. Let u
and v be non-adjacent vertices in G. By choice of G, G+uv is Hamiltonian simple
𝑛
graph with 𝑛 ≥ 3 and 𝛿 ≥ .
2
Let,
S vi / uvi1 E
T vi / viv E
Since
vn S T , wehave
S T n and S T 0
Since if S T contained some vertex vi , then G would have the Hamiltonian cycle
v1 , v2 , vi vnvn1 , vi v1 which is a contradiction.
Also, d (u) d (v) S T ST STn
𝒏
But this contradicts the hypothesis 𝜹 ≥ . Hence the theorem.
𝟐
22. Show that the complete bipartite graph Km,n with m,n ≥ 𝟐 is Hamiltonian if
and only if m=n .Also prove that the complete graph Kn is hamiltonian for all
n≥ 𝟑
Page No: 20
Discrete Mathematics dept of mathematics
Proof:
Assume m≠ 𝑛
Let H be a Hamiltonian cycle that goes through every vertex in Km,n
H = v0e0v1e1
Since Km,n is bipartite the cycle must alternate between the vertex on each side.
Since m≠ 𝑛 thereexist a va =vb a<b inside cycle H
Which is a contradiction
Hence complete bipartite graph Km,n has a hamiltonian cycle iff m = n
To prove that kn is Hamiltonian
Let u be any vertex of kn
Since kn is a complete graph, any 2 vertex can be joined
So we start from u and visit vertices in any order exactly once and come back to u
Hence there is a Hamiltonian cycle in kn
23.Let G be a simple indirected 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.
Solution:
If G is Hamiltonian, then obviously G + uv is also Hamiltonian.
Conversely, suppose that G + uv is Hamiltonian, but G is not. Then by Dirac
theorem, we have
deg(u) + deg(v) < n
which is a contradiction to our assumption.
Thus G + uv is Hamiltonian implies G is Hamiltonian.
Page No: 21
Discrete Mathematics dept of mathematics
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| < 𝑛
This also contradicts the hypothesis that the degree of the vertex is atleast 𝒏
𝟐
25.Show that Kn has a Hamiltonion cycle , for n>3,what is the maximum number
of edge disjoint Hamilton cycles possible in Kn. Obtain all the edge disjoint
.Hamilton cycles in K7.
Solution:
Page No: 22
Discrete Mathematics dept of mathematics
W.K.T If n ≥ 3 is odd integer ,then the complete graph Kn contains 𝑛−1 edge disjoint
2
Hamilton cycles
26.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 n2, then prove that G has Hamilton
cycle
Solution :
We prove this theorem by contradiction. Suppose that the theorem is false and let
G be a non-Hamiltonian simple graph with 𝑛 ≥ 3, G cannot be complete. Let u and
v be non-adjacent vertices in G. By choice of G, G+uv is Hamiltonian simple graph
𝑛
with 𝑛 ≥ 3 and ≥ .
2
Let,
Page No: 23
Discrete Mathematics dept of mathematics
S vi / uvi1 E
T vi / viv E
Since
vn S T , wehave
S T n and S T 0
Since if S T contained some vertex vi , then G would have the Hamiltonian cycle
v1 , v2 , vi vnvn1 , vi v1 which is a contradiction.
Also, d (u) d (v) S T ST STn
𝒏
But this contradicts the hypothesis 𝜹 ≥ .
𝟐
Page No: 24