Skip to content

Add KADABRA betweenness centrality approximation algorithm - #518

Open
DerSchmachtin wants to merge 1 commit into
JuliaGraphs:masterfrom
DerSchmachtin:master
Open

Add KADABRA betweenness centrality approximation algorithm#518
DerSchmachtin wants to merge 1 commit into
JuliaGraphs:masterfrom
DerSchmachtin:master

Conversation

@DerSchmachtin

@DerSchmachtin DerSchmachtin commented Jul 31, 2026

Copy link
Copy Markdown

Description

This Pull Request introduces the KADABRA (K-ADaptive Approximation of Betweenness centrAlity) algorithm to Graphs.jl.

Computing exact betweenness centrality can be prohibitively expensive on very large graphs. KADABRA provides a fast and highly scalable randomized approximation of the betweenness centrality, as well as an efficient method to find the top-k nodes with the highest betweenness.

The implementation includes two main exported functions:

  • kadabra_centrality: Approximates the betweenness centrality for all vertices.
  • kadabra_top_k: Returns the top k vertices with the highest betweenness centrality.

Reference:

Borassi M., Natale E. (2016) KADABRA is an ADaptive Algorithm for Betweenness via Random Approximation. In: ESA 2016. [https://dl.acm.org/doi/10.1145/3284359]

Checklist

  • Added kadabra.jl to src/centrality/
  • Added corresponding test suite in test/centrality/kadabra.jl and registered it in runtests.jl
  • Code has been formatted using JuliaFormatter.jl according to BlueStyle
  • Added documentation strings and exported the functions in Graphs.jl
  • Ensured RNG scoping follows Graphs.jl conventions using standard library imports

All tests pass locally. Let me know if there are any changes or further optimizations you would like me to make!

Benchmarks & Performance

To verify the performance, I ran some benchmarks comparing this Julia implementation against the original, highly optimized C++ version from the authors.

Hardware Setup:
All benchmarks were executed on an AMD Ryzen Threadripper 3960X 24-Core Processor (3.80 GHz, 48 threads) with 125 GiB of RAM running Ubuntu 22.04 LTS.

The Julia implementation is competitive compared to the Original C++ Implementation.
Here are the results (using k=0, delta=0.1 and epsilon=0.0001) on a few test instances taken from SNAP:

image

@DerSchmachtin
DerSchmachtin force-pushed the master branch 2 times, most recently from a71b033 to 47fd306 Compare July 31, 2026 18:26
@codecov

codecov Bot commented Jul 31, 2026

Copy link
Copy Markdown

Codecov Report

❌ Patch coverage is 99.05660% with 5 lines in your changes missing coverage. Please review.
✅ Project coverage is 97.57%. Comparing base (356aa72) to head (e213fd1).

Files with missing lines Patch % Lines
src/centrality/kadabra.jl 99.05% 5 Missing ⚠️
Additional details and impacted files
@@            Coverage Diff             @@
##           master     #518      +/-   ##
==========================================
+ Coverage   97.46%   97.57%   +0.11%     
==========================================
  Files         127      129       +2     
  Lines        7766     8341     +575     
==========================================
+ Hits         7569     8139     +570     
- Misses        197      202       +5     

☔ View full report in Codecov by Harness.
📢 Have feedback on the report? Share it here.

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.

@DerSchmachtin
DerSchmachtin force-pushed the master branch 5 times, most recently from 1b7aaad to 6d1291d Compare August 5, 2026 07:42
@DerSchmachtin
DerSchmachtin force-pushed the master branch 4 times, most recently from e7d10c9 to 0298521 Compare August 14, 2026 11:24
Implements the KADABRA approximation algorithm for betweenness
centrality (Borassi & Natale, 2019), including the adaptive
delta-calibration phase, and registers it in the docs, CHANGELOG
and test suite.

Also switches the JET testset to `target_modules=(Graphs,)`, since
`target_defined_modules` was removed in JET 0.12 and now raises a
JETConfigError.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant