Subdivide - Maple Help

GraphTheory

 Subdivide
 construct graph by subdividing edges

 Calling Sequence Subdivide(G, E, r)

Parameters

 G - graph E - (optional) edge or arc or set (or list) of edges or arcs of the graph r - (optional) positive integer

Description

 • The Subdivide command subdivides the specified edges or arcs of a graph or digraph, by putting r new vertices on each specified edge or arc.
 • If r is not specified, a default value of 1 is used.

Examples

 > $\mathrm{with}\left(\mathrm{GraphTheory}\right):$
 > $G≔\mathrm{CompleteGraph}\left(2,3\right)$
 ${G}{≔}{\mathrm{Graph 1: an undirected unweighted graph with 5 vertices and 6 edge\left(s\right)}}$ (1)
 > $\mathrm{Edges}\left(G\right)$
 $\left\{\left\{{1}{,}{3}\right\}{,}\left\{{1}{,}{4}\right\}{,}\left\{{1}{,}{5}\right\}{,}\left\{{2}{,}{3}\right\}{,}\left\{{2}{,}{4}\right\}{,}\left\{{2}{,}{5}\right\}\right\}$ (2)
 > $\mathrm{SG}≔\mathrm{Subdivide}\left(G,\left\{\left\{1,5\right\},\left\{2,4\right\}\right\}\right)$
 ${\mathrm{SG}}{≔}{\mathrm{Graph 2: an undirected unweighted graph with 7 vertices and 8 edge\left(s\right)}}$ (3)
 > $\mathrm{Edges}\left(\mathrm{SG}\right)$
 $\left\{\left\{{1}{,}{3}\right\}{,}\left\{{1}{,}{4}\right\}{,}\left\{{1}{,}{6}\right\}{,}\left\{{2}{,}{3}\right\}{,}\left\{{2}{,}{5}\right\}{,}\left\{{2}{,}{7}\right\}{,}\left\{{4}{,}{7}\right\}{,}\left\{{5}{,}{6}\right\}\right\}$ (4)
 > $\mathrm{DG}≔\mathrm{Digraph}\left(\left[a,b,c\right],\left\{\left[a,b\right],\left[a,c\right]\right\}\right)$
 ${\mathrm{DG}}{≔}{\mathrm{Graph 3: a directed unweighted graph with 3 vertices and 2 arc\left(s\right)}}$ (5)
 > $\mathrm{Edges}\left(\mathrm{DG}\right)$
 $\left\{\left[{a}{,}{b}\right]{,}\left[{a}{,}{c}\right]\right\}$ (6)
 > $\mathrm{SDG}≔\mathrm{Subdivide}\left(\mathrm{DG},\left[a,b\right],2\right)$
 ${\mathrm{SDG}}{≔}{\mathrm{Graph 4: a directed unweighted graph with 5 vertices and 4 arc\left(s\right)}}$ (7)
 > $\mathrm{Edges}\left(\mathrm{SDG}\right)$
 $\left\{\left[{1}{,}{2}\right]{,}\left[{2}{,}{b}\right]{,}\left[{a}{,}{1}\right]{,}\left[{a}{,}{c}\right]\right\}$ (8)