{"id":46890716,"url":"https://github.com/brianckeegan/networkx_backbone","last_synced_at":"2026-03-10T22:39:09.748Z","repository":{"id":337901038,"uuid":"1155731392","full_name":"brianckeegan/networkx_backbone","owner":"brianckeegan","description":"Implementation of backbone functions and filtering for complex networks","archived":false,"fork":false,"pushed_at":"2026-02-12T02:35:08.000Z","size":92,"stargazers_count":1,"open_issues_count":0,"forks_count":0,"subscribers_count":0,"default_branch":"main","last_synced_at":"2026-02-12T05:48:12.018Z","etag":null,"topics":["backbone-networks","complex-networks","networkx","python"],"latest_commit_sha":null,"homepage":"","language":"Python","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"bsd-3-clause","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/brianckeegan.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":"docs/contributing.rst","funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null,"zenodo":null,"notice":null,"maintainers":null,"copyright":null,"agents":null,"dco":null,"cla":null}},"created_at":"2026-02-11T20:56:01.000Z","updated_at":"2026-02-12T05:16:17.000Z","dependencies_parsed_at":null,"dependency_job_id":null,"html_url":"https://github.com/brianckeegan/networkx_backbone","commit_stats":null,"previous_names":["brianckeegan/networkx_backbone"],"tags_count":1,"template":false,"template_full_name":null,"purl":"pkg:github/brianckeegan/networkx_backbone","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/brianckeegan%2Fnetworkx_backbone","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/brianckeegan%2Fnetworkx_backbone/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/brianckeegan%2Fnetworkx_backbone/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/brianckeegan%2Fnetworkx_backbone/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/brianckeegan","download_url":"https://codeload.github.com/brianckeegan/networkx_backbone/tar.gz/refs/heads/main","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/brianckeegan%2Fnetworkx_backbone/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":286080680,"owners_count":30359472,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2026-03-10T21:41:54.280Z","status":"ssl_error","status_checked_at":"2026-03-10T21:40:59.357Z","response_time":106,"last_error":"SSL_connect returned=1 errno=0 peeraddr=140.82.121.5:443 state=error: unexpected eof while reading","robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":false,"can_crawl_api":true,"host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["backbone-networks","complex-networks","networkx","python"],"created_at":"2026-03-10T22:39:08.704Z","updated_at":"2026-03-10T22:39:09.682Z","avatar_url":"https://github.com/brianckeegan.png","language":"Python","funding_links":[],"categories":[],"sub_categories":[],"readme":"# networkx_backbone\n\nBackbone extraction algorithms for complex networks, built on [NetworkX](https://networkx.org/).\n\nThis library provides 65 functions across 9 modules for extracting backbone\nstructures from weighted and unweighted networks.\n\nFull documentation: https://www.brianckeegan.com/networkx_backbone/\n\n## Installation\n\n```bash\npip install networkx-backbone\n```\n\nFor full functionality (required for statistical tests, bipartite methods, and some structural methods):\n\n```bash\npip install networkx-backbone[full]\n```\n\nOr install from source:\n\n```bash\ngit clone https://github.com/brianckeegan/networkx_backbone.git\ncd networkx_backbone\npip install -e \".[full]\"\n```\n\n## Modules\n\n| Module | Description | Key Functions |\n|--------|-------------|---------------|\n| **statistical** | Hypothesis-testing methods | `disparity_filter`, `noise_corrected_filter`, `marginal_likelihood_filter`, `ecm_filter`, `lans_filter`, `multiple_linkage_analysis` |\n| **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` |\n| **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 |\n| **hybrid** | Combined approaches | `glab_filter` |\n| **bipartite** | Bipartite projection backbones | `simple_projection`, `hyper_projection`, `probs_projection`, `ycn_projection`, `sdsm`, `fdsm`, `fixedfill`, `fixedrow`, `fixedcol`, `backbone` |\n| **unweighted** | Sparsification for unweighted graphs | `sparsify`, `lspar`, `local_degree` |\n| **filters** | Post-hoc filtering utilities | `multigraph_to_weighted`, `threshold_filter`, `fraction_filter`, `boolean_filter`, `consensus_backbone` |\n| **measures** | Evaluation and comparison | `node_fraction`, `edge_fraction`, `weight_fraction`, `reachability`, `ks_degree`, `ks_weight`, `compare_backbones` |\n| **visualization** | Graph comparison plotting | `graph_difference`, `compare_graphs`, `save_graph_comparison` |\n\n## NetBone Core Coverage\n\nCore method families used in [netbone](https://gitlab.liris.cnrs.fr/coregraphie/netbone)\n(Yassin et al., 2023) are represented here, including:\n\n- Statistical: `disparity_filter`, `marginal_likelihood_filter`, `ecm_filter`, `noise_corrected_filter`, `lans_filter`, `multiple_linkage_analysis`\n- Structural: `global_threshold_filter`, `global_sparsification`, `primary_linkage_analysis`, `edge_betweenness_filter`, `high_salience_skeleton`, `doubly_stochastic_filter`, `maximum_spanning_tree_backbone`\n- Hybrid: `glab_filter`\n\n## Quick Start\n\n```python\nimport networkx as nx\nimport networkx_backbone as nb\n\n# Create a weighted graph\nG = nx.les_miserables_graph()\n\n# 1) Score edges\nscored = nb.disparity_filter(G)\n\n# 2) Filter edges\nbackbone = nb.threshold_filter(scored, \"disparity_pvalue\", 0.05)\n\n# Compare backbone to original\nprint(f\"Edges kept: {nb.edge_fraction(G, backbone):.1%}\")\nprint(f\"Nodes kept: {nb.node_fraction(G, backbone):.1%}\")\n```\n\n### Disparity filter visualization\n\n![Disparity filter on Les Miserables](docs/_static/graph_gallery/les_miserables/disparity_filter.png)\n\n### Proximity-based scoring\n\n```python\n# Score edges by Jaccard similarity of endpoint neighborhoods\nscored = nb.jaccard_backbone(G)\n\n# Keep only the top 20% most structurally embedded edges\nbackbone = nb.fraction_filter(scored, \"jaccard\", 0.2, ascending=False)\n```\n\n### Bipartite backbone\n\n```python\nB = nx.davis_southern_women_graph()\nwomen_nodes = [n for n, d in B.nodes(data=True) if d[\"bipartite\"] == 0]\nscored = nb.sdsm(B, agent_nodes=women_nodes, projection=\"hyper\")\nbackbone = nb.threshold_filter(scored, \"sdsm_pvalue\", 0.05, mode=\"below\")\n```\n\nProjection weights follow the simple/hyper/ProbS/YCN formulations described in\n[Coscia \u0026 Neffke (2017)](https://arxiv.org/abs/1906.09081).\n\n### Comparing multiple methods\n\n```python\nbackbones = {\n    \"disparity\": nb.threshold_filter(nb.disparity_filter(G), \"disparity_pvalue\", 0.05),\n    \"mst\": nb.boolean_filter(nb.maximum_spanning_tree_backbone(G), \"mst_keep\"),\n}\nresults = nb.compare_backbones(G, backbones)\n```\n\n## Dependencies\n\n- **Required**: `networkx \u003e= 3.0`\n- **Optional**: `numpy \u003e= 1.23`, `scipy \u003e= 1.9`, `matplotlib \u003e= 3.7` (needed for statistical methods, bipartite methods, some structural/proximity methods, visualization helpers, and docs gallery generation)\n\n## Testing\n\n```bash\npip install -e \".[test]\"\npytest\n```\n\n## Visualization gallery\n\nBackbone visualizations in the docs are generated with **Sphinx Gallery** from\nexample scripts under `docs/examples/`.\n\nBuild docs (including the graph comparison gallery and function-linked\nvisualizations):\n\n```bash\npip install -e \".[docs]\"\nsphinx-build -b html docs docs/_build/html\n```\n\n## References\n\nKey papers behind the implemented methods:\n\n- Coscia, M. \u0026 Neffke, F. M. (2017). [Network backboning with noisy data](https://doi.ieeecomputersociety.org/10.1109/ICDE.2017.100). *Proc. IEEE ICDE*, 425-436.\n- Coscia, M. \u0026 Neffke, F. M. (2017). [Network backboning with noisy data (arXiv:1906.09081)](https://arxiv.org/abs/1906.09081).\n- Girvan, M., \u0026 Newman, M. E. J. (2002). [Community structure in social and biological networks](https://doi.org/10.1073/pnas.122653799). *PNAS*, 99(12), 7821-7826.\n- Grady, D., Thiemann, C., \u0026 Brockmann, D. (2012). [Robust classification of salient links in complex networks](https://doi.org/10.1038/ncomms1847). *Nature Communications*, 3, 864.\n- Hamann, M., Lindner, G., Meyerhenke, H., Staudt, C. L., and Wagner, D. (2016). [Structure-Preserving Sparsification Methods for Social Networks](https://doi.org/10.1007/s13278-016-0332-2). Social Network Analysis and Mining, 6, 22.\n- Simas, T., Correia, R. B., \u0026 Rocha, L. M. (2021). [The distance backbone of complex networks](https://doi.org/10.1093/comnet/cnab021). *J. Complex Networks*, 9(6), cnab021.\n- Neal, Z. P. (2014). [The backbone of bipartite projections](https://doi.org/10.1016/j.socnet.2014.06.001). *Social Networks*, 39, 84-97.\n- Neal, Z. P. (2022). [backbone: An R package to extract network backbones](https://doi.org/10.1371/journal.pone.0269137). *PLoS One*, 17(5), e0269137.\n- Satuluri, V., Parthasarathy, S., \u0026 Ruan, Y. (2011). [Local graph sparsification for scalable clustering](https://doi.org/10.1145/1989323.1989399). *SIGMOD*, 721-732.Serrano, M. A., Boguna, M., \u0026 Vespignani, A. (2009). [Extracting the multiscale backbone of complex weighted networks](https://doi.org/10.1073/pnas.0808904106). *PNAS*, 106(16), 6483-6488.\n- Van Nuffel, N., Heyndrickx, C., \u0026 Wets, G. (2010). Measuring hierarchy and reciprocity in networks.\n- Yassin, A., Haidar, A., Cherifi, H., Seba, H., \u0026 Togni, O. (2023). [An evaluation tool for backbone extraction techniques in weighted complex networks](https://doi.org/10.1038/s41598-023-42076-3). *Scientific Reports*, 13, 17000. \n- Yassin A., Cherifi, H., Seba, H., \u0026 Togni, O. (2025). [Backbone extraction through statistical edge filtering: A comparative study](https://doi.org/10.1371/journal.pone.0316141). *PLoS One*, 20(1): e0316141.\n- Yassin A., Cherifi, H., Seba, H., \u0026 Togni, O. (2025). [Exploring weighted network backbone extraction: A comparative analysis of structural techniques](https://doi.org/10.1371/journal.pone.0322298). *PLoS One*, 20(5): e0322298.\n\nOther libraries and datasets:\n\n- Yassin, A., Haidar, A., Cherifi, H., Seba, H., \u0026 Togni, O. (2023). [netbone](https://gitlab.liris.cnrs.fr/coregraphie/netbone).\n- Yassin, A., et al. (2025). [structural-backbone-methods-comparison](https://github.com/al1yass2n/structural-backbone-methods-comparison).\n- Neal, Z. (2022). [backbone](https://rbackbone.net/).\n- Chrol, B. \u0026 Bojanowski, M. (2018). [Proximity-based Methods for Link Prediction](https://cran.r-project.org/web/packages/linkprediction/vignettes/proxfun.html).\n\n## License\n\nBSD 3-Clause License. See [LICENSE](LICENSE) for details.\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fbrianckeegan%2Fnetworkx_backbone","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fbrianckeegan%2Fnetworkx_backbone","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fbrianckeegan%2Fnetworkx_backbone/lists"}