dag_longest_path(G, weight='weight', default_weight=1)¶
Returns the longest path in a directed acyclic graph (DAG).
Ghas edges with
weightattribute the edge data are used as weight values.
- G (NetworkX DiGraph) – A directed acyclic graph (DAG)
- weight (str, optional) – Edge data key to use for weight
- default_weight (int, optional) – The weight of edges that do not have a weight attribute
Gis not directed