VertexList

VertexList[g]
gives the list of vertices for the graph g.

VertexList[g, patt]
gives a list of vertices that match the pattern patt.

DetailsDetails

  • VertexList is also known as nodes or actors.
  • VertexList returns the list of vertices in the order used by the graph g.

ExamplesExamplesopen allclose all

Basic Examples (3)Basic Examples (3)

The vertex list for an explicitly constructed graph:

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

The vertex list for a parametrically constructed graph:

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

Find all vertices that match a pattern:

In[1]:=
Click for copyable input
Out[1]=
In[2]:=
Click for copyable input
Out[2]=
New in 8
New to Mathematica? Find your learning path »
Have a question? Ask support »