Skip to content

Hypergraph backboning + Backbone 3.0 parity (mtc/signed/SDSM-EC) + reference updates - #7

Merged
brianckeegan merged 17 commits into
mainfrom
claude/gracious-fermi-i0Smo
Jun 3, 2026
Merged

Hypergraph backboning + Backbone 3.0 parity (mtc/signed/SDSM-EC) + reference updates#7
brianckeegan merged 17 commits into
mainfrom
claude/gracious-fermi-i0Smo

Conversation

@brianckeegan

@brianckeegan brianckeegan commented Jun 2, 2026

Copy link
Copy Markdown
Owner

Adds a networkx_backbone.hypergraph module + hypergraph_io, brings the statistical methods to feature-parity with Neal's Backbone 3.0 (mtc / signed / SDSM-EC), fixes a stale disparity benchmark, and fills documentation reference gaps.

Hypergraph backbones (hypergraph.py, hypergraph_io.py)

  • MDL backbone (Kirkley et al. 2026): mdl_hypergraph_backbone with a method switch (edge/node/auto), weighted via gamma; hypergraph_compression_ratio; HypergraphBackbone.
  • Structural: maximal_hyperedges, order_filter, s_components, intersection_graph(s=...).
  • Statistical: statistically_validated_hypergraph / _cores (Musciotto et al. 2021; verified vs scipy.stats.binom).
  • Interop: hypergraph_to_bipartite, read_hif/write_hif, and lazy from_*/to_* for xgi / HyperNetX / HypergraphX / HAT.

Backbone 3.0 feature parity (new this round)

  • mtc multiple-testing correction: adjust_pvalues (Bonferroni/Holm/Hochberg/BH/BY; BH & BY verified against scipy.stats.false_discovery_control) + an mtc argument on threshold_filter.
  • signed backbones: two-tailed option on disparity_filter/mlf/lans and sdsm/fdsm/fixedfill/fixedrow/fixedcol, adding a "sign" attribute (+1 strong, −1 weak) and a two-sided p-value; forwarded by the backbone_from_* wrappers.
  • SDSM-EC: sdsm(prohibited=, required=) edge constraints (Neal & Neal 2023).
  • All are additive parameters; signed=False/mtc="none" keep prior behavior.

Fixes & docs

  • Disparity benchmark: implementation was already the canonical Serrano α=(1−p)^(k−1) (independently verified); updated the stale Les Misérables expectation (247 → 9).
  • References: reviewed Neal 2026's bibliography and added the missing canonical citations for implemented methods — Saracco 2015 (BiCM), Neal/Domagalski/Sagan 2021 (FDSM/fixed), Godard & Neal 2022 (fastball), Foti 2011 (LANS), Dianati 2016 (MLF) — plus the multiple-testing-correction references; added them to the README, the bicm/fastball/adjust_pvalues docstrings, and the statistical/bipartite tutorials.
  • New hypergraph tutorial; coverage design doc (backbone-3.0-coverage.md).

Tests

Full suite: 287 passed, 1 skipped (was 215 with 1 failing at the start of this work). New coverage for the MDL method switch, mtc, signed, SDSM-EC, and the adapters (real round-trips through xgi/hypergraphx).

Note on versioning

The version is setuptools-scm-driven (git tags). A 0.3.0 release bump is deferred until this PR is merged — at that point it is a v0.3.0 tag on the default branch (and a matching docs/conf.py release update), per the maintainer's request.

https://claude.ai/code/session_01TEehb7gmfJc8WfUNSjs7eD

claude added 3 commits June 2, 2026 18:44
Evaluate incorporating hypergraph backboning methods (in the spirit of
arXiv:2606.00893) into the library. Documents two method families
(projection backboning vs. direct hyperedge filtering), shows that
projection backboning already works via the existing bipartite incidence
machinery, and proposes a phased plan (Phase 0 adapters+docs, Phase 1 a
hypergraph module) with a representation decision and testing strategy.

