{"id":32175997,"url":"https://github.com/python-graphblas/graphblas-algorithms","last_synced_at":"2026-02-18T22:02:17.164Z","repository":{"id":37526407,"uuid":"476154113","full_name":"python-graphblas/graphblas-algorithms","owner":"python-graphblas","description":"Graph algorithms written in GraphBLAS","archived":false,"fork":false,"pushed_at":"2025-10-06T17:18:07.000Z","size":400,"stargazers_count":80,"open_issues_count":20,"forks_count":5,"subscribers_count":6,"default_branch":"main","last_synced_at":"2025-10-24T07:44:15.076Z","etag":null,"topics":["complex-networks","graph-algorithms","graph-analysis","graph-analytics","graph-datastructures","graph-library","graph-theory","graph-theory-algorithms","graphblas","pydata","python"],"latest_commit_sha":null,"homepage":"","language":"Python","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"apache-2.0","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/python-graphblas.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":"CODE_OF_CONDUCT.md","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}},"created_at":"2022-03-31T04:48:09.000Z","updated_at":"2025-03-14T10:11:26.000Z","dependencies_parsed_at":"2024-01-01T18:22:57.708Z","dependency_job_id":"f559be94-f936-474d-a6a1-dc76f69e8cde","html_url":"https://github.com/python-graphblas/graphblas-algorithms","commit_stats":{"total_commits":48,"total_committers":3,"mean_commits":16.0,"dds":"0.22916666666666663","last_synced_commit":"67b6358379e935a6aba038ed3dc2718486eef770"},"previous_names":[],"tags_count":10,"template":false,"template_full_name":null,"purl":"pkg:github/python-graphblas/graphblas-algorithms","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/python-graphblas%2Fgraphblas-algorithms","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/python-graphblas%2Fgraphblas-algorithms/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/python-graphblas%2Fgraphblas-algorithms/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/python-graphblas%2Fgraphblas-algorithms/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/python-graphblas","download_url":"https://codeload.github.com/python-graphblas/graphblas-algorithms/tar.gz/refs/heads/main","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/python-graphblas%2Fgraphblas-algorithms/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":286080680,"owners_count":29596329,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2026-02-18T20:59:56.587Z","status":"ssl_error","status_checked_at":"2026-02-18T20:58:41.434Z","response_time":162,"last_error":"SSL_connect returned=1 errno=0 peeraddr=140.82.121.6: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":["complex-networks","graph-algorithms","graph-analysis","graph-analytics","graph-datastructures","graph-library","graph-theory","graph-theory-algorithms","graphblas","pydata","python"],"created_at":"2025-10-21T19:52:55.265Z","updated_at":"2026-02-18T22:02:17.158Z","avatar_url":"https://github.com/python-graphblas.png","language":"Python","readme":"![GraphBLAS Algorithms](https://raw.githubusercontent.com/python-graphblas/graphblas-algorithms/main/docs/_static/img/logo-name-medium.svg)\n\u003cbr\u003e\n[![conda-forge](https://img.shields.io/conda/vn/conda-forge/graphblas-algorithms.svg)](https://anaconda.org/conda-forge/graphblas-algorithms)\n[![pypi](https://img.shields.io/pypi/v/graphblas-algorithms.svg)](https://pypi.python.org/pypi/graphblas-algorithms/)\n[![PyPI - Python Version](https://img.shields.io/pypi/pyversions/graphblas-algorithms)](https://pypi.python.org/pypi/graphblas-algorithms/)\n[![License](https://img.shields.io/badge/License-Apache%202.0-blue.svg)](https://github.com/python-graphblas/graphblas-algorithms/blob/main/LICENSE)\n\u003cbr\u003e\n[![Tests](https://github.com/python-graphblas/graphblas-algorithms/workflows/Tests/badge.svg?branch=main)](https://github.com/python-graphblas/graphblas-algorithms/actions)\n[![Coverage](https://codecov.io/gh/python-graphblas/graphblas-algorithms/branch/main/graph/badge.svg)](https://codecov.io/gh/python-graphblas/graphblas-algorithms)\n[![DOI](https://zenodo.org/badge/DOI/10.5281/zenodo.7329185.svg)](https://doi.org/10.5281/zenodo.7329185)\n[![Discord](https://img.shields.io/badge/Chat-Discord-blue)](https://discord.com/invite/vur45CbwMz)\n\u003c!--- [![Docs](https://readthedocs.org/projects/graphblas-algorithms/badge/?version=latest)](https://graphblas-algorithms.readthedocs.io/en/latest/) ---\u003e\n\n`graphblas-algorithms` is a collection of GraphBLAS algorithms written using\n[`python-graphblas`](https://python-graphblas.readthedocs.io/en/latest/).\nIt may be used directly or as an experimental\n[backend to NetworkX](https://networkx.org/documentation/stable/reference/classes/index.html#backends).\n\nWhy use GraphBLAS Algorithms? Because it is *fast*, *flexible*, and *familiar* by using the NetworkX API.\n\nAre we missing any [algorithms](#Plugin-Algorithms) that you want?\n[Please let us know!](https://github.com/python-graphblas/graphblas-algorithms/issues)\n\u003cbr\u003e\n\u003cimg src=\"https://raw.githubusercontent.com/python-graphblas/graphblas-algorithms/main/docs/_static/img/graphblas-vs-networkx.png\" alt=\"GraphBLAS vs NetworkX\" title=\"Even faster than scipy.sparse!\" width=\"640\" /\u003e\n\u003cbr\u003e\n\u003cimg src=\"https://raw.githubusercontent.com/python-graphblas/graphblas-algorithms/main/docs/_static/img/graphblas-vs-igraph.png\" alt=\"GraphBLAS vs igraph\" title=\"igraph may use different algorithms for PageRank\" width=\"600\" /\u003e\n\n### Installation\n```\nconda install -c conda-forge graphblas-algorithms\n```\n```\npip install graphblas-algorithms\n```\n\n## Basic Usage\n\nFirst, create a GraphBLAS Matrix.\n\n```python\nimport graphblas as gb\n\nM = gb.Matrix.from_coo(\n  [0, 0, 1, 2, 2, 3],\n  [1, 3, 0, 0, 1, 2],\n  [1., 2., 3., 4., 5., 6.],\n  nrows=4, ncols=4, dtype='float32'\n)\n```\n\nNext wrap the Matrix as `ga.Graph`.\n\n```python\nimport graphblas_algorithms as ga\n\nG = ga.Graph(M)\n```\n\nFinally call an algorithm.\n\n```python\nhubs, authorities = ga.hits(G)\n```\n\nWhen the result is a value per node, a `gb.Vector` will be returned.\nIn the case of [HITS](https://en.wikipedia.org/wiki/HITS_algorithm),\ntwo Vectors are returned representing the hubs and authorities values.\n\nAlgorithms whose result is a subgraph will return `ga.Graph`.\n\n## Plugin for NetworkX\n\nDispatching to plugins is a new feature in Networkx 3.0.\nWhen both `networkx` and `graphblas-algorithms` are installed in an\nenvironment, calls to NetworkX algorithms can be dispatched to the\nequivalent version in `graphblas-algorithms`.\n\n### Dispatch Example\n```python\nimport networkx as nx\nimport graphblas_algorithms as ga\n\n# Generate a random graph (5000 nodes, 1_000_000 edges)\nG = nx.erdos_renyi_graph(5000, 0.08)\n\n# Explicitly convert to ga.Graph\nG2 = ga.Graph.from_networkx(G)\n\n# Pass G2 to NetworkX's k_truss\nT5 = nx.k_truss(G2, 5)\n```\n\n`G2` is not a `nx.Graph`, but it does have an attribute\n`__networkx_plugin__ = \"graphblas\"`. This tells NetworkX to\ndispatch the k_truss call to graphblas-algorithms. This link\nconnection exists because graphblas-algorithms registers\nitself as a \"networkx.plugin\" entry point.\n\nThe result `T5` is a `ga.Graph` representing the 5-truss structure of the\noriginal graph. To convert to a NetworkX Graph, use:\n```python\nT5.to_networkx()\n```\n\nNote that even with the conversions to and from `ga.Graph`, this example still runs 10x\nfaster than using the native NetworkX k-truss implementation. Speed improvements scale\nwith graph size, so larger graphs will see an even larger speed-up relative to NetworkX.\n\n### Plugin Algorithms\n\nThe following NetworkX algorithms have been implemented\nby graphblas-algorithms and can be used following the\ndispatch pattern shown above.\n\n[//]: # (Begin auto-generated code)\n\n```\ngraphblas_algorithms.nxapi\n├── boundary\n│   ├── edge_boundary\n│   └── node_boundary\n├── centrality\n│   ├── degree_alg\n│   │   ├── degree_centrality\n│   │   ├── in_degree_centrality\n│   │   └── out_degree_centrality\n│   ├── eigenvector\n│   │   └── eigenvector_centrality\n│   └── katz\n│       └── katz_centrality\n├── cluster\n│   ├── average_clustering\n│   ├── clustering\n│   ├── generalized_degree\n│   ├── square_clustering\n│   ├── transitivity\n│   └── triangles\n├── community\n│   └── quality\n│       ├── inter_community_edges\n│       └── intra_community_edges\n├── components\n│   ├── connected\n│   │   ├── is_connected\n│   │   └── node_connected_component\n│   └── weakly_connected\n│       └── is_weakly_connected\n├── core\n│   └── k_truss\n├── cuts\n│   ├── boundary_expansion\n│   ├── conductance\n│   ├── cut_size\n│   ├── edge_expansion\n│   ├── mixing_expansion\n│   ├── node_expansion\n│   ├── normalized_cut_size\n│   └── volume\n├── dag\n│   ├── ancestors\n│   └── descendants\n├── dominating\n│   └── is_dominating_set\n├── efficiency_measures\n│   └── efficiency\n├── generators\n│   └── ego\n│       └── ego_graph\n├── isolate\n│   ├── is_isolate\n│   ├── isolates\n│   └── number_of_isolates\n├── isomorphism\n│   └── isomorph\n│       ├── fast_could_be_isomorphic\n│       └── faster_could_be_isomorphic\n├── linalg\n│   ├── bethehessianmatrix\n│   │   └── bethe_hessian_matrix\n│   ├── graphmatrix\n│   │   └── adjacency_matrix\n│   ├── laplacianmatrix\n│   │   ├── laplacian_matrix\n│   │   └── normalized_laplacian_matrix\n│   └── modularitymatrix\n│       ├── directed_modularity_matrix\n│       └── modularity_matrix\n├── link_analysis\n│   ├── hits_alg\n│   │   └── hits\n│   └── pagerank_alg\n│       ├── google_matrix\n│       └── pagerank\n├── lowest_common_ancestors\n│   └── lowest_common_ancestor\n├── operators\n│   ├── binary\n│   │   ├── compose\n│   │   ├── difference\n│   │   ├── disjoint_union\n│   │   ├── full_join\n│   │   ├── intersection\n│   │   ├── symmetric_difference\n│   │   └── union\n│   └── unary\n│       ├── complement\n│       └── reverse\n├── reciprocity\n│   ├── overall_reciprocity\n│   └── reciprocity\n├── regular\n│   ├── is_k_regular\n│   └── is_regular\n├── shortest_paths\n│   ├── dense\n│   │   ├── floyd_warshall\n│   │   ├── floyd_warshall_numpy\n│   │   └── floyd_warshall_predecessor_and_distance\n│   ├── generic\n│   │   └── has_path\n│   ├── unweighted\n│   │   ├── all_pairs_shortest_path_length\n│   │   ├── single_source_shortest_path_length\n│   │   └── single_target_shortest_path_length\n│   └── weighted\n│       ├── all_pairs_bellman_ford_path_length\n│       ├── bellman_ford_path\n│       ├── bellman_ford_path_length\n│       ├── negative_edge_cycle\n│       └── single_source_bellman_ford_path_length\n├── simple_paths\n│   └── is_simple_path\n├── smetric\n│   └── s_metric\n├── structuralholes\n│   └── mutual_weight\n├── tournament\n│   ├── is_tournament\n│   ├── score_sequence\n│   └── tournament_matrix\n├── traversal\n│   └── breadth_first_search\n│       ├── bfs_layers\n│       └── descendants_at_distance\n└── triads\n    └── is_triad\n```\n\n[//]: # (End auto-generated code)\n","funding_links":[],"categories":[],"sub_categories":[],"project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fpython-graphblas%2Fgraphblas-algorithms","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fpython-graphblas%2Fgraphblas-algorithms","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fpython-graphblas%2Fgraphblas-algorithms/lists"}