ClosenessCentrality - Maple Help

GraphTheory

 ClosenessCentrality
 compute closeness centrality

 Calling Sequence ClosenessCentrality(G) ClosenessCentrality(G, v)

Parameters

 G - graph v - (optional) a vertex of G

Description

 • ClosenessCentrality returns the closeness centrality for a specified vertex in the given graph G, or if no vertex is specified, returns a list of the closeness centralities for each vertex in G.
 • The closeness centrality of a vertex v is the reciprocal of the average graph distance between v and every vertex reachable from v.

Examples

 > $\mathrm{with}\left(\mathrm{GraphTheory}\right):$

Compute the closeness centrality for a specified graph.

 > $G≔\mathrm{Graph}\left(6,\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{DrawGraph}\left(G\right)$
 > $\mathrm{ClosenessCentrality}\left(G\right)$
 $\left[\frac{{5}}{{8}}{,}\frac{{5}}{{8}}{,}\frac{{5}}{{8}}{,}\frac{{5}}{{7}}{,}\frac{{5}}{{8}}{,}{1}\right]$ (2)

Compatibility

 • The GraphTheory[ClosenessCentrality] command was introduced in Maple 2020.