https://claude.ai/code/session_01TEehb7gmfJc8WfUNSjs7eD
Expand the hypergraph backboning proposal to (1) optional interoperability
with xgi, hypergraphx, HyperNetX, and Hypergraph-Analysis-Toolbox, centered
on the shared incidence/bipartite substrate and the HIF interchange format
(no required dependencies), and (2) a method inventory distinguishing
generalizations of existing backbones from genuinely hypergraph-native
methods worth porting: statistically validated hypergraphs (SVH) and cores
(SVC), toplex/inclusion reduction, s-connectivity/s-line backbones, and
order-resolved hyperedge filtering.

https://claude.ai/code/session_01TEehb7gmfJc8WfUNSjs7eD
…L method)

After reading arXiv:2606.00893 (Kirkley, Felippe, Malizia & Battiston,
'Hypergraph backboning') in full: the method is a parameter-free,
information-theoretic (MDL) compression backbone that prunes nested/redundant
hyperedges, with a weighted extension (single knob gamma) -- a distinct
paradigm from the statistical SVH/SVC family the first draft assumed.

Re-scope: document the actual objective (parent/child encoding, reduced mutual
information, inverse compression ratio eta), the weighted empirical-Bayes model,
the intersection-graph + greedy star-partition optimizer and its complexity,
and inputs/outputs. Reframe around three paradigms (projection / statistical /
MDL); make the MDL backbone the headline Phase 1 method (networkx + numpy/scipy,
no required third-party hypergraph dep); keep SVH/SVC and structural methods as
Phase 2. Resolve the prior open questions from the paper.

https://claude.ai/code/session_01TEehb7gmfJc8WfUNSjs7eD
@brianckeegan brianckeegan changed the title Design proposal: hypergraph network backboning Design proposal: hypergraph network backboning (MDL method, arXiv:2606.00893) Jun 2, 2026
Implement Phase 1 of the hypergraph backboning proposal: a new
networkx_backbone.hypergraph module providing the parameter-free,
information-theoretic (minimum description length) hypergraph backbone of
Kirkley, Felippe, Malizia & Battiston (arXiv:2606.00893), which prunes nested
and redundant hyperedges and extends to weighted hypergraphs.

- mdl_hypergraph_backbone: greedy 'edge' optimizer over the intersection graph
  (star-partition of parent/child hyperedges); unweighted objective plus the
  empirical-Bayes weighted model (Poisson/Geometric priors, single knob gamma).
- hypergraph_compression_ratio: inverse compression ratio eta.
- intersection_graph: hyperedges linked when they share >= 1 node.
- HypergraphBackbone result dataclass (backbone, assignment, eta, diagnostics).

Implemented with stdlib math (lgamma/log2) + networkx only, so it stays within
the core dependency footprint (no numpy/scipy required). Inputs/outputs use
plain hyperedge collections since NetworkX has no native hypergraph type.

Adds 29 tests reproducing the paper's qualitative claims (recovery of top faces
of nested simplices, eta behavior, gamma=1 == unweighted, gamma->0 forcing
high-weight hyperedges into the backbone) plus edge cases and validation.
Wires the module into the package API and docs (api page, concepts, README).

https://claude.ai/code/session_01TEehb7gmfJc8WfUNSjs7eD
@brianckeegan brianckeegan changed the title Design proposal: hypergraph network backboning (MDL method, arXiv:2606.00893) Hypergraph backboning: MDL method (arXiv:2606.00893) + design doc Jun 2, 2026
claude added 2 commits June 2, 2026 22:34
…formula

The disparity filter formula was corrected in 73ccc6e to the canonical
Serrano et al. (2009) form alpha = (1 - p)^(k-1) (the integral of the null
density), replacing the previous alpha = 1 - (k-1)(1-p)^(k-2), which produced
negative values clamped to 0 and marked almost every edge significant.

The Les Miserables benchmark still encoded the old behavior (247 edges kept at
alpha<0.05). Verified independently that the corrected formula keeps 9 edges on
les_miserables_graph() at alpha<0.05 (the old formula reproduces 247), so the
implementation is correct and the stale expectation is updated to 9.

https://claude.ai/code/session_01TEehb7gmfJc8WfUNSjs7eD
Add the structural sui generis hypergraph methods from the design proposal,
implemented with stdlib + networkx only:

