0

I'm writing a JavaScript library for calculating graph measurements such as degree centrality, eccentrality, closeness and betweenness.

In order to validate my library I use two exist applications Gephi and NodeXL to run calculation with them. The problem is I got what looks like different results.

I build simple graph:

  (A) ----- (B)
   |         |
   |         | 
  (C) ----- (D)

Gephi gave those results:

A ecc=2 close=1.333 bet=0.5
B ecc=2 close=1.333 bet=0.5
C ecc=2 close=1.333 bet=0.5
D ecc=2 close=1.333 bet=0.5

NodeXL gave those results:

A close=0.25 bet=0.5
B close=0.25 bet=0.5
C close=0.25 bet=0.5
D close=0.25 bet=0.5

Note that NodeXL does not calculate eccentrality.

Which one is right?
Are the results really different?

I didn't normalize (or at least not intend to normalize) any results.

zina
  • 144
  • 11
Ido Ran
  • 10,584
  • 17
  • 80
  • 143
  • Is your graph fully connected and directed? The path based centrality measurements will still give a number, even though it is not possible to make a path. – adm Aug 30 '21 at 21:30

2 Answers2

2

It seems that Gephi returns the average sum of all shortest paths between a node and all other nodes in the network (also stated in the doc) for A this gives: (1 + 1 + 2)/3=1.333333

while NodeXL gives you the inverse sum of all shortest paths: for A 1/(1+1+2)=0.25

So, I'd say the later is correct, as this is following the definition of closeness centrality. E.g. igraph also uses the second version.

kku
  • 186
  • 5
2

actually both measures are right. The one computed by NodeXL is the closeness centrality and the other computer by Gephi is the inverse closeness centrality. Therefore, in the case of inverse closeness centrality the higher the value, the close to the center.

The difference between both centralities lies in consideration of graph sizes and efficiency. The closeness centrality is independent from graph sizes => comparison of closeness of nodes from different networks can be done. The inverse centrality is more efficient (precise) calculation of the closeness but it depends on the graph size.

References:

Sabidussi, G.: The centrality index of a graph. Psychometrika 31(4) (1966) 581{ 603

Linton C. Freeman: Centrality in Social Networks. Conceptual Clarification. Social Networks 1 (1978/79) 215-239

Hope that can clarify the difference.

zina
  • 144
  • 11
  • Would you mind telling me where did you get the term "inverse closeness centrality" from? – orezvani Apr 09 '15 at 04:56
  • In Freeman's paper http://leonidzhukov.net/hse/2014/socialnetworks/papers/freeman79-centrality.pdf but he did not explcitly call it inverse closeness – zina May 28 '15 at 08:45