networks(deprecated)/ends - Maple Help

# Online Help

###### All Products    Maple    MapleSim

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

networks

 ends
 finds the ends of an edge in a graph

 Calling Sequence ends(G) ends(e, G)

Parameters

 G - graph or network e - edge or a set or list of edges of G

Description

 • Important: The networks package has been deprecated.  Use the superseding package GraphTheory instead.
 • This routine is used to recover the names of the vertices at the ends of a specified edge.
 • In the special case where only the graph G is specified then the ends of all of the edges of G are returned as a set.
 • If an edge e is directed then the ends are returned as a list of length 2 where the second element is the head.  For undirected edges the vertex names are returned as a set.  Undirected loops will appear as a set containing one vertex name.
 • Specific edges of interest may be specified either individually or as a set or list of edge names. The result will be a vertex pair, a set of vertex pairs, or a list of vertex pairs as appropriate.
 • This routine is normally loaded via the command with(networks) but may also be referenced using the full name networks[ends](...).

Examples

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

 > $\mathrm{with}\left(\mathrm{networks}\right):$
 > $G≔\mathrm{cycle}\left(5\right):$
 > $\mathrm{Eset}≔\left\{\mathrm{addedge}\left(\left\{\left[1,3\right],\left[2,2\right]\right\},G\right)\right\}$
 ${\mathrm{Eset}}{≔}\left\{{\mathrm{e6}}{,}{\mathrm{e7}}\right\}$ (1)
 > $\mathrm{ends}\left(\mathrm{Eset},G\right)$
 $\left\{\left[{1}{,}{3}\right]{,}\left[{2}{,}{2}\right]\right\}$ (2)
 > $\mathrm{ends}\left(\mathrm{convert}\left(\mathrm{Eset},\mathrm{list}\right),G\right)$
 $\left[\left[{1}{,}{3}\right]{,}\left[{2}{,}{2}\right]\right]$ (3)
 > $\mathrm{ends}\left(G\right)$
 $\left\{\left[{1}{,}{3}\right]{,}\left[{2}{,}{2}\right]{,}\left\{{1}{,}{2}\right\}{,}\left\{{1}{,}{5}\right\}{,}\left\{{2}{,}{3}\right\}{,}\left\{{3}{,}{4}\right\}{,}\left\{{4}{,}{5}\right\}\right\}$ (4)

 See Also