WOLFRAM

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

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

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

gives the vertices at length exactly k.

VertexInComponent[{vw,},]

uses rules vw to specify the graph g.

Details

Examples

open allclose all

Basic Examples  (1)Summary of the most common use cases

Find the in-component of a vertex:

Out[3]=3

Highlight the in-component of a vertex:

Out[4]=4

Scope  (8)Survey of the scope of standard use cases

VertexInComponent works with undirected graphs:

Out[1]=1

Directed graphs:

Out[1]=1

Multigraphs:

Out[1]=1

Mixed graphs:

Out[1]=1

Use rules to specify the graph:

Out[1]=1

Use patterns to select a subset of vertices:

Out[1]=1

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

Out[1]=1

VertexInComponent works with large graphs:

Out[2]=2

Properties & Relations  (1)Properties of the function, and connections to other functions

Use VertexOutComponent to find the out-component for directed graphs:

Out[5]=5
Wolfram Research (2010), VertexInComponent, Wolfram Language function, https://reference.wolfram.com/language/ref/VertexInComponent.html (updated 2020).
Wolfram Research (2010), VertexInComponent, Wolfram Language function, https://reference.wolfram.com/language/ref/VertexInComponent.html (updated 2020).

Text

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

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

CMS

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

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

APA

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

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

BibTeX

@misc{reference.wolfram_2025_vertexincomponent, author="Wolfram Research", title="{VertexInComponent}", year="2020", howpublished="\url{https://reference.wolfram.com/language/ref/VertexInComponent.html}", note=[Accessed: 02-June-2025 ]}

@misc{reference.wolfram_2025_vertexincomponent, author="Wolfram Research", title="{VertexInComponent}", year="2020", howpublished="\url{https://reference.wolfram.com/language/ref/VertexInComponent.html}", note=[Accessed: 02-June-2025 ]}

BibLaTeX

@online{reference.wolfram_2025_vertexincomponent, organization={Wolfram Research}, title={VertexInComponent}, year={2020}, url={https://reference.wolfram.com/language/ref/VertexInComponent.html}, note=[Accessed: 02-June-2025 ]}

@online{reference.wolfram_2025_vertexincomponent, organization={Wolfram Research}, title={VertexInComponent}, year={2020}, url={https://reference.wolfram.com/language/ref/VertexInComponent.html}, note=[Accessed: 02-June-2025 ]}