VertexComponent

VertexComponent[g,{v1,v2,}]
gives the vertices in the graph g that have a path to at least one of , , .

VertexComponent[g,{v1,v2,},k]
gives the vertices with a path to at least one of , , of at most length k.

DetailsDetails

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

ExamplesExamplesopen allclose all

Basic Examples  (1)Basic Examples  (1)

Find the component of a vertex in a graph:

In[1]:=
Click for copyable input
In[2]:=
Click for copyable input
Out[2]=

Highlight the component of a vertex:

In[3]:=
Click for copyable input
Out[3]=
Introduced in 2010
(8.0)