Package org.graph4j.connectivity
Class TarjanBiconnectivity
java.lang.Object
org.graph4j.SimpleGraphAlgorithm
org.graph4j.connectivity.TarjanBiconnectivity
- All Implemented Interfaces:
BiconnectivityAlgorithm
The algorithm for computing biconnected components in a connected undirected
graph is due to John Hopcroft and Robert Tarjan (1973). It runs in linear
time, and is based on depth-first search.
A block is a maximal 2-connected subgraph.
- Author:
- Cristian Frăsinaru
-
Field Summary
Fields inherited from class org.graph4j.SimpleGraphAlgorithm
graph -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionA block of a graph is a maximal 2-connected subgraph (it has no cut vertex).A cut vertex (cut point, articulation point, separating point) is any vertex whose removal increases the number of connected components.booleanA graph is biconnected if it has no cut vertex.Methods inherited from class org.graph4j.SimpleGraphAlgorithm
getGraphMethods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, waitMethods inherited from interface org.graph4j.connectivity.BiconnectivityAlgorithm
computeBlockCutTree, computeBlockGraph
-
Constructor Details
-
TarjanBiconnectivity
-
-
Method Details
-
isBiconnected
public boolean isBiconnected()Description copied from interface:BiconnectivityAlgorithmA graph is biconnected if it has no cut vertex.- Specified by:
isBiconnectedin interfaceBiconnectivityAlgorithm- Returns:
trueif the graph is 2-connected.
-
getCutVertices
Description copied from interface:BiconnectivityAlgorithmA cut vertex (cut point, articulation point, separating point) is any vertex whose removal increases the number of connected components.- Specified by:
getCutVerticesin interfaceBiconnectivityAlgorithm- Returns:
- the set of cut vertices.
-
getBlocks
Description copied from interface:BiconnectivityAlgorithmA block of a graph is a maximal 2-connected subgraph (it has no cut vertex).- Specified by:
getBlocksin interfaceBiconnectivityAlgorithm- Returns:
- the blocks of the graph.
-