feat: implementation for group_degree_centrality, group_closeness_centrality, and group_betweenness_centrality#1565
Conversation
|
|
|
Some preliminary thoughts:
Using NetworkX as a ground source of truth is a great idea. But it's also nice not to be affected by their API changes. We had to do that for other centrality methods. |
|
thanks for the feedback! I made the lints + hardcoded the tests while documenting the nx version to get them. I undid the unrelated formatting/cleanup to this PR here: 7904d20 I can revert it if you want to include them |
|
We changed the Python formatter so I guess the failures are on me. Oh well just check https://github.com/Qiskit/rustworkx/blob/main/CONTRIBUTING.md, make 0.18 has been delayed regardless, so your PR will still make the release. |
|
ok thanks I added the release note plus the lints |
hi I added these three functions because I'd like to use them in squidpy instead of pure python version.
group_degree_centrality,group_closeness_centrality, andgroup_betweenness_centralityfor both digraph and graphNote
While writing cross-validation tests against NetworkX, I discovered that
NetworkX's
group_betweenness_centralityis buggy on directed graphs thatare not strongly connected (returns negative values, crashes with
KeyError).Filed upstream: networkx/networkx#8559.
The NX comparison tests here only use strongly-connected directed graphs to
avoid this.