A maximal matching is a matching in a graph to which no extra edge can be added while retaining all current selected edges. Equivalently, no edge joins two unmatched vertices in a matching; those vertices form an independent set. Every maximum cardinality matching is a maximal matching, but the converse fails.
Take the path graph with vertices and edges . A greedy algorithm that first selects the middle edge produces . Both remaining edges touch a matched vertex, so this size-one matching in a graph is maximal. Yet has two edges. No matching in a graph on four vertices has more than two edges, so is a maximum cardinality matching. The two remaining free vertices of , namely and , are not adjacent; that does not prevent a longer augmenting path in a matching from joining them.
Choosing the middle edge of P₄ gives a maximal matching of size one; the outer edges give a maximum cardinality matching of size two
. Details. Maximality is useful as a quick stopping rule and a modest guarantee. For any maximal matching and maximum cardinality matching in a finite simple graph, every edge of touches an endpoint of an edge of . Assign it to one such edge of . Since has disjoint endpoints, each edge of receives at most two assignments, proving . The P₄ example reaches equality. Thus maximality guarantees at least half the largest cardinality, but says nothing comparable about arbitrary edge benefits. Its selected endpoints also form a vertex cover, as explained under vertex cover.
A greedy matching starts with the empty matching in a graph, scans all edges in some order, and selects an edge exactly when both endpoints are unmatched vertices in a matching. For a finite graph, a complete scan returns a maximal matching: a rejected edge had a matched endpoint, which stays matched thereafter. Stopping before all edges have been considered need not give maximality. Changing the order can change the result; on P₄, middle-first gives one pair, whereas outer-first gives two. A greedy algorithm of this form never revisits its choices, while an augmenting path in a matching does.
Articles by others on the same topic
There are currently no matching articles.
