networks(deprecated)/diameter - Help

# Online Help

###### All Products    Maple    MapleSim

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

networks

 diameter
 compute the diameter of a graph or network

 Calling Sequence diameter(G)

Parameters

 G - graph or network

Description

 • Important: The networks package has been deprecated.  Use the superseding command GraphTheory[Diameter] instead.
 • This routine uses allpairs() to compute the minimum distance between any two vertices.
 • The result is returned as a number indicating the diameter, or infinity if the graph is disconnected.
 • Edge weights are assumed to be lengths or distances. Thus edge weights must be non-negative.
 • Undirected edges are assumed to be bidirectional.
 • This routine is normally loaded via the command with(networks) but may also be referenced using the full name networks[diameter](...).

Examples

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

 > $\mathrm{with}\left(\mathrm{networks}\right):$
 > $G≔\mathrm{petersen}\left(\right):$
 > $T≔\mathrm{diameter}\left(G\right)$
 ${T}{:=}{2}$ (1)

 See Also

## Was this information helpful?

 Please add your Comment (Optional) E-mail Address (Optional) What is ? This question helps us to combat spam