networks(deprecated)/shrink - Maple Help

networks

 shrink
 shrink identifies a group of vertices as a single vertex

 Calling Sequence shrink(v1, G) shrink(v1, G, vname)

Parameters

 G - graph or network v1 - set of vertices of G vname - name for coalesced vertex

Description

 • Important: The networks package has been deprecated.Use the superseding package GraphTheory instead.
 • This routine replaces v1 with a single new vertex in G and returns as its value the name of that the shrunken vertex.
 • The default name of the new vertex is an arbitrary one of the vertices in the subgraph being shrunk, or vname if such a name has been provided.
 • This routine is normally loaded via the command with(networks) but may also be referenced using the full name networks[shrink](...).

Examples

Important: The networks package has been deprecated.Use the superseding package GraphTheory instead.

 > $\mathrm{with}\left(\mathrm{networks}\right):$
 > $G≔\mathrm{petersen}\left(\right):$
 > $\mathrm{ends}\left(\mathrm{convert}\left(\mathrm{edges}\left(G\right),'\mathrm{list}'\right),G\right)$
 $\left[\left\{{1}{,}{2}\right\}{,}\left\{{6}{,}{10}\right\}{,}\left\{{1}{,}{6}\right\}{,}\left\{{2}{,}{8}\right\}{,}\left\{{3}{,}{10}\right\}{,}\left\{{4}{,}{7}\right\}{,}\left\{{5}{,}{9}\right\}{,}\left\{{2}{,}{3}\right\}{,}\left\{{3}{,}{4}\right\}{,}\left\{{4}{,}{5}\right\}{,}\left\{{1}{,}{5}\right\}{,}\left\{{6}{,}{7}\right\}{,}\left\{{7}{,}{8}\right\}{,}\left\{{8}{,}{9}\right\}{,}\left\{{9}{,}{10}\right\}\right]$ (1)
 > $\mathrm{shrink}\left(\left\{1,2,3,6,9\right\},G,\mathrm{SuperNode}\right)$
 ${\mathrm{SuperNode}}$ (2)
 > $\mathrm{vertices}\left(G\right)$
 $\left\{{4}{,}{5}{,}{7}{,}{8}{,}{10}{,}{\mathrm{SuperNode}}\right\}$ (3)
 > $\mathrm{ends}\left(\mathrm{convert}\left(\mathrm{edges}\left(G\right),'\mathrm{list}'\right),G\right)$
 $\left[\left\{{10}{,}{\mathrm{SuperNode}}\right\}{,}\left\{{8}{,}{\mathrm{SuperNode}}\right\}{,}\left\{{10}{,}{\mathrm{SuperNode}}\right\}{,}\left\{{4}{,}{7}\right\}{,}\left\{{5}{,}{\mathrm{SuperNode}}\right\}{,}\left\{{4}{,}{\mathrm{SuperNode}}\right\}{,}\left\{{4}{,}{5}\right\}{,}\left\{{5}{,}{\mathrm{SuperNode}}\right\}{,}\left\{{7}{,}{\mathrm{SuperNode}}\right\}{,}\left\{{7}{,}{8}\right\}{,}\left\{{8}{,}{\mathrm{SuperNode}}\right\}{,}\left\{{10}{,}{\mathrm{SuperNode}}\right\}\right]$ (4)