Interface KVertexConnectedComponentsAlgo
-
public interface KVertexConnectedComponentsAlgo
Finds the k-vertex connected components of a graph.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. A builder obtained vianewBuilder()
may support different options to obtain different implementations.- Author:
- Barak Ugav
- See Also:
- Wikipedia,
StronglyConnectedComponentsAlgo
,BiConnectedComponentsAlgo
,KEdgeConnectedComponentsAlgo
-
-
Nested Class Summary
Nested Classes Modifier and Type Interface Description static interface
KVertexConnectedComponentsAlgo.Builder
A builder forKVertexConnectedComponentsAlgo
objects.static interface
KVertexConnectedComponentsAlgo.IResult
Result of aKVertexConnectedComponentsAlgo
computation forIntGraph
.static interface
KVertexConnectedComponentsAlgo.Result<V,E>
Result of aKVertexConnectedComponentsAlgo
computation.
-
Method Summary
All Methods Static Methods Instance Methods Abstract Methods Modifier and Type Method Description <V,E>
KVertexConnectedComponentsAlgo.Result<V,E>findKVertexConnectedComponents(Graph<V,E> g, int k)
Find all k-vertex connected components in a graph.static KVertexConnectedComponentsAlgo.Builder
newBuilder()
Create a new k-connected components algorithm builder.static KVertexConnectedComponentsAlgo
newInstance()
Create a new k-connected components algorithm object.
-
-
-
Method Detail
-
findKVertexConnectedComponents
<V,E> KVertexConnectedComponentsAlgo.Result<V,E> findKVertexConnectedComponents(Graph<V,E> g, int k)
Find all k-vertex connected components in a graph.- Type Parameters:
V
- the vertices typeE
- the edges type- Parameters:
g
- a graphk
- the k value, non negative- Returns:
- a result object containing the k-vertex connected components
- Throws:
IllegalArgumentException
- ifk
is negative
-
newInstance
static KVertexConnectedComponentsAlgo newInstance()
Create a new k-connected components algorithm object.This is the recommended way to instantiate a new
KVertexConnectedComponentsAlgo
object. TheKVertexConnectedComponentsAlgo.Builder
might support different options to obtain different implementations.- Returns:
- a default implementation of
KVertexConnectedComponentsAlgo
-
newBuilder
static KVertexConnectedComponentsAlgo.Builder newBuilder()
Create a new k-connected components algorithm builder.Use
newInstance()
for a default implementation.- Returns:
- a new builder that can build
KVertexConnectedComponentsAlgo
objects
-
-