IndexGraph

IndexGraph[g]
replaces the vertices of the graph g by its vertex indexes.

IndexGraph[g, r]
replaces the vertices with integers r, , ....

ExamplesExamplesopen allclose all

Basic Examples (2)Basic Examples (2)

Replace the vertices of the graph with its vertex indexes:

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

Replace the vertices with indexes starting from 6:

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