- maximal_hyperedges: inclusion (toplex) reduction -- keep hyperedges not
  contained in any other (cf. HyperNetX toplexes).
- order_filter: order-resolved filtering -- select hyperedges by size/order.
- s_components: s-connected components (hyperedges sharing at least s nodes).
- intersection_graph: generalized with an s parameter, yielding the s-line
  graph for s > 1 (s=1 preserves prior behavior).

These return plain hyperedge collections (no HypergraphBackbone), since they
are structural utilities rather than the MDL optimizer. Adds 10 tests and wires
the functions into the package API and docs. SVH/SVC (statistical, scipy-based)
remain for a follow-up.

https://claude.ai/code/session_01TEehb7gmfJc8WfUNSjs7eD
@brianckeegan brianckeegan changed the title Hypergraph backboning: MDL method (arXiv:2606.00893) + design doc Hypergraph backboning (MDL + structural methods) + disparity-filter benchmark fix Jun 2, 2026
claude added 2 commits June 3, 2026 00:50
Add the statistical hypergraph backbone methods from Musciotto, Battiston &
Mantegna (2021), faithfully re-implemented from Hypergraphx get_svh/get_svc:

- statistically_validated_hypergraph (alias svh): validates observed hyperedges
  that recur more than expected per order, with the binomial-tail p-value
  P(X >= n), X ~ Binomial(N, prod d_i / N), and a Benjamini-Hochberg FDR
  corrected for the number of possible order-k hyperedges.
- statistically_validated_cores (alias svc): validates significant groups
  (including sub-groups), processed high-to-low order with sub-combinations of
  validated cores removed.
- ValidatedHypergraph result dataclass.

scipy is imported lazily (consistent with the statistical/bipartite modules);
the module remains importable without it. Multiplicities are taken from repeated
hyperedges or explicit integer weights. P-values verified exactly against
scipy.stats.binom; planted over-represented groups validate while expected
background does not; SVC drops sub-combinations of validated cores. Adds 14
tests and wires the methods into the package API and docs.

https://claude.ai/code/session_01TEehb7gmfJc8WfUNSjs7eD
Add networkx_backbone/hypergraph_io.py converting the hyperedge-list
representation to and from:

- a NetworkX incidence bipartite graph (hypergraph_to_bipartite), so the
  existing bipartite projection backbones (sdsm/fdsm/fixed*) apply to
  hypergraphs;
- the HIF (Hypergraph Interchange Format) JSON standard (read_hif/write_hif),
  stdlib-only, cross-checked against xgi in both directions;
- the xgi, HyperNetX, HypergraphX, and HAT hypergraph classes via lazy
  from_*/to_* adapters (no required dependency; friendly ImportError if absent).

Adds 12 tests: real round-trips through xgi and hypergraphx, HIF round-trips
(dict/file/weights) and an xgi cross-check, sdsm driven from a converted
hypergraph, and an availability-aware adapter test that round-trips when a
library is installed and asserts a helpful ImportError otherwise. Wires the
functions into the package API, docs, and a README hypergraph quick-start.

https://claude.ai/code/session_01TEehb7gmfJc8WfUNSjs7eD
@brianckeegan brianckeegan changed the title Hypergraph backboning (MDL + structural methods) + disparity-filter benchmark fix Hypergraph backboning: MDL, structural, statistical (SVH/SVC) + interop adapters Jun 3, 2026
claude added 2 commits June 3, 2026 01:10
Implement the second greedy scheme from Kirkley et al. 2026 (Appendix D) and a
method switch on mdl_hypergraph_backbone:

- method="edge": greedy parent-child link addition (previous behavior).
- method="node": facility-location-style greedy that adds backbone parents by
  decreasing total parent-child savings, then force-covers the remainder.
- method="auto" (new default): run both and keep the lower description length,
  matching the paper's procedure. On a downward-closed simplex the node scheme
  compresses better (backbone 8 vs 14), and auto selects it.

