Overview of the networks Package

Calling Sequence


networks[command](arguments)
command(arguments)


Description


•

Each command in the networks package can be accessed by using either the long form or the short form of the command name in the command calling sequence.

•

A network is represented by a graph consisting of vertices and edges. The edges may be directed, and loops and multiple edges are allowed. The basic commands in this package perform the manipulation of the underlying graphs. Various properties of the networks as outlined below can also be computed.

•

A graph is represented by a special Maple procedure of type GRAPH. A graph is created by the command new() or by commands such as complete(), cycle(), or petersen(). Once created, the graph can be modified by using various commands. To create a copy of a graph, use the command duplicate(). Further modifications of the original graph will not affect the copy.

•

To generate a random graph use random(). Either the number of vertices and the probability of an edge occurring, or the number of vertices and edges may be specified.

•

You can add vertices and edges to the graph using the commands addvertex(), and addedge(). Vertex names are numeric by default but can be any valid Maple name. They have a default weight of 0. Edge names are taken from the sequence $\mathrm{cat}\left(e\,1..m\right)$ by default, but can be any name or string beginning with the letter `e`. Edges can be specified as sets or lists of vertices. A list indicates a directed edge, while a set indicates an undirected edge. Edges have a default weight of 1. Weights can be general Maple expressions.

•

All deletions are handled by the delete() command.

•

To determine properties of a given graph, G, use commands such as edges(G), or vertices(G).



List of networks Package Commands


•

The following is a list of available commands

•

The commands in the above list include implementations of a number of basic routines including network flows, connectivity, disjoint spanning trees, allpairs shortest path, singlesource shortest path, minimum weight spanning tree, Tutte polynomials and special evaluations of them (rank, span, acyclicity, chromatic and flow polynomials), and characteristic polynomials.



Examples


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

$\mathrm{with}\left(\mathrm{networks}\right)\:$

>

$\mathrm{new}\left(G\right)\:$

>

$\mathrm{addvertex}\left(\left\{1\,2\,3\,4\right\}\,G\right)$

${1}{\,}{2}{\,}{3}{\,}{4}$
 (1) 
>

$\mathrm{connect}\left(\left\{1\,2\right\}\,\left\{3\,4\right\}\,G\right)$

${\mathrm{e1}}{\,}{\mathrm{e2}}{\,}{\mathrm{e3}}{\,}{\mathrm{e4}}$
 (2) 
>

$\mathrm{edges}\left(G\right)$

$\left\{{\mathrm{e1}}{\,}{\mathrm{e2}}{\,}{\mathrm{e3}}{\,}{\mathrm{e4}}\right\}$
 (3) 
>

$\mathrm{connectivity}\left(G\right)$

>

$\mathrm{countcuts}\left(G\right)$

>

$\mathrm{draw}\left(G\right)\:$



Download Help Document
Was this information helpful?