Repository navigation
BUG: Group betweenness centrality counts paths incorrectly for directed but not strongly connected. - #8880
Conversation
rossbar
left a comment
There was a problem hiding this comment.
Thanks @dschult , decomposing the problem is indeed very helpful and it's much easier to understand what's happening with this particular change. I especially like the switch from scale -> extra, and the refactor of how/where it is handled and ultimately applied.
The simple re-naming of the scale factor (with respect to normalization) is a nice touch as well - it's now much more recognizable as the "classic" 1 / (n(n-1)) factor!
I approve the PR and took the liberty of merging main in after #8879 was merged1. I'll hold off from merging since this is still in draft status in case there are other things you'd like to append here - but feel free to merge yourself or I'll do so once the draft status is removed!
Footnotes
-
If one wants PRs broken down into smaller bits they better be willing to help with the merge conflicts 🙃 ↩
This PR builds on #8879 and should be consider after that is merged.
Fixes #8559
Replaces #8666
This PR fixes the subtraction of path counts for shortest paths that start or end in the group (handling endpoints in the group). The current code handles a strongly connected directed graph, but not a general directed graph. So this adds the missing section of the if-structure for counting paths in directed graphs. The old code used a single workflow for directed and undirected cases when not fully connected.
Two tests (that fail on main) are added in one commit and then the fix is in the next commit. One of the tests fails without #8879 which is why this builds on that. The code doesn't overlap, but the content does. :}
I changed the name
scaletoextrabecause scaling usually is multiplying by a scalar whereas this subtracts the extra path counts. I also rewrote the nested for loop using comprehensions -- which is hopefully more readable in this case. Suggestions welcome!Still to do:
endpoints=Trueand figure out how to make it meaningful, or remove that option.prominent_group_*,group_degree_*andgroup_closeness_*.