KVertexConnectedComponents[g,k]
gives the k-vertex-connected components of the graph g.
KVertexConnectedComponents[g,k,{v1,v2,…}]
gives the k-vertex-connected components that include at least one of the vertices v1, v2, … .
KVertexConnectedComponents
KVertexConnectedComponents[g,k]
gives the k-vertex-connected components of the graph g.
KVertexConnectedComponents[g,k,{v1,v2,…}]
gives the k-vertex-connected components that include at least one of the vertices v1, v2, … .
Details
- KVertexConnectedComponents is also known as k-connected components.
- KVertexConnectedComponents returns a list of components {c1,c2,…}, where each component ci is given as a list of vertices.
- The component ci generates a maximal k-vertex-connected subgraph of g.
- For an undirected graph, the vertices u and v are in the same component if there are at least k vertex-disjoint paths from u to v.
- For a directed graph, the vertices u and v are in the same component if there are at least k vertex-disjoint directed paths from u to v and from v to u.
Examples
open all close allBasic Examples (2)
Find 2-connected components of a graph:
g = [image];KVertexConnectedComponents[g, 2]Show the 2-connected components:
HighlightGraph[g, Subgraph[g, #]& /@ %]Find the 2-connected components in a social network:
g = ExampleData[{"NetworkGraph", "ZacharyKarateClub"}];KVertexConnectedComponents[g, 2]Scope (4)
KVertexConnectedComponents works with undirected graphs:
KVertexConnectedComponents[[image], 2]Select 2-connected components that include at least one of the specified vertices:
KVertexConnectedComponents[[image], 2, {1, 2}]Use patterns to select components:
KVertexConnectedComponents[[image], 2, _ ? OddQ]g = GridGraph[{10, 10, 10, 10}];Timing[Length[KVertexConnectedComponents[g, 2]]]VertexCount[g]Applications (1)
Related Guides
History
Text
Wolfram Research (2014), KVertexConnectedComponents, Wolfram Language function, https://reference.wolfram.com/language/ref/KVertexConnectedComponents.html.
CMS
Wolfram Language. 2014. "KVertexConnectedComponents." Wolfram Language & System Documentation Center. Wolfram Research. https://reference.wolfram.com/language/ref/KVertexConnectedComponents.html.
APA
Wolfram Language. (2014). KVertexConnectedComponents. Wolfram Language & System Documentation Center. Retrieved from https://reference.wolfram.com/language/ref/KVertexConnectedComponents.html
BibTeX
@misc{reference.wolfram_2026_kvertexconnectedcomponents, author="Wolfram Research", title="{KVertexConnectedComponents}", year="2014", howpublished="\url{https://reference.wolfram.com/language/ref/KVertexConnectedComponents.html}", note=[Accessed: 13-June-2026]}
BibLaTeX
@online{reference.wolfram_2026_kvertexconnectedcomponents, organization={Wolfram Research}, title={KVertexConnectedComponents}, year={2014}, url={https://reference.wolfram.com/language/ref/KVertexConnectedComponents.html}, note=[Accessed: 13-June-2026]}