gephi/trunk — Issue #149: Wrong relative betweenness
Author: mbastian
Created: 2011-10-22 16:43:13+00:00
State: open
Labels: Fix Released, Medium, statistics

Hi all,

I'm a bit confused about the calculation of the relative betweennness. As far as I see in the source code, the betweenness is normalized by (n-1)(n-2)/2 for directed and (n-1)(n-2) for undirected graphs:

--snip-- //GraphDistance.java
if (!mDirected) {
mBetweenness[s_index] /= 2;
}
if (this.mRelativeValues) {
mCloseness[s_index] = 1.0 / mCloseness[s_index];
mBetweenness[s_index] /= ((mN - 1) * (mN - 2)) / 2;
}
--snap--

However, this is not correct and should be directly opposed. The betweenness for directed graphs is normalized by (n-1)(n-2) and for undirected graphs by (n-1)(n-2)/2.

Is there something I missed?

Thanks
matthias