This documents an unmaintained version of NetworkX. Please upgrade to a maintained version and see the current NetworkX documentation.

Directed Acyclic GraphsΒΆ

ancestors(G, source) Return all nodes having a path to source in G.
descendants(G, source) Return all nodes reachable from source in G.
topological_sort(G[, nbunch, reverse]) Return a list of nodes in topological sort order.
topological_sort_recursive(G[, nbunch, reverse]) Return a list of nodes in topological sort order.
is_directed_acyclic_graph(G) Return True if the graph G is a directed acyclic graph (DAG) or False if not.
is_aperiodic(G) Return True if G is aperiodic.
transitive_closure(G) Returns transitive closure of a directed graph
antichains(G) Generates antichains from a DAG.
dag_longest_path(G) Returns the longest path in a DAG
dag_longest_path_length(G) Returns the longest path length in a DAG