networks(deprecated)/gunion - Maple Help

networks

 gunion
 union of two graphs

 Calling Sequence gunion(G, H) gunion(G, H, 'SIMPLE')

Parameters

 G - graph or network H - graph or network 'SIMPLE' - (optional) indicates that simple union wanted

Description

 • Important: The networks package has been deprecated.  Use the superseding command GraphTheory[GraphUnion] instead.
 • This procedure creates a graph whose vertex set is the usual set-theoretic union of the vertex sets of G and H, and which has an edge for each edge of G and for each edge of H.
 • Multiple edges that have the same endpoints are retained unless 'SIMPLE' is specified, in which case multiple edges are reduced to a single edge.
 • This routine is normally loaded by using the command with(networks), but it may also be referenced by using the full name networks[gunion](...).

Examples

Important: The networks package has been deprecated.  Use the superseding command GraphTheory[GraphUnion] instead.

 > $\mathrm{with}\left(\mathrm{networks}\right):$
 > $G≔\mathrm{complete}\left(\left\{\mathrm{a1},\mathrm{a2},\mathrm{a3},\mathrm{a4}\right\}\right):$
 > $H≔\mathrm{complete}\left(2,3\right):$
 > $J≔\mathrm{void}\left(\left\{2,4,\mathrm{a1},\mathrm{a2}\right\}\right):$
 > $\mathrm{addedge}\left(\mathrm{Cycle}\left(\mathrm{a1},\mathrm{a2},2,4\right),J\right):$
 > $U≔\mathrm{gunion}\left(G,J\right):$
 > $\mathrm{ends}\left(\left[\mathrm{op}\left(\mathrm{edges}\left(U\right)\right)\right],U\right)$
 $\left[\left\{{\mathrm{a1}}{,}{\mathrm{a2}}\right\}{,}\left\{{4}{,}{\mathrm{a1}}\right\}{,}\left\{{\mathrm{a1}}{,}{\mathrm{a3}}\right\}{,}\left\{{\mathrm{a1}}{,}{\mathrm{a4}}\right\}{,}\left\{{\mathrm{a2}}{,}{\mathrm{a3}}\right\}{,}\left\{{\mathrm{a2}}{,}{\mathrm{a4}}\right\}{,}\left\{{\mathrm{a3}}{,}{\mathrm{a4}}\right\}{,}\left\{{\mathrm{a1}}{,}{\mathrm{a2}}\right\}{,}\left\{{2}{,}{\mathrm{a2}}\right\}{,}\left\{{2}{,}{4}\right\}\right]$ (1)
 > $U≔\mathrm{gunion}\left(U,H,'\mathrm{SIMPLE}'\right):$
 > $\mathrm{vertices}\left(U\right)$
 $\left\{{1}{,}{2}{,}{3}{,}{4}{,}{5}{,}{\mathrm{a1}}{,}{\mathrm{a2}}{,}{\mathrm{a3}}{,}{\mathrm{a4}}\right\}$ (2)
 > $\mathrm{ends}\left(\left[\mathrm{op}\left(\mathrm{edges}\left(U\right)\right)\right],U\right)$
 $\left[\left\{{1}{,}{3}\right\}{,}\left\{{\mathrm{a1}}{,}{\mathrm{a3}}\right\}{,}\left\{{\mathrm{a1}}{,}{\mathrm{a4}}\right\}{,}\left\{{\mathrm{a2}}{,}{\mathrm{a3}}\right\}{,}\left\{{\mathrm{a2}}{,}{\mathrm{a4}}\right\}{,}\left\{{\mathrm{a3}}{,}{\mathrm{a4}}\right\}{,}\left\{{1}{,}{4}\right\}{,}\left\{{1}{,}{5}\right\}{,}\left\{{2}{,}{3}\right\}{,}\left\{{2}{,}{4}\right\}{,}\left\{{2}{,}{5}\right\}{,}\left\{{2}{,}{\mathrm{a2}}\right\}{,}\left\{{4}{,}{\mathrm{a1}}\right\}{,}\left\{{\mathrm{a1}}{,}{\mathrm{a2}}\right\}\right]$ (3)