Handshaking lemma explained

In graph theory, a branch of mathematics, the handshaking lemma is the statement that, in every finite undirected graph, the number of vertices that touch an odd number of edges is even. For example, if there is a party of people who shake hands, the number of people who shake an odd number of other people's hands is even. The handshaking lemma is a consequence of the degree sum formula, also sometimes called the handshaking lemma, according to which the sum of the degrees (the numbers of times each vertex is touched) equals twice the number of edges in the graph. Both results were proven by in his famous paper on the Seven Bridges of Königsberg that began the study of graph theory.

Beyond the Seven Bridges of Königsberg Problem, which subsequently formalized Eulerian Tours, other applications of the degree sum formula include proofs of certain combinatorial structures. For example, in the proofs of Sperner's lemma and the mountain climbing problem the geometric properties of the formula commonly arise. The complexity class PPA encapsulates the difficulty of finding a second odd vertex, given one such vertex in a large implicitly-defined graph.

Definitions and statement

\deg(v)

of a vertex

v

is defined as the number of edges that have

v

as an endpoint. For graphs that are allowed to contain loops connecting a vertex to itself, a loop should be counted as contributing two units to the degree of its endpoint for the purposes of the handshaking lemma. Then, the handshaking lemma states that, in every finite graph, there must be an even number of vertices for which

\deg(v)

is an odd number. The vertices of odd degree in a graph are sometimes called odd nodes (or odd vertices); in this terminology, the handshaking lemma can be rephrased as the statement that every graph has an even number of odd nodes.

The degree sum formula states that\sum_ \deg v = 2|E|,where

V

is the set of nodes (or vertices) in the graph and

E

is the set of edges in the graph. That is, the sum of the vertex degrees equals twice the number of edges. In directed graphs, another form of the degree-sum formula states that the sum of in-degrees of all vertices, and the sum of out-degrees, both equal the number of edges. Here, the in-degree is the number of incoming edges, and the out-degree is the number of outgoing edges. A version of the degree sum formula also applies to finite families of sets or, equivalently, multigraphs: the sum of the degrees of the elements (where the degree equals the number of sets containing it) always equals the sum of the cardinalities of the sets.

Both results also apply to any subgraph of the given graph and in particular to its connected components. A consequence is that, for any odd vertex, there must exist a path connecting it to another odd vertex.

Applications

Euler paths and tours

Leonhard Euler first proved the handshaking lemma in his work on the Seven Bridges of Königsberg, asking for a walking tour of the city of Königsberg (now Kaliningrad) crossing each of its seven bridges once. This can be translated into graph-theoretic terms as asking for an Euler path or Euler tour of a connected graph representing the city and its bridges: a walk through the graph that traverses each edge once, either ending at a different vertex than it starts in the case of an Euler path or returning to its starting point in the case of an Euler tour. Euler stated the fundamental results for this problem in terms of the number of odd vertices in the graph, which the handshaking lemma restricts to be an even number. If this number is zero, an Euler tour exists, and if it is two, an Euler path exists. Otherwise, the problem cannot be solved. In the case of the Seven Bridges of Königsberg, the graph representing the problem has four odd vertices, and has neither an Euler path nor an Euler tour. It was therefore impossible to tour all seven bridges in Königsberg without repeating a bridge.

In the Christofides–Serdyukov algorithm for approximating the traveling salesperson problem, the geometric implications of the degree sum formula plays a vital role, allowing the algorithm to connect vertices in pairs in order to construct a graph on which an Euler tour forms an approximate TSP tour.[1]

Combinatorial enumeration

Several combinatorial structures may be shown to be even in number by relating them to the odd vertices in an appropriate "exchange graph".

G

there must be an even number of Hamiltonian cycles through any fixed edge

uv

; these are cycles that pass through each vertex exactly once. used a proof based on the handshaking lemma to extend this result to graphs in which all vertices have odd degree. Thomason defines an exchange graph the vertices of which are in one-to-one correspondence with the Hamiltonian paths in

G

beginning at

u

and continuing through edge

uv

. Two such paths

p1

and

p2

are defined as being connected by an edge in

H

if one may obtain

p2

by adding a new edge to the end of

p1

and removing another edge from the middle of

p1

. This operation is reversible, forming a symmetric relation, so

H

is an undirected graph. If path

p

ends at vertex then the vertex corresponding to

p

in

H

has degree equal to the number of ways that

p

may be extended by an edge that does not connect back to

u

; that is, the degree of this vertex in

H

is either

\deg(w)-1

(an even number) if

p

does not form part of a Hamiltonian cycle through or

\deg(w)-2

(an odd number) if

p

is part of a Hamiltonian cycle through

uv

. Since

H

has an even number of odd vertices,

G

must have an even number of Hamiltonian cycles through

uv

.

Other applications

The handshaking lemma (or degree sum formula) are also used in proofs of several other results in mathematics. These include the following:

