Class IndexedStronglyConnectedComponentsAlgo

java.lang.Object
org.jhotdraw8.graph.algo.IndexedStronglyConnectedComponentsAlgo

public class IndexedStronglyConnectedComponentsAlgo extends Object
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 Details

    • IndexedStronglyConnectedComponentsAlgo

      public IndexedStronglyConnectedComponentsAlgo()
  • Method Details

    • findStronglyConnectedComponents

      public @NonNull List<IntList> findStronglyConnectedComponents(@NonNull IndexedDirectedGraph graph)
    • 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 graph
      nextNodeFunction - returns the next nodes of a given node
      Returns:
      set of strongly connected components (sets of vertices).