You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Finding the longest path that leads to a node in a graph is possible to do in linear time for the special case of DAGs.
19
+
Finding the longest path that leads to a node in a graph is possible to do in linear time for the special case of DAGs, that is graphs which do not contain cycles.
20
+
21
+
The GDS implementation for this problem is based on topological sort and operates in linear time.
22
+
When the graph is not a DAG, any node that belongs to component containing at least one cycle will be excluded from the results.
23
+
That is, the implementation will only give results for those components of the graph that form DAGs.
20
24
21
-
GDS implementation for this algorithm is based on topological sort and takes linear time.
22
-
If the graph is not a DAG, the runtime is still linear, but the results cannot be trusted.
23
25
You can use xref:algorithms/dag/topological-sort.adoc[topological sort] to make sure the graph is a DAG.
24
26
25
27
The algorithm supports weighted and unweighted graphs.
0 commit comments