V - the graph vertex typeE - the graph edge typepublic class KosarajuStrongConnectivityInspector<V,E> extends Object
Unlike ConnectivityInspector, this class does not implement incremental inspection. The
full algorithm is executed at the first call of
stronglyConnectedSets() or
AbstractStrongConnectivityInspector.isStronglyConnected().
| Modifier and Type | Field and Description |
|---|---|
protected Graph<V,E> |
graph |
protected List<Set<V>> |
stronglyConnectedSets |
protected List<Graph<V,E>> |
stronglyConnectedSubgraphs |
| Constructor and Description |
|---|
KosarajuStrongConnectivityInspector(Graph<V,E> graph)
Constructor
|
| Modifier and Type | Method and Description |
|---|---|
Graph<Graph<V,E>,DefaultEdge> |
getCondensation()
Compute the condensation of the given graph.
|
Graph<V,E> |
getGraph()
Return the underlying graph.
|
List<Graph<V,E>> |
getStronglyConnectedComponents()
Computes a list of subgraphs of the given graph.
|
boolean |
isStronglyConnected()
Returns true if the graph is strongly connected, false otherwise.
|
List<Set<V>> |
stronglyConnectedSets()
|
protected final Graph<V,E> graph
public KosarajuStrongConnectivityInspector(Graph<V,E> graph)
graph - the input graphNullPointerException - if the input graph is nullpublic List<Set<V>> stronglyConnectedSets()
StrongConnectivityAlgorithmList of Sets, where each set contains vertices which together form
a strongly connected component within the given graph.List of Set s containing the strongly connected componentspublic Graph<V,E> getGraph()
StrongConnectivityAlgorithmgetGraph in interface StrongConnectivityAlgorithm<V,E>public boolean isStronglyConnected()
StrongConnectivityAlgorithmisStronglyConnected in interface StrongConnectivityAlgorithm<V,E>public List<Graph<V,E>> getStronglyConnectedComponents()
StrongConnectivityAlgorithmgetStronglyConnectedComponents in interface StrongConnectivityAlgorithm<V,E>public Graph<Graph<V,E>,DefaultEdge> getCondensation()
StrongConnectivityAlgorithmgetCondensation in interface StrongConnectivityAlgorithm<V,E>Copyright © 2018. All rights reserved.