此为 Mathematica 7 文档,内容基于更早版本的 Wolfram 语言
查看最新文档(版本11.1)

ClosenessCentrality

ClosenessCentrality[g]
finds the closeness centrality.
  • 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
Needs["GraphUtilities`"]
This defines a small graph:
In[2]:=
Click for copyable input
In[3]:=
Click for copyable input
Out[3]=
This shows that vertex 2, being at the center of this graph, has a higher closeness centrality:
In[4]:=
Click for copyable input
Out[4]=
 
Needs["GraphUtilities`"]
This defines a disconnected graph and finds the closeness centrality:
In[2]:=
Click for copyable input
In[3]:=
Click for copyable input
Out[3]=
In[4]:=
Click for copyable input
Out[4]=