networks(deprecated)/eweight - Maple Help

networks

 eweight
 finds edgeweights in a graph

 Calling Sequence eweight(G) eweight(e, G)

Parameters

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

Description

 • Important: The networks package has been deprecated.  Use the superseding command GraphTheory[WeightMatrix] instead.
 • This routine is used to determine the edge weights of edges in a graph G.
 • If the only parameter is a graph G then the edge weight table of the graph is returned. Any subsequent modifications of this table directly affect the graph.
 • The default edge weights are 1, but can be reassigned as any valid maple object.  Procedures such as gsimp() can be provided with user defined rules for calculating new weights during the simplification of a graph.
 • If e is an edge then the weight of e is returned.  If e is a list of edges then a list of weights is returned.
 • This routine is normally loaded via the command with(networks) but may also be referenced using the full name networks[eweight](...).

Examples

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

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