networks

 find the head of a directed edge

Parameters

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

Description

 • Important:The networks package has been deprecated. Use the superseding package GraphTheoryinstead.
 • If a single argument G is passed then a table is returned.
 • If a single edge e is passed the either the head of e or NULL is returned depending on whether or not e is directed.
 • If a set of edges eset is passed then a set or list of head vertices is returned.
 • This routine is normally loaded via the command with(networks) but may also be referenced using the full name networks[head](...).

Examples

Important:The networks package has been deprecated. Use the superseding pakcage GraphTheoryinstead.

 > $\mathrm{with}\left(\mathrm{networks}\right):$
 > $\mathrm{new}\left(G\right):$
 > $\mathrm{addvertex}\left(1,2,3,4,5,G\right):$
 > $\mathrm{addedge}\left(\left[\left[1,2\right],\left[2,3\right],\left[3,4\right],\left[4,5\right]\right],G\right)$
 ${\mathrm{e1}}{,}{\mathrm{e2}}{,}{\mathrm{e3}}{,}{\mathrm{e4}}$ (1)
 > $\mathrm{addedge}\left(\left\{1,5\right\},G\right)$
 ${\mathrm{e5}}$ (2)
 > $\mathrm{head}\left(,G\right)$
 > $\mathrm{head}\left(G\right)$
 ${table}{}\left(\left[{\mathrm{e2}}{=}{3}{,}{\mathrm{e1}}{=}{2}{,}{\mathrm{e3}}{=}{4}{,}{\mathrm{e4}}{=}{5}\right]\right)$ (3)
 > $\mathrm{head}\left(\left[\mathrm{e1},\mathrm{e2},\mathrm{e5}\right],G\right)$
 $\left[{2}{,}{3}\right]$ (4)