DeleteArc - Maple Help

Online Help

All Products    Maple    MapleSim

GraphTheory

 DeleteArc
 delete arc from digraph

 Calling Sequence DeleteArc(G, E, ip)

Parameters

 G - directed graph E - arc, trail, or set of arcs ip - (optional)equation of the form inplace=true or false

Description

 • The DeleteArc command deletes one or more arcs from a directed graph. By default, the original digraph is changed to a digraph missing the specified set of arcs. By setting inplace=false the original digraph remains unchanged and a new digraph missing the specified set of arcs is created.
 • If the digraph is a weighted digraph, then if a weight is also provided (i.e. $\left[\mathrm{arc},\mathrm{weight}\right]$ instead of $\mathrm{arc}$) that weight is subtracted from the arc weight, which will not necessarily remove the arc from the digraph. If no weight is provided, the arc is removed regardless of the weight.

Examples

 > $\mathrm{with}\left(\mathrm{GraphTheory}\right):$
 > $G≔\mathrm{Digraph}\left(\left[a,b,c,d\right],\left\{\left[a,b\right],\left[b,c\right],\left[c,d\right],\left[d,a\right]\right\}\right)$
 ${G}{≔}{\mathrm{Graph 1: a directed unweighted graph with 4 vertices and 4 arc\left(s\right)}}$ (1)
 > $H≔\mathrm{DeleteArc}\left(G,\left[d,a\right],\mathrm{inplace}=\mathrm{false}\right)$
 ${H}{≔}{\mathrm{Graph 2: a directed unweighted graph with 4 vertices and 3 arc\left(s\right)}}$ (2)
 > $\mathrm{Edges}\left(G\right)$
 $\left\{\left[{a}{,}{b}\right]{,}\left[{b}{,}{c}\right]{,}\left[{c}{,}{d}\right]{,}\left[{d}{,}{a}\right]\right\}$ (3)
 > $\mathrm{Edges}\left(H\right)$
 $\left\{\left[{a}{,}{b}\right]{,}\left[{b}{,}{c}\right]{,}\left[{c}{,}{d}\right]\right\}$ (4)
 > $\mathrm{DeleteArc}\left(G,\left\{\left[a,b\right],\left[c,d\right]\right\}\right)$
 ${\mathrm{Graph 1: a directed unweighted graph with 4 vertices and 2 arc\left(s\right)}}$ (5)
 > $\mathrm{Edges}\left(G\right)$
 $\left\{\left[{b}{,}{c}\right]{,}\left[{d}{,}{a}\right]\right\}$ (6)

 See Also