Warning

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

dag_longest_path

dag_longest_path(G)[source]

Returns the longest path in a DAG

Parameters:G (NetworkX DiGraph) – Graph
Returns:path – Longest path
Return type:list
Raises:NetworkXNotImplemented – If G is not directed