GraphTheory - Maple Programming Help

Home : Support : Online Help : Mathematics : Discrete Mathematics : Graph Theory : GraphTheory Package : GraphTheory/RelabelVertices

GraphTheory

 RelabelVertices

 Calling Sequence RelabelVertices(G,V)

Parameters

 G - a graph V - a list of vertex labels

Description

 • RelabelVertices('G','V') returns a new graph with vertex labels changed to be those in V.  The graph G is not modified.

Examples

 > $\mathrm{with}\left(\mathrm{GraphTheory}\right):$
 > $G≔\mathrm{Graph}\left(\left\{\left\{1,2\right\},\left\{1,3\right\},\left\{1,4\right\}\right\}\right):$
 > $\mathrm{Vertices}\left(G\right)$
 $\left[{1}{,}{2}{,}{3}{,}{4}\right]$ (1)
 > $\mathrm{Edges}\left(G\right)$
 $\left\{\left\{{1}{,}{2}\right\}{,}\left\{{1}{,}{3}\right\}{,}\left\{{1}{,}{4}\right\}\right\}$ (2)
 > $H≔\mathrm{RelabelVertices}\left(G,\left[a,b,c,d\right]\right):$
 > $\mathrm{Vertices}\left(H\right)$
 $\left[{a}{,}{b}{,}{c}{,}{d}\right]$ (3)
 > $\mathrm{Edges}\left(H\right)$
 $\left\{\left\{{a}{,}{b}\right\}{,}\left\{{a}{,}{c}\right\}{,}\left\{{a}{,}{d}\right\}\right\}$ (4)