Matchings in multigraphs #
A matching in a multigraph is a set of actual edge identities with no loops and no two distinct members incident to a common vertex. Thus parallel edges remain distinct choices, but at most one of them can belong to a matching. A perfect matching is incident to every actual vertex.
The graph Graph.matchingSubgraph G M has exactly the edges selected by M and exactly their
endpoints as vertices. It has no isolated vertices, and Graph.IsMatching is equivalent to this
subgraph being loopless with exactly one incident edge at every one of its vertices. Perfectness
is equivalently the assertion that this canonical subgraph is spanning. This connects the
edge-set representation, convenient for deleting and partitioning multigraph edges, with the
subgraph viewpoint used by Mathlib for simple-graph matchings.
A matching of a subgraph is a matching of the whole graph, and a perfect matching of a spanning subgraph is a perfect matching of the whole graph. Deleting a perfect matching lowers the incidence count of every actual vertex with finitely many incident edges by exactly one; this is the step that splits the edge set of a regular bipartite multigraph into perfect matchings.
Main definitions #
Graph.IsMatching G M: the actual edges inMform a matching.Graph.IsPerfectMatching G M:Mis a matching incident to every actual vertex.Graph.matchingSubgraph G M: the subgraph containing precisely the selected edges and their endpoints.
Main results #
Graph.IsPerfectMatching.image_inclusion: a perfect matching of a spanning subgraph is a perfect matching of the whole graph.Graph.IsPerfectMatching.incidenceCount_deleteEdges_add_one: deleting a perfect matching lowers by one the incidence count of every actual vertex with finitely many incident edges.
The empty set of edges is a matching.
A subset of a matching is a matching.
A matching is perfect exactly when every actual vertex is incident to a unique selected edge.
Every endpoint of a selected actual edge is an actual vertex.
Enlarging the selected edge set enlarges its vertex support.
The empty edge set has empty vertex support.
The canonical subgraph construction remembers the selected set of actual edges.
Selecting no edges gives the empty graph.
Every vertex of the canonical graph of selected edges is incident to one of its edges.
A matching gives a loopless canonical subgraph.
In the canonical subgraph of a matching, every vertex has a unique incident edge.
The edge-set definition of a matching is equivalent to saying that its canonical subgraph is loopless and has exactly one incident edge at every vertex.
A matching is perfect exactly when its canonical subgraph is spanning.
The unique edge of a two-vertex single-edge multigraph is a perfect matching.
Subgraphs and edge deletion #
A matching of a subgraph is a matching of the whole graph.
A perfect matching of a spanning subgraph is a perfect matching of the whole graph.
Exactly one edge of a perfect matching is incident with each actual vertex.
Deleting a perfect matching lowers the incidence count of every actual vertex with finitely many incident edges by exactly one.