The handshake lemma for list multigraphs #
For a finite multigraph given by an edge list H : List (α × α) (parallel edges and self-loops
allowed, Cslib.Algorithms.Lean.Euler.degree counting a self-loop twice), the degrees sum to twice
the number of edges, so an even number of vertices have odd degree. Christofides' algorithm uses
this to find a perfect matching on the odd-degree vertices of a spanning tree
([WS11], Section 2.4).
Mathlib's SimpleGraph.sum_degrees_eq_twice_card_edges and
SimpleGraph.even_card_odd_degree_vertices prove the same for simple graphs; the statements here
cover the list multigraphs of Cslib.Algorithms.Lean.Euler.
Main results #
sum_map_degree: summed over a duplicate-free list of vertices containing every endpoint, the degrees count each edge twice.even_length_filter_odd_degree: the handshake lemma; such a list has an even number of entries of odd degree.
References #
Degree sum for list multigraphs: summed over a duplicate-free list of vertices containing every endpoint, the degrees count each edge twice.
The handshake lemma for list multigraphs: among the vertices of a duplicate-free list containing every endpoint, an even number have odd degree.