Longest Path in a Graph: Difference between revisions

From NovaOrdis Knowledge Base
Jump to navigation Jump to search
Line 9: Line 9:


=Longest Path in a Directed Acyclic Graph=
=Longest Path in a Directed Acyclic Graph=
Topologically sort the directed acyclic graph:
{{Internal|Topological_Sort_of_a_Directed_Acyclic_Graph#Overview|Topological Sort of a Directed Acyclic Graph}}

Revision as of 04:41, 9 November 2021

External

Internal

Overview

The longest path problem is an NP-Hard problem for general graphs. However, the longest path can be computed on O(n) time for directed acyclic graphs.

Longest Path in a Directed Acyclic Graph

Topologically sort the directed acyclic graph:

Topological Sort of a Directed Acyclic Graph