Note

This is the documentation for the current state of the development branch of rustworkx. The documentation or APIs here can change prior to being released.

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