rustworkx.is_matching#

is_matching(graph, matching, /)#

Check if matching is valid for graph

A matching in a graph is a set of edges in which no two distinct edges share a common endpoint.

Parameters:
  • graph (PyDiGraph) – The graph to check if the matching is valid for

  • matching (set) – A set of node index tuples for each edge in the matching.

Returns:

Whether the provided matching is a valid matching for the graph

Return type:

bool