The oldest theorem in graph theory, and one of the simplest: the sum of all vertex degrees equals twice the number of edges. The reason is a single sentence — each edge has two ends, so it adds exactly 1 to two vertices’ degrees. Euler noticed it in 1736. A corollary follows for free and surprises people: the number of odd-degree vertices is always even (you cannot have an odd number of them). In social terms, at any party the number of people who have shaken an odd number of hands is even. The 5-edge graph here has degree-sum 10 = 2×5.
The demo sums the degrees of a 5-edge graph — the total is 10, exactly twice the edges: live demo
“Vertex degrees are unconstrained.” — their sum is exactly twice the edges, so the odd-degree count is always even. cited
Every edge counted twice in the degrees — so odd handshakers always come in pairs. theorem
On the canonical compiler, the 5-edge graph has degree-sum 10 = 2×5: