networks(deprecated)/graph - Maple Help

networks

 graph
 generate a graph from a specified set of vertices and edges

 Calling Sequence graph(vset, eset)

Parameters

 vset - set of vertex names eset - set of pairs of vertex names

Description

 • Important: The networks package has been deprecated.  Use the superseding command GraphTheory[Graph] instead.
 • This procedure generates graphs directly from a set of vertices and a set of vertex pairs.  Each pair of vertices is specified as either a list or a set.  Use of a list indicates direction from the tail to the head.
 • This routine is normally loaded via the command with(networks) but may also be referenced using the full name networks[graph](...).

Examples

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

 > $\mathrm{with}\left(\mathrm{networks}\right):$
 > $G≔\mathrm{graph}\left(\left\{1,2\right\},\left\{\left\{1,2\right\}\right\}\right):$
 > $\mathrm{edges}\left(G\right)$
 $\left\{{\mathrm{e1}}\right\}$ (1)
 > $\mathrm{vertices}\left(G\right)$
 $\left\{{1}{,}{2}\right\}$ (2)
 > $G≔\mathrm{graph}\left(\left\{1,2,3\right\},\left\{\left\{1,2\right\},\left\{2,3\right\},\left\{3,1\right\},\left[1,2\right]\right\}\right):$
 > $\mathrm{edges}\left(G\right)$
 $\left\{{\mathrm{e1}}{,}{\mathrm{e2}}{,}{\mathrm{e3}}{,}{\mathrm{e4}}\right\}$ (3)

Only one of these edges should be directed.

 > $\mathrm{map}\left(\mathrm{head},,G\right)$
 $\left\{{2}\right\}$ (4)