- dag_longest_path(G, weight='weight', default_weight=1, topo_order=None)¶
Returns the longest path in a directed acyclic graph (DAG).
Ghas edges with
weightattribute the edge data are used as weight values.
- GNetworkX DiGraph
A directed acyclic graph (DAG)
- weightstr, optional
Edge data key to use for weight
- default_weightint, optional
The weight of edges that do not have a weight attribute
- topo_order: list or tuple, optional
A topological order for G (if None, the function will compute one)
Gis not directed