Function retworkx::is_maximal_matching [−][src]
pub fn is_maximal_matching(
graph: &PyGraph,
matching: HashSet<(usize, usize)>
) -> bool
Check if a matching is a maximal (not maximum) matching for a graph
A maximal matching in a graph is a matching in which adding any edge would cause the set to no longer be a valid matching.
.. note::
This is not checking for a maximum (globally optimal) matching, but a maximal (locally optimal) matching.
:param PyDiGraph graph: The graph to check if the matching is maximal for. :param set matching: A set of node index tuples for each edge in the matching.
:returns: Whether the provided matching is a valid matching and whether it is maximal or not. :rtype: bool