IndexGraph

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

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

DetailsDetails

  • IndexGraph works with undirected graphs, directed graphs, multigraphs, and mixed graphs.

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]=
Introduced in 2010
(8.0)
| Updated in 2014
(10.0)