VertexIndex

VertexIndex[g,v]
gives the integer index for the vertex v in the graph g.

VertexIndex[{vw,},]
uses rules vw to specify the graph g.

DetailsDetails

ExamplesExamplesopen allclose all

Basic Examples  (1)Basic Examples  (1)

Find the integer index of a vertex:

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

The index corresponds to the position in the vertex list:

In[3]:=
Click for copyable input
Out[3]=
Introduced in 2010
(8.0)
| Updated in 2015
(10.3)
Translate this page: