- java.lang.Object
-
- net.automatalib.util.graph.scc.SCCs
-
public final class SCCs extends Object
Algorithms for finding strongly-connected components (SCCs) in a graph.
-
-
Method Summary
All Methods Static Methods Concrete Methods Modifier and Type Method Description static <N,E>
List<List<N>>collectSCCs(Graph<N,E> graph)
Collects all strongly-connected components in a graph.static <N,E>
voidfindSCCs(Graph<N,E> graph, SCCListener<N> listener)
Find all strongly-connected components in a graph.
-
-
-
Method Detail
-
collectSCCs
public static <N,E> List<List<N>> collectSCCs(Graph<N,E> graph)
Collects all strongly-connected components in a graph. The SCCs are returned as a list of lists.Tarjan's algorithm is used for realizing the SCC search.
- Type Parameters:
N
- node typeE
- edge type- Parameters:
graph
- the graph- Returns:
- a list of all SCCs, each represented as a list of its nodes
- See Also:
TarjanSCCVisitor
-
findSCCs
public static <N,E> void findSCCs(Graph<N,E> graph, SCCListener<N> listener)
Find all strongly-connected components in a graph. When a new SCC is found, theSCCListener.foundSCC(java.util.Collection)
method is invoked. The listener object may hence not be null.Tarjan's algorithm is used for realizing the SCC search.
- Type Parameters:
N
- node typeE
- edge type- Parameters:
graph
- the graphlistener
- the SCC listener- See Also:
TarjanSCCVisitor
-
-