Module org.jhotdraw8.graph
Package org.jhotdraw8.graph.algo
Class IndexedStronglyConnectedComponentsAlgo
java.lang.Object
org.jhotdraw8.graph.algo.IndexedStronglyConnectedComponentsAlgo
Computes the sets of strongly connected components in an indexed directed graph.
References:
- Stackoverflow. Non-recursive version of Tarjan's algorithm. Copyright Ivan Stoev. CC BY-SA 4.0 license.
- stackoverflow.com
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionfindStronglyConnectedComponents(int vertexCount, @NonNull Function<Integer, Enumerator.OfInt> nextNodeFunction) Returns all strongly connected components in the specified graph.
-
Constructor Details
-
IndexedStronglyConnectedComponentsAlgo
public IndexedStronglyConnectedComponentsAlgo()
-
-
Method Details
-
findStronglyConnectedComponents
-
findStronglyConnectedComponents
public @NonNull List<IntList> findStronglyConnectedComponents(int vertexCount, @NonNull Function<Integer, Enumerator.OfInt> nextNodeFunction) Returns all strongly connected components in the specified graph.- Parameters:
vertexCount- the vertices of the graphnextNodeFunction- returns the next nodes of a given node- Returns:
- set of strongly connected components (sets of vertices).
-