Handshaking lemma
Introduction / Definition
The handshaking lemma states that the sum of the degrees of all vertices in an undirected graph equals twice the number of edges. Each edge contributes exactly two endpoint incidences. It gives an immediate parity result: the number of odd-degree vertices is even. The lemma is useful for checking graph calculations.
Syntax / Mathematical Form
Σ_{v∈V}deg(v)=2|E|
Detailed Explanation
Count all degrees and compare with twice the number of edges. Because the right side is even, the degree sum is always even. Therefore odd-degree vertices occur in pairs in terms of count.
Example / Worked Example
Triangle: degrees are 2,2,2. Sum=6=2×3.
Output / Result
Both sides equal 6.
Important Points / Notes
- Degree sum is always even.
- Odd-degree vertex count is even.
- Applies to undirected graphs with standard degree definitions.
Mini Practice Question
A graph has 5 edges. What is the sum of its vertex degrees?