networks(deprecated)/gsimp - Maple Help
For the best experience, we recommend viewing online help using Google Chrome or Microsoft Edge.

Home : Support : Online Help : networks(deprecated)/gsimp

networks

 gsimp
 creates a simple graph from a multigraph

 Calling Sequence gsimp(G)

Parameters

 G - graph or network

Description

 • Important: The networks package has been deprecated.  Use the superseding package GraphTheory instead.
 • This procedure deletes loops in G and replaces multiple edges with a single edge of capacity equal to the combined capacities of the old edges.
 • A copy of the graph should be made using duplicate() if you wish to preserve the structure of the original graph.
 • The modified graph G is also returned as the value of the procedure call.
 • This routine is normally loaded via the command with(networks) but may also be referenced using the full name networks[gsimp](...).

Examples

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

 > $\mathrm{with}\left(\mathrm{networks}\right):$
 > $G≔\mathrm{cycle}\left(4\right):$
 > $\mathrm{addedge}\left(\left[\left\{1,2\right\},\left[3,3\right],\left[2,4\right],\left[2,4\right],\left[4,2\right]\right],G\right):$
 > $\mathrm{ends}\left(\mathrm{convert}\left(\mathrm{edges}\left(G\right),'\mathrm{list}'\right),G\right)$
 $\left[\left\{{1}{,}{2}\right\}{,}\left\{{2}{,}{3}\right\}{,}\left\{{3}{,}{4}\right\}{,}\left\{{1}{,}{4}\right\}{,}\left\{{1}{,}{2}\right\}{,}\left[{3}{,}{3}\right]{,}\left[{2}{,}{4}\right]{,}\left[{2}{,}{4}\right]{,}\left[{4}{,}{2}\right]\right]$ (1)
 > $H≔\mathrm{gsimp}\left(G\right):$
 > $\mathrm{ends}\left(\mathrm{convert}\left(\mathrm{edges}\left(H\right),'\mathrm{list}'\right),H\right)$
 $\left[\left\{{1}{,}{2}\right\}{,}\left[{2}{,}{4}\right]{,}\left\{{2}{,}{3}\right\}{,}\left\{{3}{,}{4}\right\}{,}\left\{{1}{,}{4}\right\}{,}\left[{4}{,}{2}\right]\right]$ (2)