V
- the graph vertex typeE
- the graph edge typepublic class GabowStrongConnectivityInspector<V,E> extends Object implements StrongConnectivityAlgorithm<V,E>
Constructor and Description |
---|
GabowStrongConnectivityInspector(DirectedGraph<V,E> directedGraph)
The constructor of GabowStrongConnectivityInspector class.
|
Modifier and Type | Method and Description |
---|---|
DirectedGraph<V,E> |
getGraph()
Returns the graph inspected
|
boolean |
isStronglyConnected()
Returns true if the graph instance is strongly connected.
|
List<Set<V>> |
stronglyConnectedSets()
|
List<DirectedSubgraph<V,E>> |
stronglyConnectedSubgraphs()
Computes a list of
DirectedSubgraph s of the given graph. |
public GabowStrongConnectivityInspector(DirectedGraph<V,E> directedGraph)
directedGraph
- the graph to inspectIllegalArgumentException
- in case the graph is nullpublic DirectedGraph<V,E> getGraph()
getGraph
in interface StrongConnectivityAlgorithm<V,E>
public boolean isStronglyConnected()
isStronglyConnected
in interface StrongConnectivityAlgorithm<V,E>
public List<Set<V>> stronglyConnectedSets()
List
of Set
s, where each set contains vertices which together form
a strongly connected component within the given graph.stronglyConnectedSets
in interface StrongConnectivityAlgorithm<V,E>
List
of Set
s containing the strongly connected componentspublic List<DirectedSubgraph<V,E>> stronglyConnectedSubgraphs()
Computes a list of DirectedSubgraph
s of the given graph. Each subgraph will represent
a strongly connected component and will contain all vertices of that component. The subgraph
will have an edge (u,v) iff u and v are contained in the strongly connected component.
NOTE: Calling this method will first execute
stronglyConnectedSets()
. If you don't need
subgraphs, use that method.
stronglyConnectedSubgraphs
in interface StrongConnectivityAlgorithm<V,E>
Copyright © 2017. All rights reserved.