Proof

Euler's proof of the degree sum formula uses the technique of double counting: he counts the number of incident pairs

(v,e)

where

e

is an edge and vertex

v

is one of its endpoints, in two different ways. Vertex

v

belongs to

\deg(v)

pairs, where

\deg(v)

(the degree of

v

) is the number of edges incident to it. Therefore, the number of incident pairs is the sum of the degrees. However, each edge in the graph belongs to exactly two incident pairs, one for each of its endpoints; therefore, the number of incident pairs is

2|E|

. Since these two formulas count the same set of objects, they must have equal values. The same proof can be interpreted as summing the entries of the incidence matrix of the graph in two ways, by rows to get the sum of degrees and by columns to get twice the number of edges.

For graphs, the handshaking lemma follows as a corollary of the degree sum formula. In a sum of integers, the parity of the sum is not affected by the even terms in the sum; the overall sum is even when there is an even number of odd terms, and odd when there is an odd number of odd terms. Since one side of the degree sum formula is the even number the sum on the other side must have an even number of odd terms; that is, there must be an even number of odd-degree vertices.

Alternatively, it is possible to use mathematical induction to prove the degree sum formula, or to prove directly that the number of odd-degree vertices is even, by removing one edge at a time from a given graph and using a case analysis on the degrees of its endpoints to determine the effect of this removal on the parity of the number of odd-degree vertices.

In special classes of graphs

Regular graphs

The degree sum formula implies that every

r

-regular graph with

n

vertices has

nr/2

edges. Because the number of edges must be an integer, it follows that when

r

is odd the number of vertices must be even. Additionally, for odd values the number of edges must be divisible

Bipartite and biregular graphs

A bipartite graph has its vertices split into two subsets, with each edge having one endpoint in each subset. It follows from the same double counting argument that, in each subset, the sum of degrees equals the number of edges in the graph. In particular, both subsets have equal degree sums. For biregular graphs, with a partition of the vertices into subsets

V1

and

V2

with every vertex in a subset

Vi

having degree

ri

, it must be the case that

|V1|r1=|V2|r2

; both equal the number of edges.

Infinite graphs

The handshaking lemma does not apply in its usual form to infinite graphs, even when they have only a finite number of odd-degree vertices. For instance, an infinite path graph with one endpoint has only a single odd-degree vertex rather than having an even number of such vertices. However, it is possible to formulate a version of the handshaking lemma using the concept of an end, an equivalence class of semi-infinite paths ("rays") considering two rays as equivalent when there exists a third ray that uses infinitely many vertices from each of them. The degree of an end is the maximum number of edge-disjoint rays that it contains, and an end is odd if its degree is finite and odd. More generally, it is possible to define an end as being odd or even, regardless of whether it has infinite degree, in graphs for which all vertices have finite degree. Then, in such graphs, the number of odd vertices and odd ends, added together, is either even or infinite.

Subgraphs

By a theorem of Gallai the vertices of any graph can be decomposed as

V=Ve\cupVo

where

G(Ve)

has all degree even and

G(Vo)

has all degree odd with

|Vo|

even by the handshaking lemma. In 1994 Yair Caro[2] proved that

|Vo|/|V|>1/\sqrt{n}

and in 2021 a preprint by Ferber Asaf and Michael Krivelevich showed that

|Vo|/|V|>1/10000

.[3] [4]

Computational complexity

See main article: PPA (complexity). In connection with the exchange graph method for proving the existence of combinatorial structures, it is of interest to ask how efficiently these structures may be found. For instance, suppose one is given as input a Hamiltonian cycle in a cubic graph; it follows from Smith's theorem that there exists a second cycle. How quickly can this second cycle be found? investigated the computational complexity of questions such as this, or more generally of finding a second odd-degree vertex when one is given a single odd vertex in a large implicitly-defined graph. He defined the complexity class PPA to encapsulate problems such as this one; a closely related class defined on directed graphs, PPAD, has attracted significant attention in algorithmic game theory because computing a Nash equilibrium is computationally equivalent to the hardest problems in this class.

Computational problems proven to be complete for the complexity class PPA include computational tasks related to Sperner's lemma and to fair subdivision of resources according to the Hobby–Rice theorem.

Notes and References

  1. . The handshaking lemma is cited at the top of page 2.
  2. Caro . Yair . 15 September 1994 . On induced subgraphs with odd degrees . Discrete Mathematics . en . 132 . 1–3 . 23–28 . 10.1016/0012-365X(92)00563-7. free .
  3. Ferber . Asaf . Krivelevich . Michael . 2020 . Every graph contains a linearly sized induced subgraph with all degrees odd . math.CO . 2009.05495.
  4. Web site: Honner . Patrick . 2022-03-24 . What a Math Party Game Tells Us About Graph Theory . 2022-03-27 . Quanta Magazine . en.