Refactor the optimizer into _greedy_edge/_greedy_node/_description_length
helpers. Add tests for all three methods (nested-simplex recovery, auto ==
min(edge, node), node-mode weighting) and fix the now-stale invalid-method test.

Docs: add a hypergraph backbone tutorial (MDL with the method switch, structural
methods, SVH/SVC, interoperability) wired into the tutorials toctree; note the
method options in the README quick-start; mark the optimizer choices resolved in
the design doc.

https://claude.ai/code/session_01TEehb7gmfJc8WfUNSjs7eD
Add docs/design/backbone-3.0-coverage.md evaluating networkx-backbone against
Neal's Backbone 3.0 (PLOS ONE, 2026), based on the authoritative zpneal/backbone
v3.0.4 source. Finding: every backbone *model* in Backbone 3.0 is already
implemented here (disparity, mlf, lans, sdsm, fdsm, fixedfill/row/col, bicm,
fastball, backbone_from_* wrappers), including its hypergraph-projection input
via hypergraph_to_bipartite; the library exceeds it (noise-corrected, ECM, MLA,
structural/proximity families, and the hypergraph module).

The differences are cross-cutting features, with proposed implementations:
multiple-testing correction (mtc), signed backbones, SDSM-EC edge constraints,
and narrative methods text. Adds the Backbone 3.0 and SDSM-EC citations to the
README references and a coverage note.

https://claude.ai/code/session_01TEehb7gmfJc8WfUNSjs7eD
@brianckeegan brianckeegan changed the title Hypergraph backboning: MDL, structural, statistical (SVH/SVC) + interop adapters Hypergraph backboning (MDL + structural + SVH/SVC + interop) and Backbone 3.0 coverage Jun 3, 2026
claude added 5 commits June 3, 2026 02:06
Add adjust_pvalues(pvalues, method) reproducing R's p.adjust for the corrections
in Backbone 3.0's mtc option: bonferroni, holm (step-down), hochberg (step-up),
bh/fdr (Benjamini-Hochberg), by (Benjamini-Yekutieli), and none. BH/BY verified
exactly against scipy.stats.false_discovery_control; pure Python, no new deps.

Wire an `mtc` parameter into threshold_filter that adjusts the score values
across all tested edges/nodes before thresholding (valid only with mode="below").
Default mtc="none" preserves existing behavior. Adds tests and docs; marks the
mtc gap resolved in the coverage evaluation.

https://claude.ai/code/session_01TEehb7gmfJc8WfUNSjs7eD
Add a `signed` option to the statistical scorers, matching Backbone 3.0: a
two-tailed test that retains significantly strong (sign +1) and significantly
weak (sign -1) edges, annotating each with a `sign` attribute and storing a
two-sided p-value (2*min(upper, lower), clipped to 1).

- Weighted filters: disparity_filter, marginal_likelihood_filter, lans_filter
  (and the disparity/mlf/lans aliases). Lower tails: disparity CDF, binomial cdf,
  empirical CDF (OR rule across endpoints).
- Projection null models: sdsm, fdsm, fixedfill, fixedrow, fixedcol. Lower tails:
  normal cdf, Monte-Carlo below-count, binomial/hypergeometric cdf.
- Wrappers: backbone_from_weighted gains signed (+ mtc) pass-through;
  backbone_from_projection forwards signed to the fixed* models too.

signed=False (default) leaves behavior and stored p-values unchanged. Adds tests
verifying strong/weak sign assignment, two-sided p-values, determinism, and that
unsigned output is unchanged.

https://claude.ai/code/session_01TEehb7gmfJc8WfUNSjs7eD
Add optional prohibited/required parameters to sdsm implementing the Stochastic
Degree Sequence Model with Edge Constraints (Neal & Neal 2023): cells named as
(agent, artifact) pairs are fixed to null probability 0 (prohibited) or 1
(required) before the Poisson-binomial test. Defaults (None) leave behavior
unchanged; unknown nodes are ignored; constraints compose with signed and are
forwarded by backbone_from_projection via kwargs. Adds tests and the SDSM-EC
reference.

https://claude.ai/code/session_01TEehb7gmfJc8WfUNSjs7eD
…ncepts

