Interface KVertexConnectedComponentsAlgo
- All Known Implementing Classes:
KVertexConnectedComponentsAlgoAbstract
,KVertexConnectedComponentsWhiteMoody
Given a graph \(G = (V, E)\) and an integer \(k\), we say that \(G\) is k-vertex connected if it has at least \(k + 1\) vertices and remains connected after removing any \(k - 1\) vertices. If \(G\) is a clique of size \(k + 1\), then \(G\) is k-vertex connected. The k-vertex connected components of \(G\) are the maximal k-vertex connected subgraphs of \(G\). Note that for a general \(k\), the k-vertex connected components of a graph are not disjoint, and their union is not necessarily the entire graph. For \(k = 1\), the k-vertex connected components are the (strongly) connected components of \(G\). For \(k = 2\), the k-vertex connected components are the bi-connected components of \(G\). Isolated vertices (with no edges) are considered to be 0-vertex connected components (also can be treated as a clique of size 1).
For k-edge connected components, see KEdgeConnectedComponentsAlgo
.
Use newInstance()
to get a default implementation of this interface.
- Author:
- Barak Ugav
- See Also:
-
Method Summary
Modifier and TypeMethodDescriptionfindKVertexConnectedComponents
(Graph<V, E> g, int k) Find all k-vertex connected components in a graph.Create a new k-connected components algorithm object.
-
Method Details
-
findKVertexConnectedComponents
Find all k-vertex connected components in a graph.If
g
is anIntGraph
, the returned list will be a list ofIntSet
.- Type Parameters:
V
- the vertices typeE
- the edges type- Parameters:
g
- a graphk
- the k value, non negative- Returns:
- a list of the k-connected components
- Throws:
IllegalArgumentException
- ifk
is negative
-
newInstance
Create a new k-connected components algorithm object.This is the recommended way to instantiate a new
KVertexConnectedComponentsAlgo
object. implementations.- Returns:
- a default implementation of
KVertexConnectedComponentsAlgo
-