You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
Sampled betweenness in suggest_questions takes 45 to 70s on large graphs #5667
On v8 at d249de36 (0.9.124), suggest_questions computes betweenness with 100 sampled sources on every full rebuild and every update that changes topology. _betweenness_centrality at graphify/analyze.py:499 matches networkx exactly since #5303, but it still runs Python code for every neighbor of every source.
Graph
Nodes
Median of 3 runs
Django
55k
5.0s
Kubernetes
472k
44.6s
VS Code
315k
67.6s
To reproduce, load a large graphify-out/graph.json with build_from_json and time _betweenness_centrality(G, 100, seed=42). Linux, CPython 3.12.3, networkx 3.7, numpy 1.26.4.
Proposed: run each source's search one level at a time with numpy and keep every sum in networkx's order, so the scores stay identical to the last bit.
Activity
github-actions commentedon Dec 1, 2026
Thanks for opening this issue, @Max17190. A maintainer will take a look soon.
If you would like to discuss it in real time, come say hi on our Discord server. For longer-form questions and ideas there is also GitHub Discussions.
To help us triage, please make sure the report includes what you expected, what actually happened, and the steps (and a small sample) to reproduce it.