GraphTheory

 find the minimum eccentricity of a graph

Parameters

 G - graph

Description

 • Radius returns the minimum eccentricity over all vertices in the graph G.
 • If G is disconnected, then the output is infinity.
 • For weighted graphs the edge weights are used to denote the distance accrued while traveling along each edge.  For unweighted graphs the length of each edge is assumed to be 1.

Examples

 > $\mathrm{with}\left(\mathrm{GraphTheory}\right):$
 > $\mathrm{with}\left(\mathrm{SpecialGraphs}\right):$
 > $P≔\mathrm{PetersenGraph}\left(\right)$
 ${P}{≔}{\mathrm{Graph 1: an undirected unweighted graph with 10 vertices and 15 edge\left(s\right)}}$ (1)
 > $\mathrm{Radius}\left(P\right)$
 ${2}$ (2)
 > $C≔\mathrm{CycleGraph}\left(19\right)$
 ${C}{≔}{\mathrm{Graph 2: an undirected unweighted graph with 19 vertices and 19 edge\left(s\right)}}$ (3)
 > $\mathrm{Radius}\left(C\right)$
 ${9}$ (4)
 > $G≔\mathrm{Graph}\left(\left\{\left[\left\{1,2\right\},0.2\right],\left[\left\{1,4\right\},1.1\right],\left[\left\{2,3\right\},0.3\right],\left[\left\{3,4\right\},0.4\right]\right\}\right)$
 ${G}{≔}{\mathrm{Graph 3: an undirected weighted graph with 4 vertices and 4 edge\left(s\right)}}$ (5)
 > $\mathrm{DMrawGraph}\left(G\right)$
 ${\mathrm{DMrawGraph}}{}\left({\mathrm{Graph 3: an undirected weighted graph with 4 vertices and 4 edge\left(s\right)}}\right)$ (6)
 > $\mathrm{Radius}\left(G\right)$
 ${0.5}$ (7)

The distance between vertices 1 and 4 is maximal

 > $\mathrm{DijkstrasAlgorithm}\left(G,1,4\right)$
 $\left[\left[{1}{,}{2}{,}{3}{,}{4}\right]{,}{0.9}\right]$ (8)

Compatibility

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