Backbone extraction algorithms for complex networks
Project description
networkx_backbone
Backbone extraction algorithms for complex networks, built on NetworkX.
This library provides 65 functions across 9 modules for extracting backbone structures from weighted and unweighted networks.
Full documentation: https://www.brianckeegan.com/networkx_backbone/
Installation
pip install networkx-backbone
For full functionality (required for statistical tests, bipartite methods, and some structural methods):
pip install networkx-backbone[full]
Or install from source:
git clone https://github.com/brianckeegan/networkx_backbone.git
cd networkx_backbone
pip install -e ".[full]"
Modules
| Module | Description | Key Functions |
|---|---|---|
| statistical | Hypothesis-testing methods | disparity_filter, noise_corrected_filter, marginal_likelihood_filter, ecm_filter, lans_filter, multiple_linkage_analysis |
| structural | Topology-based methods | global_threshold_filter, strongest_n_ties, global_sparsification, primary_linkage_analysis, edge_betweenness_filter, node_degree_filter, high_salience_skeleton, metric_backbone, ultrametric_backbone, doubly_stochastic_filter, h_backbone, modularity_backbone, planar_maximally_filtered_graph, maximum_spanning_tree_backbone |
| proximity | Neighborhood-similarity scoring | jaccard_backbone, dice_backbone, cosine_backbone, hub_promoted_index, hub_depressed_index, adamic_adar_index, resource_allocation_index, local_path_index, and more |
| hybrid | Combined approaches | glab_filter |
| bipartite | Bipartite projection backbones | simple_projection, hyper_projection, probs_projection, ycn_projection, sdsm, fdsm, fixedfill, fixedrow, fixedcol, backbone |
| unweighted | Sparsification for unweighted graphs | sparsify, lspar, local_degree |
| filters | Post-hoc filtering utilities | multigraph_to_weighted, threshold_filter, fraction_filter, boolean_filter, consensus_backbone |
| measures | Evaluation and comparison | node_fraction, edge_fraction, weight_fraction, reachability, ks_degree, ks_weight, compare_backbones |
| visualization | Graph comparison plotting | graph_difference, compare_graphs, save_graph_comparison |
NetBone Core Coverage
Core method families used in netbone (Yassin et al., 2023) are represented here, including:
- Statistical:
disparity_filter,marginal_likelihood_filter,ecm_filter,noise_corrected_filter,lans_filter,multiple_linkage_analysis - Structural:
global_threshold_filter,global_sparsification,primary_linkage_analysis,edge_betweenness_filter,high_salience_skeleton,doubly_stochastic_filter,maximum_spanning_tree_backbone - Hybrid:
glab_filter
Quick Start
import networkx as nx
import networkx_backbone as nb
# Create a weighted graph
G = nx.les_miserables_graph()
# 1) Score edges
scored = nb.disparity_filter(G)
# 2) Filter edges
backbone = nb.threshold_filter(scored, "disparity_pvalue", 0.05)
# Compare backbone to original
print(f"Edges kept: {nb.edge_fraction(G, backbone):.1%}")
print(f"Nodes kept: {nb.node_fraction(G, backbone):.1%}")
Disparity filter visualization
Proximity-based scoring
# Score edges by Jaccard similarity of endpoint neighborhoods
scored = nb.jaccard_backbone(G)
# Keep only the top 20% most structurally embedded edges
backbone = nb.fraction_filter(scored, "jaccard", 0.2, ascending=False)
Bipartite backbone
B = nx.davis_southern_women_graph()
women_nodes = [n for n, d in B.nodes(data=True) if d["bipartite"] == 0]
scored = nb.sdsm(B, agent_nodes=women_nodes, projection="hyper")
backbone = nb.threshold_filter(scored, "sdsm_pvalue", 0.05, mode="below")
Projection weights follow the simple/hyper/ProbS/YCN formulations described in Coscia & Neffke (2017).
Comparing multiple methods
backbones = {
"disparity": nb.threshold_filter(nb.disparity_filter(G), "disparity_pvalue", 0.05),
"mst": nb.boolean_filter(nb.maximum_spanning_tree_backbone(G), "mst_keep"),
}
results = nb.compare_backbones(G, backbones)
Dependencies
- Required:
networkx >= 3.0 - Optional:
numpy >= 1.23,scipy >= 1.9,matplotlib >= 3.7(needed for statistical methods, bipartite methods, some structural/proximity methods, visualization helpers, and docs gallery generation)
Testing
pip install -e ".[test]"
pytest
Visualization gallery
Backbone visualizations in the docs are generated with Sphinx Gallery from
example scripts under docs/examples/.
Build docs (including the graph comparison gallery and function-linked visualizations):
pip install -e ".[docs]"
sphinx-build -b html docs docs/_build/html
References
Key papers behind the implemented methods:
- Coscia, M. & Neffke, F. M. (2017). Network backboning with noisy data. Proc. IEEE ICDE, 425-436.
- Coscia, M. & Neffke, F. M. (2017). Network backboning with noisy data (arXiv:1906.09081).
- Girvan, M., & Newman, M. E. J. (2002). Community structure in social and biological networks. PNAS, 99(12), 7821-7826.
- Grady, D., Thiemann, C., & Brockmann, D. (2012). Robust classification of salient links in complex networks. Nature Communications, 3, 864.
- Hamann, M., Lindner, G., Meyerhenke, H., Staudt, C. L., and Wagner, D. (2016). Structure-Preserving Sparsification Methods for Social Networks. Social Network Analysis and Mining, 6, 22.
- Simas, T., Correia, R. B., & Rocha, L. M. (2021). The distance backbone of complex networks. J. Complex Networks, 9(6), cnab021.
- Neal, Z. P. (2014). The backbone of bipartite projections. Social Networks, 39, 84-97.
- Neal, Z. P. (2022). backbone: An R package to extract network backbones. PLoS One, 17(5), e0269137.
- Satuluri, V., Parthasarathy, S., & Ruan, Y. (2011). Local graph sparsification for scalable clustering. SIGMOD, 721-732.Serrano, M. A., Boguna, M., & Vespignani, A. (2009). Extracting the multiscale backbone of complex weighted networks. PNAS, 106(16), 6483-6488.
- Van Nuffel, N., Heyndrickx, C., & Wets, G. (2010). Measuring hierarchy and reciprocity in networks.
- Yassin, A., Haidar, A., Cherifi, H., Seba, H., & Togni, O. (2023). An evaluation tool for backbone extraction techniques in weighted complex networks. Scientific Reports, 13, 17000.
- Yassin A., Cherifi, H., Seba, H., & Togni, O. (2025). Backbone extraction through statistical edge filtering: A comparative study. PLoS One, 20(1): e0316141.
- Yassin A., Cherifi, H., Seba, H., & Togni, O. (2025). Exploring weighted network backbone extraction: A comparative analysis of structural techniques. PLoS One, 20(5): e0322298.
Other libraries and datasets:
- Yassin, A., Haidar, A., Cherifi, H., Seba, H., & Togni, O. (2023). netbone.
- Yassin, A., et al. (2025). structural-backbone-methods-comparison.
- Neal, Z. (2022). backbone.
- Chrol, B. & Bojanowski, M. (2018). Proximity-based Methods for Link Prediction.
License
BSD 3-Clause License. See LICENSE for details.
Project details
Release history Release notifications | RSS feed
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
Built Distribution
Filter files by name, interpreter, ABI, and platform.
If you're not sure about the file name format, learn more about wheel file names.
Copy a direct link to the current filters
File details
Details for the file networkx_backbone-0.2.0.post1.dev9.tar.gz.
File metadata
- Download URL: networkx_backbone-0.2.0.post1.dev9.tar.gz
- Upload date:
- Size: 6.7 MB
- Tags: Source
- Uploaded using Trusted Publishing? Yes
- Uploaded via: twine/6.1.0 CPython/3.13.7
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
fa644a8438ad300d6d2d0136c3dc0362d631e132aac5fa32f41e667dffcea74e
|
|
| MD5 |
0401d62cd669625d8d445887938b8bea
|
|
| BLAKE2b-256 |
a255f2cd1a770737c07e09ae74ea68daa8dd3d65408ffc2c5b400569181d14e2
|
Provenance
The following attestation bundles were made for networkx_backbone-0.2.0.post1.dev9.tar.gz:
Publisher:
publish-to-PyPI.yml on brianckeegan/networkx_backbone
-
Statement:
-
Statement type:
https://in-toto.io/Statement/v1 -
Predicate type:
https://docs.pypi.org/attestations/publish/v1 -
Subject name:
networkx_backbone-0.2.0.post1.dev9.tar.gz -
Subject digest:
fa644a8438ad300d6d2d0136c3dc0362d631e132aac5fa32f41e667dffcea74e - Sigstore transparency entry: 954040496
- Sigstore integration time:
-
Permalink:
brianckeegan/networkx_backbone@2fd498f769b51d9de77c2933c1bfed15eb093913 -
Branch / Tag:
refs/heads/main - Owner: https://github.com/brianckeegan
-
Access:
public
-
Token Issuer:
https://token.actions.githubusercontent.com -
Runner Environment:
github-hosted -
Publication workflow:
publish-to-PyPI.yml@2fd498f769b51d9de77c2933c1bfed15eb093913 -
Trigger Event:
workflow_dispatch
-
Statement type:
File details
Details for the file networkx_backbone-0.2.0.post1.dev9-py3-none-any.whl.
File metadata
- Download URL: networkx_backbone-0.2.0.post1.dev9-py3-none-any.whl
- Upload date:
- Size: 44.3 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? Yes
- Uploaded via: twine/6.1.0 CPython/3.13.7
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
d6ce7baaca800bdf2b2b7cf05fb29a20157c057c3366c2bec8f6b2cb6062d577
|
|
| MD5 |
df4cf7d4d090752fd4f2fe59f975d6f9
|
|
| BLAKE2b-256 |
a357eea55266779129748cf08ac2738ba540106346803245aa213357060a2865
|
Provenance
The following attestation bundles were made for networkx_backbone-0.2.0.post1.dev9-py3-none-any.whl:
Publisher:
publish-to-PyPI.yml on brianckeegan/networkx_backbone
-
Statement:
-
Statement type:
https://in-toto.io/Statement/v1 -
Predicate type:
https://docs.pypi.org/attestations/publish/v1 -
Subject name:
networkx_backbone-0.2.0.post1.dev9-py3-none-any.whl -
Subject digest:
d6ce7baaca800bdf2b2b7cf05fb29a20157c057c3366c2bec8f6b2cb6062d577 - Sigstore transparency entry: 954040514
- Sigstore integration time:
-
Permalink:
brianckeegan/networkx_backbone@2fd498f769b51d9de77c2933c1bfed15eb093913 -
Branch / Tag:
refs/heads/main - Owner: https://github.com/brianckeegan
-
Access:
public
-
Token Issuer:
https://token.actions.githubusercontent.com -
Runner Environment:
github-hosted -
Publication workflow:
publish-to-PyPI.yml@2fd498f769b51d9de77c2933c1bfed15eb093913 -
Trigger Event:
workflow_dispatch
-
Statement type: