 GraphTheory - Maple Programming Help

Home : Support : Online Help : Mathematics : Discrete Mathematics : Graph Theory : GraphTheory Package : GraphTheory/BetweennessCentrality

GraphTheory

 BetweennessCentrality
 compute betweenness centrality

 Calling Sequence BetweennessCentrality(G) BetweennessCentrality(G, v)

Parameters

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

Description

 • BetweennessCentrality returns the betweenness centrality for a specified vertex in the given graph G, or if no vertex is specified, returns a list of the betweenness centralities for each vertex in G.
 • The betweenness centrality of a vertex v is a measure of the proportion of shortest paths through the graph which pass through v. It is the sum over all pairs of vertices a and b (both different from v) of the number of least-weight paths from a to b which pass through v divided by the total number of least-weight paths from a to b.

Examples

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

Compute the betweenness 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{BetweennessCentrality}\left(G,6\right)$
 $\frac{{13}}{{2}}$ (2)
 > $\mathrm{BetweennessCentrality}\left(G\right)$
 $\left[{0}{,}{0}{,}{0}{,}\frac{{1}}{{2}}{,}{0}{,}\frac{{13}}{{2}}\right]$ (3)

Compatibility

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