Interface TopologicalSort<T>
- Type Parameters:
T- graph node type
- Functional Interface:
- This is a functional interface and can therefore be used as the assignment target for a lambda expression or method reference.
Topological sorting procedure on a graph.
Each procedure returns some topological sorting of a graph as a list of nodes.
-
Method Summary
-
Method Details
-
dfs
Returns a topological sorting procedure which:uses depth-first search to visit nodes throws
IllegalStateExceptionwhen executed on a cyclic graph has runtime O(V + E), space O(V) (V = number of nodes, E = number of edges) -
apply
-