Repository navigation
BUG: group betweenness gives incorrect values for undirected connected graph - #8879
Merged
Merged
Conversation
This was referenced Aug 29, 2026
rossbar
approved these changes
Aug 29, 2026
rossbar
left a comment
Contributor
There was a problem hiding this comment.
Thanks @dschult - splitting these out does indeed make this easier to review & digest. This particular fix is very straightforward and has been extensively discussed; in it goes! Thanks again for the research and breaking down the problem - looking forward to the next steps!
13 of 18 tasks
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
This splits off the simplest bug reported in #8666 and #8559 and fixes it. Related discussion in #8827.
I'm hoping splitting these up makes review simple.
The bug is that
sigmais used instead ofsigma_min two places where the symmetry of the formulas makes it clear that it should have beensigma_m. This corrects an easily checked test where no shortest paths between non-group nodes pass through the group. SoGBC==0. It was giving0.125.I also added a test that checks many groups at once and compares singleton groups with the BC values from
betweenness_centralityto ensure they are the same. That test passes before or after this fix, but I found it helpful to see that symmetry so I included it in this PR.Upcoming PRs: (todo list)
endpoints=Trueand figure out how to make it meaningful, or remove that option.prominent_group_*,group_degree_*andgroup_closeness_*.