# VertexComponent

VertexComponent[g,{v1,v2,}]

gives the vertices in the graph g that have a path to at least one of v1, v2, .

VertexComponent[g,{v1,v2,},k]

gives the vertices with a path to at least one of v1, v2, of at most length k.

VertexComponent[g,{v1,v2,},{k}]

gives the vertices at length exactly k.

VertexComponent[{vw,},]

uses rules vw to specify the graph g.

# Details

• VertexComponent works for any undirected graph object.
• VertexComponent works with undirected graphs, directed graphs, multigraphs, and mixed graphs.

# Examples

open allclose all

## Basic Examples(1)

Find the component of a vertex in a graph:

Highlight the component of a vertex:

## Scope(8)

VertexComponent works with undirected graphs:

Directed graphs:

Multigraphs:

Mixed graphs:

Use rules to specify the graph:

Use patterns to select a subset of vertices:

Find the component connected to a vertex by a path of at most length 2 in a graph:

VertexComponent works with large graphs:

Wolfram Research (2010), VertexComponent, Wolfram Language function, https://reference.wolfram.com/language/ref/VertexComponent.html (updated 2020).

#### Text

Wolfram Research (2010), VertexComponent, Wolfram Language function, https://reference.wolfram.com/language/ref/VertexComponent.html (updated 2020).

#### CMS

Wolfram Language. 2010. "VertexComponent." Wolfram Language & System Documentation Center. Wolfram Research. Last Modified 2020. https://reference.wolfram.com/language/ref/VertexComponent.html.

#### APA

Wolfram Language. (2010). VertexComponent. Wolfram Language & System Documentation Center. Retrieved from https://reference.wolfram.com/language/ref/VertexComponent.html

#### BibTeX

@misc{reference.wolfram_2024_vertexcomponent, author="Wolfram Research", title="{VertexComponent}", year="2020", howpublished="\url{https://reference.wolfram.com/language/ref/VertexComponent.html}", note=[Accessed: 12-September-2024 ]}

#### BibLaTeX

@online{reference.wolfram_2024_vertexcomponent, organization={Wolfram Research}, title={VertexComponent}, year={2020}, url={https://reference.wolfram.com/language/ref/VertexComponent.html}, note=[Accessed: 12-September-2024 ]}