ClosenessCentrality

As of Version 10, all the functionality of the GraphUtilities package is built into the Wolfram System. >>

ClosenessCentrality[g]
finds the closeness centrality.

DetailsDetails

  • ClosenessCentrality functionality is now available in the built-in Wolfram Language function ClosenessCentrality.
  • To use ClosenessCentrality, you first need to load the Graph Utilities Package using Needs["GraphUtilities`"].
  • The closeness centrality of a vertex u is defined as the inverse of the sum of the distance from u to all other vertices. The closeness centrality of a vertex in a disconnected graph is based on the closeness centrality of the component where this vertex belongs.
  • The following options can be given:
  • WeightedTruewhether edge weight is to be used in calculating distance
    NormalizeFalsewhether to normalize the output

ExamplesExamplesopen allclose all

Basic Examples  (2)Basic Examples  (2)

In[1]:=
Click for copyable input

This defines a small graph:

In[2]:=
Click for copyable input
In[3]:=
Click for copyable input
Out[3]=

Compute the closeness centrality:

In[4]:=
Click for copyable input
Out[4]=

This function has been superseded by ClosenessCentrality in the Wolfram System:

In[1]:=
Click for copyable input
Out[1]=
In[2]:=
Click for copyable input
Out[2]=