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<DirectedSubgraph<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()
|
List<DirectedSubgraph<V,E>> |
stronglyConnectedSubgraphs()
Deprecated.
|
protected final Graph<V,E> graph
protected List<DirectedSubgraph<V,E>> stronglyConnectedSubgraphs
public KosarajuStrongConnectivityInspector(Graph<V,E> graph)
graph
- the input graphNullPointerException
- if the input graph is nullpublic List<Set<V>> stronglyConnectedSets()
StrongConnectivityAlgorithm
List
of Set
s, 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()
StrongConnectivityAlgorithm
getGraph
in interface StrongConnectivityAlgorithm<V,E>
public boolean isStronglyConnected()
StrongConnectivityAlgorithm
isStronglyConnected
in interface StrongConnectivityAlgorithm<V,E>
@Deprecated public List<DirectedSubgraph<V,E>> stronglyConnectedSubgraphs()
StrongConnectivityAlgorithm
stronglyConnectedSubgraphs
in interface StrongConnectivityAlgorithm<V,E>
public List<Graph<V,E>> getStronglyConnectedComponents()
StrongConnectivityAlgorithm
getStronglyConnectedComponents
in interface StrongConnectivityAlgorithm<V,E>
public Graph<Graph<V,E>,DefaultEdge> getCondensation()
StrongConnectivityAlgorithm
getCondensation
in interface StrongConnectivityAlgorithm<V,E>
Copyright © 2017. All rights reserved.