VertexInComponentGraph
✖
VertexInComponentGraph
gives the subgraph of the graph g generated by the vertices that have a directed path to at least one of v1,v2,….
gives the subgraph of g generated by vertices with a directed path of at most length k to at least one of v1,v2,….
gives the subgraph of g generated by vertices of length exactly k.
Details and Options

- VertexInComponentGraph works with undirected graphs, directed graphs, multigraphs and mixed graphs.

Examples
open allclose allBasic Examples (3)Summary of the most common use cases
Find the in-component graph of a vertex:

https://wolfram.com/xid/0cf3zahhn5yum4q-8risxi

https://wolfram.com/xid/0cf3zahhn5yum4q-rdo0e7

Highlight the in-component graph of a vertex:

https://wolfram.com/xid/0cf3zahhn5yum4q-pjhv9j

Find the in-component graph of a set of vertices in a graph:

https://wolfram.com/xid/0cf3zahhn5yum4q-r9zsrk

Highlight the in-component graph of a vertex:

https://wolfram.com/xid/0cf3zahhn5yum4q-pa9bjd

https://wolfram.com/xid/0cf3zahhn5yum4q-rpzc4x

Scope (9)Survey of the scope of standard use cases
VertexInComponentGraph works with undirected graphs:

https://wolfram.com/xid/0cf3zahhn5yum4q-3jjvc1


https://wolfram.com/xid/0cf3zahhn5yum4q-zg3ksa


https://wolfram.com/xid/0cf3zahhn5yum4q-w3859o


https://wolfram.com/xid/0cf3zahhn5yum4q-vbiq94


https://wolfram.com/xid/0cf3zahhn5yum4q-g06cb5

Use rules to specify the graph:

https://wolfram.com/xid/0cf3zahhn5yum4q-bndh30

Use patterns to select a subset of vertices:

https://wolfram.com/xid/0cf3zahhn5yum4q-bp7bob

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

https://wolfram.com/xid/0cf3zahhn5yum4q-imtbi

VertexInComponentGraph works with large graphs:

https://wolfram.com/xid/0cf3zahhn5yum4q-wd8zhr

https://wolfram.com/xid/0cf3zahhn5yum4q-gopv0s

Applications (2)Sample problems that can be solved with this function
Find the message generating the largest total number of messages in the network of email sent to the MathGroup list in November 2011:

https://wolfram.com/xid/0cf3zahhn5yum4q-hrqjma

https://wolfram.com/xid/0cf3zahhn5yum4q-go8k52

https://wolfram.com/xid/0cf3zahhn5yum4q-7r9swl

The most interesting subject of the month:

https://wolfram.com/xid/0cf3zahhn5yum4q-gcs5ks

Show the network generated by this message:

https://wolfram.com/xid/0cf3zahhn5yum4q-m3mesp

Build a graph by states that can reach to state 4 within a finite step in a finite-state Markov chain with the following transition probability matrix:

https://wolfram.com/xid/0cf3zahhn5yum4q-j1xr7i
Construct the state transition diagram of a transition matrix:

https://wolfram.com/xid/0cf3zahhn5yum4q-ut712s

Build the graph by states that can reach to state 4:

https://wolfram.com/xid/0cf3zahhn5yum4q-2i6ont

Properties & Relations (1)Properties of the function, and connections to other functions
Use VertexInComponent to find the in-component graph:

https://wolfram.com/xid/0cf3zahhn5yum4q-6kj2bx

https://wolfram.com/xid/0cf3zahhn5yum4q-nzzif9


https://wolfram.com/xid/0cf3zahhn5yum4q-yfb2ix


https://wolfram.com/xid/0cf3zahhn5yum4q-ofknv7

Wolfram Research (2021), VertexInComponentGraph, Wolfram Language function, https://reference.wolfram.com/language/ref/VertexInComponentGraph.html.
Text
Wolfram Research (2021), VertexInComponentGraph, Wolfram Language function, https://reference.wolfram.com/language/ref/VertexInComponentGraph.html.
Wolfram Research (2021), VertexInComponentGraph, Wolfram Language function, https://reference.wolfram.com/language/ref/VertexInComponentGraph.html.
CMS
Wolfram Language. 2021. "VertexInComponentGraph." Wolfram Language & System Documentation Center. Wolfram Research. https://reference.wolfram.com/language/ref/VertexInComponentGraph.html.
Wolfram Language. 2021. "VertexInComponentGraph." Wolfram Language & System Documentation Center. Wolfram Research. https://reference.wolfram.com/language/ref/VertexInComponentGraph.html.
APA
Wolfram Language. (2021). VertexInComponentGraph. Wolfram Language & System Documentation Center. Retrieved from https://reference.wolfram.com/language/ref/VertexInComponentGraph.html
Wolfram Language. (2021). VertexInComponentGraph. Wolfram Language & System Documentation Center. Retrieved from https://reference.wolfram.com/language/ref/VertexInComponentGraph.html
BibTeX
@misc{reference.wolfram_2025_vertexincomponentgraph, author="Wolfram Research", title="{VertexInComponentGraph}", year="2021", howpublished="\url{https://reference.wolfram.com/language/ref/VertexInComponentGraph.html}", note=[Accessed: 08-July-2025
]}
BibLaTeX
@online{reference.wolfram_2025_vertexincomponentgraph, organization={Wolfram Research}, title={VertexInComponentGraph}, year={2021}, url={https://reference.wolfram.com/language/ref/VertexInComponentGraph.html}, note=[Accessed: 08-July-2025
]}