aryagraph.algorithms.matching.maximal_matching#

aryagraph.algorithms.matching.maximal_matching(g: Graph) → set[tuple[Hashable, Hashable]][source]#

A maximal matching (no edge can be added), greedily in edge order. O(m).

Its size is at least half the maximum; use max_weight_matching() with maxcardinality=True for a maximum one.