Module org.jgrapht.core
Package org.jgrapht.alg.connectivity
Class AbstractStrongConnectivityInspector<V,E>
java.lang.Object
org.jgrapht.alg.connectivity.AbstractStrongConnectivityInspector<V,E>
- Type Parameters:
V- the graph vertex typeE- the graph edge type
- All Implemented Interfaces:
StrongConnectivityAlgorithm<V,E>
- Direct Known Subclasses:
GabowStrongConnectivityInspector,KosarajuStrongConnectivityInspector
abstract class AbstractStrongConnectivityInspector<V,E>
extends Object
implements StrongConnectivityAlgorithm<V,E>
Base implementation of the strongly connected components algorithm.
-
Field Summary
Fields -
Constructor Summary
Constructors -
Method Summary
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, waitMethods inherited from interface org.jgrapht.alg.interfaces.StrongConnectivityAlgorithm
stronglyConnectedSets
-
Field Details
-
graph
-
stronglyConnectedSets
-
stronglyConnectedSubgraphs
-
-
Constructor Details
-
AbstractStrongConnectivityInspector
-
-
Method Details
-
getGraph
Description copied from interface:StrongConnectivityAlgorithmReturn the underlying graph.- Specified by:
getGraphin interfaceStrongConnectivityAlgorithm<V,E> - Returns:
- the underlying graph
-
isStronglyConnected
public boolean isStronglyConnected()Description copied from interface:StrongConnectivityAlgorithmReturns true if the graph is strongly connected, false otherwise.- Specified by:
isStronglyConnectedin interfaceStrongConnectivityAlgorithm<V,E> - Returns:
- true if the graph is strongly connected, false otherwise
-
getStronglyConnectedComponents
Description copied from interface:StrongConnectivityAlgorithmComputes a list of subgraphs 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.- Specified by:
getStronglyConnectedComponentsin interfaceStrongConnectivityAlgorithm<V,E> - Returns:
- a list of subgraphs representing the strongly connected components
-
getCondensation
Description copied from interface:StrongConnectivityAlgorithmCompute the condensation of the given graph. If each strongly connected component is contracted to a single vertex, the resulting graph is a directed acyclic graph, the condensation of the graph.- Specified by:
getCondensationin interfaceStrongConnectivityAlgorithm<V,E> - Returns:
- the condensation of the given graph
-