 IsNetwork - Maple Help

GraphTheory

 IsNetwork
 test if graph is a network Calling Sequence IsNetwork(G, s, t) IsNetwork(G) Parameters

 G - directed graph s - vertex t - vertex Description

 • A network is a connected directed graph with at least one vertex with indegree 0 (the source) and at least one vertex with outdegree 0 (the sink). Note that under this definition a network may have an internal cycle.
 • IsNetwork('G','s','t') outputs true if the directed graph G is a network with s as the source and t as the sink, and false otherwise.
 • IsNetwork('G') tests if a directed graph is a network. The output is a sequence of two sets of vertices, sources and sinks, of all possible sources and sinks.  If these sets are both empty then G is implicitly not a network. Examples

 > $\mathrm{with}\left(\mathrm{GraphTheory}\right):$
 > $N≔\mathrm{Digraph}\left(\left\{\left[1,2\right],\left[1,3\right],\left[2,4\right],\left[3,4\right]\right\}\right)$
 ${N}{≔}{\mathrm{Graph 1: a directed unweighted graph with 4 vertices and 4 arc\left(s\right)}}$ (1)
 > $\mathrm{IsNetwork}\left(N\right)$
 $\left\{{1}\right\}{,}\left\{{4}\right\}$ (2)
 > $\mathrm{IsNetwork}\left(N,1,4\right)$
 ${\mathrm{true}}$ (3)
 > $\mathrm{IsNetwork}\left(N,1,2\right)$
 ${\mathrm{false}}$ (4)
 > $\mathrm{DrawNetwork}\left(N\right)$ 