Handshaking Lemma

1 min read Updated Fri Apr 24 2026 03:19:45 GMT+0000 (Coordinated Universal Time)

Describes the relationship between vertex degrees and edges in a graph. Each edge contributes 1 to the degree of each of its endpoints, leading to a fundamental counting principle.

For all the definitions below, consider a graph GG with nn vertices and mm edges.

For Simple Graphs

Sum of all vertex degrees equals twice the number of edges.

i=1ndeg(vi)=2m\sum_{i=1}^{n} \deg(v_i) = 2m

Applies for connected components as well.

Corollary

The number of vertices with odd degree is always even.

For Digraphs

Sum of in-degrees equals sum of out-degrees, both equal to the number of edges.

i=1nindeg(vi)=i=1noutdeg(vi)=m\sum_{i=1}^{n} \text{indeg}(v_i) = \sum_{i=1}^{n} \text{outdeg}(v_i) = m