rustworkx.is_directed_acyclic_graph#

is_directed_acyclic_graph(graph, /)#

Check that the PyDiGraph or PyDAG doesn’t have a cycle

Parameters:

graph (PyDiGraph) – The graph to check for cycles

Returns:

True if there are no cycles in the input graph, False if there are cycles

Return type:

bool