Eccentricity - Maple Help

GraphTheory

 Eccentricity
 compute graph eccentricity

 Calling Sequence Eccentricity(G, opts) Eccentricity(G, v)

Parameters

 G - graph v - (optional) vertex of G opts - (optional) one or more options as specified below

Options

 The options argument can contain one or more of the options shown below.
 • output=Array, DataSeries, list, or Vector.
 This option specifies an alternate container type for the return value. When output is one of Array, list, or Vector, a container of the named type containing the eccentricities for each vertex is returned. When output is DataSeries, the return value is a DataSeries object whose labels correspond to the graph vertices and whose values are the computed eccentricities for the associated vertices. The default container type is a list.
 The output option cannot be used when a particular vertex v is specified.

Description

 • The Eccentricity(G,v) command computes the eccentricity for the vertex v in the graph G.
 • The Eccentricity(G) command returns a list of the computed eccentricities for each vertex in the graph G, listed in the order in which the vertices appear in the list returned by Vertices(G).

Definition

 • The eccentricity of a vertex v in a graph G is a number which represents the maximum graph distance between v and any other vertex in the graph.
 • If G is disconnected, then the eccentricity for every vertex is infinity.
 • If G is a complete graph, then the eccentricity for every vertex is 1.
 • The maximum of the eccentricities in G is the diameter of G. The minimum of the eccentricities in G is the radius of G.

Examples

 > $\mathrm{with}\left(\mathrm{GraphTheory}\right):$
 > $G≔\mathrm{Graph}\left(\left[1,2,3,4,5,6\right],\left\{\left\{1,3\right\},\left\{1,6\right\},\left\{2,4\right\},\left\{2,6\right\},\left\{3,6\right\},\left\{4,5\right\},\left\{4,6\right\},\left\{5,6\right\}\right\}\right)$
 ${G}{≔}{\mathrm{Graph 1: an undirected unweighted graph with 6 vertices and 8 edge\left(s\right)}}$ (1)
 > $\mathrm{DMrawGraph}\left(G\right)$
 ${\mathrm{DMrawGraph}}{}\left({\mathrm{Graph 1: an undirected unweighted graph with 6 vertices and 8 edge\left(s\right)}}\right)$ (2)

Compute the eccentricity for vertex 6.

 > $\mathrm{Eccentricity}\left(G,6\right)$
 ${1}$ (3)

Produce a list of eccentricities for all vertices.

 > $\mathrm{Eccentricity}\left(G\right)$
 $\left[{2}{,}{2}{,}{2}{,}{2}{,}{2}{,}{1}\right]$ (4)

Produce a DataSeries with labels corresponding to the named vertices.

 > $H≔\mathrm{Graph}\left(\left[a,b,c,d\right],\left\{\left\{a,b\right\},\left\{a,d\right\},\left\{b,c\right\},\left\{c,d\right\}\right\}\right)$
 ${H}{≔}{\mathrm{Graph 2: an undirected unweighted graph with 4 vertices and 4 edge\left(s\right)}}$ (5)
 > $\mathrm{Eccentricity}\left(H,\mathrm{output}=\mathrm{DataSeries}\right)$
 $\left[\begin{array}{cc}{a}& {2}\\ {b}& {2}\\ {c}& {2}\\ {d}& {2}\end{array}\right]$ (6)

Compatibility

 • The GraphTheory[Eccentricity] command was introduced in Maple 2017.