NEXP pre-proposal for backbone subpackage

59 views
Skip to first unread message

Brian Keegan

unread,
Feb 10, 2026, 4:57:12 PMFeb 10
to networkx-discuss
I'd like to propose adding a backbone extraction subpackage to NetworkX and want to check whether this is suitable for a NXEP

Sparsifying a weighted network down to its structurally significant edges is a standard operation in network analysis, but NetworkX currently has no native support for it. Users rely on external packages like netbone (Yassin et al. 2023, Sci. Rep. 13:17000) or Neal's backbone R package (2022, PLOS ONE 17:e0269137), or reimplement methods from papers. 

The netbone package is particularly relevant here: it's MIT licensed, well-tested, covers 20 methods across statistical, structural, and hybrid categories, and has been validated across 33 real-world networks in a recent comparative study (Yassin et al. 2025, PLOS ONE 20:e0322298).

The proposal is to translate netbone's implementations into a networkx.algorithms.backbone subpackage with a native nx.Graph API, supplemented by bipartite projection and unweighted sparsification methods from Neal's R package. The design separates scoring from filtering: methods store computed scores (p-values, salience, etc.) as edge attributes, and users apply threshold or fraction filters explicitly. Methods that produce a fixed subgraph (metric backbone, MST, PMFG) return the backbone graph directly. The module would also include evaluation measures for comparing backbones, which addresses a practical gap both packages have documented. No dependencies beyond numpy and scipy would be needed.

I have a reference implementation covering 25+ methods with 182 tests passing and would welcome feedback on a few questions. 

First, does backbone extraction belong in NetworkX proper, or is it better keep as a standalone package like netbone? 

Second, is 20+ methods too broad for an initial proposal, or should I start with a smaller core set? 

Third, are there concerns about the scoring-then-filtering pattern as an API convention? 

Any guidance on whether and how to proceed with a NXEP would be much appreciated.

Brian Keegan

unread,
Feb 11, 2026, 10:08:02 PMFeb 11
to networkx-discuss
I'll be working on the backbone project here: https://github.com/brianckeegan/networkx_backbone

Mubarek Juhar

unread,
Apr 5, 2026, 9:48:18 AMApr 5
to networkx...@googlegroups.com
Subject: Re: Proposal: NetworkX Backbone Extraction Subpackage
Hi Brian,
Thank you for sharing the detailed overview and reference implementation of networkx_backbone. The library looks very comprehensive and well-structured, covering 65 functions across 9 modules, including statistical, structural, proximity, bipartite, hybrid, and unweighted methods, along with filters, evaluation, and visualization.
A few highlights:
Statistical methods: disparity_filter, noise_corrected_filter, marginal_likelihood_filter, etc.
Structural methods: mst, metric_backbone, planar_maximally_filtered_graph, high_salience_skeleton, etc.
Proximity-based scoring: Jaccard, Dice, Cosine, Adamic-Adar, Resource Allocation, and others
Bipartite backbones: sdsm, fdsm, fixedfill, hyper_projection, etc.
Filtering & evaluation utilities: threshold_filter, fraction_filter, compare_backbones, edge_fraction, node_fraction
Here’s a minimal workflow demonstrating the scoring → filtering → evaluation pattern:
Python
Copy code
import networkx as nx
import networkx_backbone as nb

# Create a weighted graph
G = nx.les_miserables_graph()

# Step 1: Score edges
scored = nb.disparity_filter(G)

# Step 2: Filter edges by threshold
backbone = nb.threshold_filter(scored, "disparity_pvalue", 0.05)

# Step 3: Compare backbone to original
print(f"Edges kept: {nb.edge_fraction(G, backbone):.1%}")
print(f"Nodes kept: {nb.node_fraction(G, backbone):.1%}")
This API design—separating scoring and filtering while also providing fixed-backbone methods—is very clear and flexible. Including this in NetworkX would make backbone extraction widely accessible and reproducible for users who currently rely on external packages or reimplementation from papers.
Best regards,
Mubarek
GitHub: mubarek57⁠�

On Sun, Apr 5, 2026, 12:10 AM Mubarek Juhar <juharm...@gmail.com> wrote:
Subject: Re: Proposal: NetworkX Backbone Extraction Subpackage
Hi Brian,
Thank you for sharing your proposal and reference implementation—this looks very promising. A few thoughts based on your questions:
Inclusion in NetworkX vs standalone: Backbone extraction fits well within NetworkX. It’s a common operation and having it natively improves accessibility and reproducibility.
Number of methods: For an NXEP, starting with a core set of 4–5 methods is ideal:
Statistical: disparity_filter, noise_corrected_backbone
Structural: mst, metric_backbone
Optional: salience_backbone
Scoring → filtering pattern: This is sensible. A few tips:
Input graphs should not be mutated
Standardize edge attributes, e.g., score_*, pvalue_*
Provide clear examples for filtering
Here’s a minimal workflow illustrating your proposed API:
Python id="8jwoei"
Copy code
import networkx as nx
from networkx.algorithms.backbone import (
    disparity_filter, threshold_filter, mst, backbone_similarity
)

# Create a small weighted graph
G = nx.Graph()
G.add_edge("A", "B", weight=5)
G.add_edge("A", "C", weight=3)
G.add_edge("B", "C", weight=2)
G.add_edge("B", "D", weight=4)
G.add_edge("C", "D", weight=1)

# Step 1: Compute significance scores
G_scored = disparity_filter(G, weight="weight")

# Step 2: Filter edges by threshold
H_backbone = threshold_filter(G_scored, attribute="pvalue_disparity", threshold=0.05)

# Step 3: Compute a structural backbone
H_mst = mst(G, weight="weight")

# Step 4: Compare backbones
sim = backbone_similarity(H_backbone, H_mst)
print(f"Backbone similarity: {sim:.2f}")
This pattern clearly separates scoring from filtering, while also allowing fixed-backbone methods to return subgraphs directly.
Overall, I think the proposal is strong and ready for NXEP submission, especially if you start with this minimal core set of methods.
Best regards,
Mubarek
GitHub: mubarek57⁠�

--
You received this message because you are subscribed to the Google Groups "networkx-discuss" group.
To unsubscribe from this group and stop receiving emails from it, send an email to networkx-discu...@googlegroups.com.
To view this discussion visit https://groups.google.com/d/msgid/networkx-discuss/a5a6903e-c07c-423d-852b-fef7b39b20e7n%40googlegroups.com.

Mubarek Juhar

unread,
Apr 5, 2026, 9:48:25 AMApr 5
to networkx...@googlegroups.com
--
Reply all
Reply to author
Forward
0 new messages