1
$\begingroup$

Basically, I don't understand what is going on. When I calculate the normalized betweenness centrality with R using this function:

library(igraph)
mc -> graph, 
V(mc) -> vertices
betweenness(mc, v = V(mc), directed = FALSE, weights = NULL, nobigint = TRUE, normalized = TRUE)

The results are totally different from those found in networkx from python using this function:


import networkx as nx
nx.betweenness_centrality(mc, k=None, normalized=True, weight=None, endpoints=False, seed=None)

The networkx results are the same as the one found in the Gephi software as well.

I plotted the results of both columns below.

enter image description here

Is there a problem in the way I use the R igraph function? Thanks !

$\endgroup$
2
  • $\begingroup$ There are different ways of normalizing the betweenness, did you check in the documentation that these tools use the same? Also, what about the raw (not normalized) betweenness, do you get the same results with all tools? $\endgroup$ Commented Dec 1, 2019 at 10:17
  • $\begingroup$ Shortest Path can be calculated either based on shortest cost path or shortest length path. Networkx follows shortest cost path and gephi follows shortest length path. $\endgroup$ Commented Sep 9, 2023 at 1:17

0

Browse other questions tagged or ask your own question.