- README: update the Backbone 3.0 coverage note (features now implemented) and
  add a "Significance options" quick-start example (mtc + signed).
- statistical tutorial: add "Multiple-testing correction" and "Signed backbones"
  sections.
- bipartite tutorial: add "Signed backbones" and "Edge constraints (SDSM-EC)"
  sections + SDSM-EC reference.
- concepts: note adjust_pvalues/mtc and signed on the statistical methods.
- coverage design doc: mark mtc/signed/SDSM-EC implemented; narrative parked.
- bump function count (87) for adjust_pvalues.

https://claude.ai/code/session_01TEehb7gmfJc8WfUNSjs7eD
Reviewed the Backbone 3.0 bibliography (zpneal/backbone vignette bib) and added
the canonical references for implemented methods that were missing from the
docs:

- Saracco et al. (2015) -- Bipartite Configuration Model (added to bicm docstring
  and README)
- Neal, Domagalski & Sagan (2021) -- FDSM / fixed models (README, bipartite tutorial)
- Godard & Neal (2022) -- fastball (added to fastball docstring, README, tutorial)
- Foti et al. (2011) -- LANS (README, statistical tutorial)
- Dianati (2016) -- MLF (README, statistical tutorial)

Also: complete the Neal 2026 citation (PLOS One, 21, e0349258); fix a merged
Satuluri/Serrano reference line; cite the multiple-testing corrections
(Holm 1979, Hochberg 1988, Benjamini-Hochberg 1995, Benjamini-Yekutieli 2001)
in adjust_pvalues and the statistical tutorial; add a References section to the
statistical tutorial and expand the bipartite tutorial references.

https://claude.ai/code/session_01TEehb7gmfJc8WfUNSjs7eD
@brianckeegan brianckeegan changed the title Hypergraph backboning (MDL + structural + SVH/SVC + interop) and Backbone 3.0 coverage Hypergraph backboning + Backbone 3.0 parity (mtc/signed/SDSM-EC) + reference updates Jun 3, 2026
claude added 2 commits June 3, 2026 02:37
The docs CI builds with -W (warnings as errors) and failed with 18 warnings
introduced by the new hypergraph API page:

- 17x "duplicate object description" for HypergraphBackbone/ValidatedHypergraph
  attributes: conf.py sets autodoc_default_options members=True globally, so the
  autoclass directives documented the dataclass fields in addition to numpydoc
  rendering each class's "Attributes" docstring section. Add :no-members: to both
  autoclass directives so only the numpydoc Attributes section is rendered.
- 1x "py:mod reference target not found: networkx_backbone.hypergraph_io" in
  concepts.rst: the module had no automodule directive to resolve the :mod: xref.
  Register it with `.. automodule:: networkx_backbone.hypergraph_io :no-members:`
  on the hypergraph API page.

Verified locally: build now emits 0 structural warnings (only environment-local
intersphinx inventory fetch failures remain, which do not occur in CI).

https://claude.ai/code/session_01TEehb7gmfJc8WfUNSjs7eD
GitHub runners deprecate Node.js 20 (forced to Node 24 on 2026-06-16). Update
the JavaScript actions across all workflows:

- Bump actions/checkout v4 -> v5 and actions/setup-python v5 -> v6 (Node 24),
  the two actions named in the runner deprecation warning.
- Set the GitHub-sanctioned FORCE_JAVASCRIPT_ACTIONS_TO_NODE24=true workflow-level
  env in every workflow so the remaining JS actions still on Node 20
  (upload-artifact, download-artifact, upload-pages-artifact, deploy-pages, and
  conda-incubator/setup-miniconda) run on Node 24 without risky version guesses.

YAML validity and top-level env placement verified for all four workflows.

https://claude.ai/code/session_01TEehb7gmfJc8WfUNSjs7eD
@brianckeegan
brianckeegan merged commit f6bf26b into main Jun 3, 2026
1 check passed
@brianckeegan
brianckeegan deleted the claude/gracious-fermi-i0Smo branch June 3, 2026 02:44
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.

2 participants