networks
gsimp
creates a simple graph from a multigraph
Calling Sequence
Parameters
Description
Examples
gsimp(G)
G
-
graph or network
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](...).
with⁡networks:
G≔cycle⁡4:
addedge⁡1,2,3,3,2,4,2,4,4,2,G:
ends⁡convert⁡edges⁡G,list,G
1,2,2,3,3,4,1,4,1,2,3,3,2,4,2,4,4,2
H≔gsimp⁡G:
ends⁡convert⁡edges⁡H,list,H
1,2,2,4,2,3,3,4,1,4,4,2
See Also
GraphTheory
networks(deprecated)[edges]
networks(deprecated)[induce]
Download Help Document