VertexOutComponent[g,{v1,v2,…}]
gives the vertices in the graph g that have a directed path from at least one of v1, v2, ….
VertexOutComponent[g,{v1,v2,…},k]
gives the vertices with a directed path from at least one of v1, v2, … of at most length k.
VertexOutComponent[g,{v1,v2,…},{k}]
gives the vertices at length exactly k.
VertexOutComponent[{vw,…},…]
uses rules vw to specify the graph g.
VertexOutComponent
VertexOutComponent[g,{v1,v2,…}]
gives the vertices in the graph g that have a directed path from at least one of v1, v2, ….
VertexOutComponent[g,{v1,v2,…},k]
gives the vertices with a directed path from at least one of v1, v2, … of at most length k.
VertexOutComponent[g,{v1,v2,…},{k}]
gives the vertices at length exactly k.
VertexOutComponent[{vw,…},…]
uses rules vw to specify the graph g.
Details
- VertexOutComponent works for any directed graph object.
- VertexOutComponent works with undirected graphs, directed graphs, multigraphs, and mixed graphs.
Examples
open all close allBasic Examples (1)
Scope (8)
VertexOutComponent works with undirected graphs:
VertexOutComponent[[image], {1}]VertexOutComponent[[image], {3}]VertexOutComponent[[image], {2}]VertexOutComponent[[image], {2}]Use rules to specify the graph:
VertexOutComponent[{1 -> 2, 1 -> 5, 2 -> 3, 3 -> 4, 4 -> 5, 6 -> 3, 4 -> 6}, {3}]Use patterns to select a subset of vertices:
VertexOutComponent[[image], _ ? EvenQ]Find the out-component connected to a vertex by a path of at most length 2 in a graph:
VertexOutComponent[[image], 3, 2]VertexOutComponent works with large graphs:
g = GridGraph[{10, 10, 10, 10}];VertexOutComponent[g, {1}] //Length// TimingProperties & Relations (1)
Use VertexInComponent to find the in-component for directed graphs:
VertexInComponent[[image], {6}]Related Guides
History
Introduced in 2010 (8.0) | Updated in 2014 (10.0) ▪ 2015 (10.3) ▪ 2020 (12.1)
Text
Wolfram Research (2010), VertexOutComponent, Wolfram Language function, https://reference.wolfram.com/language/ref/VertexOutComponent.html (updated 2020).
CMS
Wolfram Language. 2010. "VertexOutComponent." Wolfram Language & System Documentation Center. Wolfram Research. Last Modified 2020. https://reference.wolfram.com/language/ref/VertexOutComponent.html.
APA
Wolfram Language. (2010). VertexOutComponent. Wolfram Language & System Documentation Center. Retrieved from https://reference.wolfram.com/language/ref/VertexOutComponent.html
BibTeX
@misc{reference.wolfram_2026_vertexoutcomponent, author="Wolfram Research", title="{VertexOutComponent}", year="2020", howpublished="\url{https://reference.wolfram.com/language/ref/VertexOutComponent.html}", note=[Accessed: 13-June-2026]}
BibLaTeX
@online{reference.wolfram_2026_vertexoutcomponent, organization={Wolfram Research}, title={VertexOutComponent}, year={2020}, url={https://reference.wolfram.com/language/ref/VertexOutComponent.html}, note=[Accessed: 13-June-2026]}