Skip to content

Commit

Permalink
"Cannot be trusted" rewrite
Browse files Browse the repository at this point in the history
  • Loading branch information
IoannisPanagiotas committed Oct 26, 2023
1 parent 9a142d4 commit 2c8b104
Showing 1 changed file with 5 additions and 3 deletions.
8 changes: 5 additions & 3 deletions doc/modules/ROOT/pages/algorithms/dag/longest-path.adoc
Original file line number Diff line number Diff line change
Expand Up @@ -16,10 +16,12 @@ include::partial$/operations-reference/alpha-note.adoc[]

== Introduction

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.
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.

The GDS implementation for this problem is based on topological sort and operates in linear time.
When the graph is not a DAG, any node that belongs to component containing at least one cycle will be excluded from the results.
That is, the implementation will only give results for those components of the graph that form DAGs.

GDS implementation for this algorithm is based on topological sort and takes linear time.
If the graph is not a DAG, the runtime is still linear, but the results cannot be trusted.
You can use xref:algorithms/dag/topological-sort.adoc[topological sort] to make sure the graph is a DAG.

The algorithm supports weighted and unweighted graphs.
Expand Down

0 comments on commit 2c8b104

Please sign in to comment.