petgraph::algo::matching

Function greedy_matching

Source
pub fn greedy_matching<G>(graph: G) -> Matching<G>
Expand description

[Generic] Compute a matching using a greedy heuristic.

The input graph is treated as if undirected. The underlying heuristic is unspecified, but is guaranteed to be bounded by O(|V| + |E|). No guarantees about the output are given other than that it is a valid matching.

If you require a maximum matching, use maximum_matching function instead.