IndexGraph

IndexGraph[g]

replaces the vertices of the graph g by its vertex indexes.

IndexGraph[g,r]

replaces the vertices with integers r, r+1, .

IndexGraph[{vw,},]

uses rules vw to specify the graph g.

Details

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

Examples

open allclose all

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]=

Scope  (7)

Properties & Relations  (5)

See Also

VertexIndex  VertexReplace  Graph

Introduced in 2010
(8.0)
| Updated in 2015
(10.3)