next | previous | forward | backward | up | top | index | toc | Macaulay2 website
Graphs :: indexLabelGraph

indexLabelGraph -- Relabels the vertices of a graph or digraph according to their indices, indexed from 0.

Synopsis

Description

This method relabels the vertices of a graph or digraph according to their indices. The method indexes from 0 to the number of vertices minus one.

i1 : G = graph({1,2,3,4,5},{{1,3},{3,4},{4,5}});
i2 : indexLabelGraph G

o2 = Graph{0 => {2}   }
           1 => {}
           2 => {0, 3}
           3 => {2, 4}
           4 => {3}

o2 : Graph
i3 : D = digraph({1,2,3,4,5},{{1,2},{2,3},{3,1},{4,5},{5,4}})

o3 = Digraph{1 => {2}}
             2 => {3}
             3 => {1}
             4 => {5}
             5 => {4}

o3 : Digraph
i4 : indexLabelGraph D

o4 = Digraph{0 => {1}}
             1 => {2}
             2 => {0}
             3 => {4}
             4 => {3}

o4 : Digraph

See also

Ways to use indexLabelGraph :

For the programmer

The object indexLabelGraph is a method function.