networkx.algorithms.dag.is_directed_acyclic_graph

is_directed_acyclic_graph(G)[source]

Returns True if the graph G is a directed acyclic graph (DAG) or False if not.

Parameters
GNetworkX graph
Returns
bool

True if G is a DAG, False otherwise