WOLFRAM

VertexInComponentGraph[g,{v1,v2,}]

gives the subgraph of the graph g generated by the vertices that have a directed path to at least one of v1,v2,.

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

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

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

gives the subgraph of g generated by vertices of length exactly k.

VertexInComponentGraph[{vw,},]

uses rules vw to specify the graph g.

Details and Options

Examples

open allclose all

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

Find the in-component graph of a vertex:

Out[2]=2

Highlight the in-component graph of a vertex:

Out[3]=3

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

Out[1]=1

Highlight the in-component graph of a vertex:

Out[2]=2

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

VertexInComponentGraph works with undirected graphs:

Out[1]=1

Directed graphs:

Out[1]=1

Multigraphs:

Out[1]=1

Mixed graphs:

Out[1]=1

Tagged 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 graph connected to a vertex by a path of at most length 2 in a graph:

Out[1]=1

VertexInComponentGraph works with large graphs:

Out[2]=2

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:

Out[3]=3

The most interesting subject of the month:

Out[4]=4

Show the network generated by this message:

Out[6]=6

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:

Construct the state transition diagram of a transition matrix:

Out[2]=2

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

Out[3]=3

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

Use VertexInComponent to find the in-component graph:

Out[7]=7
Out[8]=8
Out[9]=9
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.

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 ]}

@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 ]}

@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 ]}