Handshaking Theorem
e1 e6
1 e2 2
e3 e4 e5 e7
3 4
There are two ways to count the number of edges in
the above graph:
1. Just count the set of edges: 7
2. Count seeming edges vertex by vertex and
divide by 2 because double-counted edges:
( deg(1)+deg(2)+deg(3)+deg(4) )/2 =
(3+7+2+2)/2 = 14/2 = 7
1
Handshaking Theorem
THM: In an undirected graph
1
| E | deg(e)
2 eE
In a directed graph
|E| deg
eE
(e) deg
eE
( e)
Q: In a party of 5 people can each person be
friends with exactly three others?
2
Handshaking Theorem
A: Imagine a simple graph with 5 people as
vertices and edges being undirected edges
between friends (simple graph assuming
friendship is symmetric and irreflexive).
Number of friends each person has is the
degree of the person.
Handshaking would imply that
|E | = (sum of degrees)/2 or
2|E | = (sum of degrees) = (5·3) = 15.
Impossible as 15 is not even. In general:
3
Handshaking Theorem
Lemma: The number of vertices of odd degree
must be even in an undirected graph.
Proof : Otherwise would have
2|E | = Sum of even no.’s
+ an odd number of odd no.’s
even = even + odd
–this is impossible.
4
Example of Handshaking Theorem
• Draw a graph with 4 edges and 4 vertices , having degrees
1,2,3,4.
• Solution: No such graph exists. The sum of the degrees of
all the vertices should be equal to twice the number of
edges. Half of the sum of the degrees is 5, which is not
equal to actual number of edges required in the question
(4).
• (1+2+3+4)/2 = 5, 5 =/= 4.
5
Theorem: Every graph with n vertices and k edges has
at least n-k components
Proof:
– An n-vertex graph with no edges has n
components
– Each edge added reduces this by at most 1
– If k edges are added, then the number of
components is at least n - k
6
Theorem: Every graph with n vertices and k edges has
at least n-k components
• Examples:
n =2, k =1, n =3, k =2, n =6, k =3, n =6, k =3,
1 component 1 component 3 components 4 components