Hi, Thanks for the bug report. It seems that the C core of igraph does not have this error so the problem is in the glue code that bridges the gap between the C core and R itself. Gabor will probably fix it soon (if it is not fixed already in the development tree). In the meanwhile, you can work around the bug by knowing that the theoretical maximum of centralization.betweenness is (n-1)*(n-1)*(n-2) if your graph is directed and has n vertices, and (n-1)*(n-1)*(n-2)/2 if it is undirected.
All the best, Tamas On 29 Jan 2013, at 19:47, F Witmer <[email protected]> wrote: > I searched the archives and see some prior discussion regarding a problem > with the betweenness calculation, but it looks like those issues were > resolved. When calculating the betweenness centralization, the theoretical > max value appears to be incorrect causing nonsensical (negative) results. > Here's some R code and the results I get to reproduce it: > > > library("igraph") > > g <- barabasi.game(5000) > > centralization.betweenness(g)$theoretical_max > [1] 345973414 > > centralization.betweenness(g)$centralization > [1] 0.07282635 > > g <- barabasi.game(10000) > > centralization.betweenness(g)$theoretical_max > [1] -1127329970 > > centralization.betweenness(g)$centralization > [1] -0.02273176 > > And here's my session info: > > > sessionInfo() > R version 2.15.2 (2012-10-26) > Platform: x86_64-w64-mingw32/x64 (64-bit) > > locale: > [1] LC_COLLATE=English_United States.1252 LC_CTYPE=English_United > States.1252 > [3] LC_MONETARY=English_United States.1252 LC_NUMERIC=C > > [5] LC_TIME=English_United States.1252 > > attached base packages: > [1] stats graphics grDevices utils datasets methods base > > other attached packages: > [1] igraph_0.6-3 > > loaded via a namespace (and not attached): > [1] tools_2.15.2 > > > _______________________________________________ > igraph-help mailing list > [email protected] > https://lists.nongnu.org/mailman/listinfo/igraph-help _______________________________________________ igraph-help mailing list [email protected] https://lists.nongnu.org/mailman/listinfo/igraph-help
