GraphTheory - Maple Programming Help

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

GraphTheory

 SetVertexPositions

 Calling Sequence SetVertexPositions(G, vp)

Parameters

 G - graph vp - list of pairs of numbers

Description

 • SetVertexPositions('G', 'vp') sets the vertex positions of the graph G for graph drawing.  The vertex positions should be input in the format [[x1,y1],[x2,y2],...,[xn,yn]].

Examples

 > $\mathrm{with}\left(\mathrm{GraphTheory}\right):$
 > $G≔\mathrm{Graph}\left(\left[\mathrm{}\left(1..6\right)\right],\left\{\left\{1,2\right\},\left\{1,4\right\},\left\{4,5\right\},\left\{2,5\right\},\left\{2,3\right\},\left\{3,6\right\},\left\{5,6\right\}\right\}\right)$
 ${G}{≔}{\mathrm{Graph 1: an undirected unweighted graph with 6 vertices and 7 edge\left(s\right)}}$ (1)
 > $\mathrm{DrawGraph}\left(G\right)$
 > $\mathrm{vp}≔\left[\left[0,0\right],\left[0.5,0\right],\left[1,0\right],\left[0,0.5\right],\left[0.5,0.5\right],\left[1,0.5\right]\right]:$
 > $\mathrm{SetVertexPositions}\left(G,\mathrm{vp}\right):$
 > $\mathrm{DrawGraph}\left(G\right)$