{"id":25649619,"url":"https://github.com/habedi/graphina","last_synced_at":"2025-07-14T16:05:31.459Z","repository":{"id":278415912,"uuid":"935281705","full_name":"habedi/graphina","owner":"habedi","description":"A graph data science library for Rust :crab:","archived":false,"fork":false,"pushed_at":"2025-05-06T16:10:18.000Z","size":59,"stargazers_count":54,"open_issues_count":5,"forks_count":5,"subscribers_count":2,"default_branch":"main","last_synced_at":"2025-06-30T23:15:59.736Z","etag":null,"topics":["crates-io","data-mining-algorithms","data-science","graph-algorithms","graph-analytics","graph-theory","network-analysis","rust-lang","social-network-analysis"],"latest_commit_sha":null,"homepage":"","language":"Rust","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/habedi.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":"CONTRIBUTING.md","funding":null,"license":"LICENSE-APACHE","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":"2025-02-19T07:39:00.000Z","updated_at":"2025-06-02T23:41:04.000Z","dependencies_parsed_at":"2025-03-07T16:27:20.668Z","dependency_job_id":"8784bc0c-72fc-4bb7-b04e-1e07038fb210","html_url":"https://github.com/habedi/graphina","commit_stats":null,"previous_names":["habedi/graphina"],"tags_count":4,"template":false,"template_full_name":"habedi/template-rust-project","purl":"pkg:github/habedi/graphina","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/habedi%2Fgraphina","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/habedi%2Fgraphina/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/habedi%2Fgraphina/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/habedi%2Fgraphina/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/habedi","download_url":"https://codeload.github.com/habedi/graphina/tar.gz/refs/heads/main","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/habedi%2Fgraphina/sbom","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":265314237,"owners_count":23745226,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","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":["crates-io","data-mining-algorithms","data-science","graph-algorithms","graph-analytics","graph-theory","network-analysis","rust-lang","social-network-analysis"],"created_at":"2025-02-23T14:22:42.988Z","updated_at":"2025-07-14T16:05:31.444Z","avatar_url":"https://github.com/habedi.png","language":"Rust","funding_links":[],"categories":[],"sub_categories":[],"readme":"\u003cdiv align=\"center\"\u003e\n  \u003cpicture\u003e\n    \u003cimg alt=\"Graphina the Dinosaur\" src=\"logo.png\" height=\"50%\" width=\"50%\"\u003e\n  \u003c/picture\u003e\n\u003c/div\u003e\n\u003cbr\u003e\n\n## Graphina\n\n[![Tests](https://img.shields.io/github/actions/workflow/status/habedi/graphina/tests.yml?label=tests\u0026style=flat\u0026labelColor=282c34\u0026color=4caf50\u0026logo=github)](https://github.com/habedi/graphina/actions/workflows/tests.yml)\n[![Lints](https://img.shields.io/github/actions/workflow/status/habedi/graphina/lint.yml?label=lints\u0026style=flat\u0026labelColor=282c34\u0026color=4caf50\u0026logo=github)](https://github.com/habedi/graphina/actions/workflows/lint.yml)\n[![Code Coverage](https://img.shields.io/codecov/c/github/habedi/graphina?style=flat\u0026labelColor=282c34\u0026color=ffca28\u0026logo=codecov)](https://codecov.io/gh/habedi/graphina)\n[![CodeFactor](https://img.shields.io/codefactor/grade/github/habedi/graphina?style=flat\u0026labelColor=282c34\u0026color=4caf50\u0026logo=codefactor)](https://www.codefactor.io/repository/github/habedi/graphina)\n[![Crates.io](https://img.shields.io/crates/v/graphina.svg?style=flat\u0026labelColor=282c34\u0026color=f46623\u0026logo=rust)](https://crates.io/crates/graphina)\n[![Docs.rs](https://img.shields.io/badge/docs.rs-graphina-66c2a5?style=flat\u0026labelColor=282c34\u0026logo=docs.rs)](https://docs.rs/graphina)\n[![Downloads](https://img.shields.io/crates/d/graphina?style=flat\u0026labelColor=282c34\u0026color=4caf50\u0026logo=rust)](https://crates.io/crates/graphina)\n[![MSRV](https://img.shields.io/badge/MSRV-1.83.0-007ec6?label=msrv\u0026style=flat\u0026labelColor=282c34\u0026logo=rust)](https://github.com/rust-lang/rust/releases/tag/1.83.0)\n[![Docs](https://img.shields.io/badge/docs-latest-3776ab?style=flat\u0026labelColor=282c34\u0026logo=readthedocs)](docs)\n[![License](https://img.shields.io/badge/license-MIT%2FApache--2.0-007ec6?style=flat\u0026labelColor=282c34\u0026logo=open-source-initiative)](https://github.com/habedi/graphina)\n\nGraphina is a graph data science library for Rust.\nIt provides the common data structures and algorithms used for analyzing the graphs of real-world networks such as\nsocial, transportation, and biological networks.\n\nCompared to other Rust graph libraries like [petgraph](https://github.com/petgraph/petgraph)\nand [rustworkx](https://www.rustworkx.org/), Graphina aims to provide a more high-level API and a wide range of\nready-to-use algorithms for network analysis and graph mining tasks.\nThe main goal is to make Graphina as feature-rich as [NetworkX](https://networkx.org/),\nbut with the performance of Rust.\n\nAdditionally, [PyGraphina](https://pypi.org/project/pygraphina/) Python library allows users to use Graphina in Python.\nCheck out [pygraphina](pygraphina/) directory for more details.\n\n\u003e [!IMPORTANT]\n\u003e Graphina is in the early stages of development, so breaking changes may occur.\n\u003e Bugs and API inconsistencies are also expected, and the algorithms may not yet be optimized for performance.\n\n### Structure\n\nGraphina consists of two main parts: a *core library* and *extensions*.\nThe core library provides the basic data structures and algorithms for working with graphs.\nThe extensions are modules outside the core library that contain more advanced algorithms for specific tasks like\ncommunity detection, link prediction, and calculating node and edge centrality scores.\n\nThe extensions are independent of each other. However, they depend on the core library for the basic graph operations.\n\n#### Graphina Core\n\n| Module                                   | Feature or Algorithm                                                                                                                                                                          | Status | Notes                                             |\n|------------------------------------------|-----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------|--------|---------------------------------------------------|\n| [**Types**](src/core/types.rs)           | \u003cul\u003e\u003cli\u003eDirected and undirected graphs\u003c/li\u003e\u003cli\u003eWeighted and unweighted graphs\u003c/li\u003e\u003c/ul\u003e                                                                                                       | Tested | Graph types that Graphina supports                |                                 \n| [**Exceptions**](src/core/exceptions.rs) | \u003cul\u003e\u003cli\u003eList of exceptions\u003c/li\u003e\u003c/ul\u003e                                                                                                                                                          | Tested | Custom error types for Graphina                   |\n| [**IO**](src/core/io.rs)                 | \u003cul\u003e\u003cli\u003eEdge list\u003c/li\u003e\u003cli\u003eAdjacency list\u003c/li\u003e\u003c/ul\u003e                                                                                                                                            | Tested | I/O routines for reading and writing graph data   |\n| [**Generators**](src/core/generators.rs) | \u003cul\u003e\u003cli\u003eErdős–Rényi graph\u003c/li\u003e\u003cli\u003eWatts–Strogatz graph\u003c/li\u003e\u003cli\u003eBarabási–Albert graph\u003c/li\u003e\u003cli\u003eComplete graph\u003c/li\u003e\u003cli\u003eBipartite graph\u003c/li\u003e\u003cli\u003eStar graph\u003c/li\u003e\u003cli\u003eCycle graph\u003c/li\u003e\u003c/ul\u003e          | Tested | Graph generators for random and structured graphs |\n| [**Paths**](src/core/paths.rs)           | \u003cul\u003e\u003cli\u003eDijkstra’s algorithm\u003c/li\u003e\u003cli\u003eBellman–Ford algorithm\u003c/li\u003e\u003cli\u003eFloyd–Warshall algorithm\u003c/li\u003e\u003cli\u003eJohnson’s algorithm\u003c/li\u003e\u003cli\u003eA* search algorithm\u003c/li\u003e\u003cli\u003eIterative deepening A*\u003c/li\u003e\u003c/ul\u003e | Tested | Shortest paths algorithms                         |\n| [**MST**](src/core/mst.rs)               | \u003cul\u003e\u003cli\u003ePrim’s algorithm\u003c/li\u003e\u003cli\u003eKruskal’s algorithm\u003c/li\u003e\u003cli\u003eBorůvka’s algorithm\u003c/li\u003e\u003c/ul\u003e                                                                                                    | Tested | Minimum spanning tree algorithms                  |\n| [**Traversal**](src/core/traversal.rs)   | \u003cul\u003e\u003cli\u003eBreadth-first search (BFS)\u003c/li\u003e\u003cli\u003eDepth-first search (DFS)\u003c/li\u003e\u003cli\u003eIterative deepening DFS\u003c/li\u003e\u003cli\u003eBidirectional search\u003c/li\u003e\u003c/ul\u003e                                                    | Tested | Graph traversal algorithms                        |\n\n#### Extensions\n\n| Module                                               | Feature/Algorithm                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                    | Status | Notes                                                     |\n|------------------------------------------------------|--------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------|--------|-----------------------------------------------------------|\n| [**Centrality**](src/centrality/algorithms.rs)       | \u003cul\u003e\u003cli\u003eDegree centrality\u003c/li\u003e\u003cli\u003eCloseness centrality\u003c/li\u003e\u003cli\u003eBetweenness centrality\u003c/li\u003e\u003cli\u003eEigenvector centrality\u003c/li\u003e\u003cli\u003ePageRank centrality\u003c/li\u003e\u003cli\u003eKatz centrality\u003c/li\u003e\u003cli\u003eHarmonic centrality\u003c/li\u003e\u003cli\u003eLocal/global reaching centrality\u003c/li\u003e\u003cli\u003eVoterank centrality\u003c/li\u003e\u003cli\u003eLaplacian centrality\u003c/li\u003e\u003c/ul\u003e                                                                                                                                                                                                                                                                                                                     |        | Centrality measures                                       |\n| [**Links**](src/links/algorithms.rs)                 | \u003cul\u003e\u003cli\u003eResource allocation index\u003c/li\u003e\u003cli\u003eJaccard coefficient\u003c/li\u003e\u003cli\u003eAdamic–Adar index\u003c/li\u003e\u003cli\u003ePreferential attachment\u003c/li\u003e\u003cli\u003eCN Soundarajan–Hopcroft\u003c/li\u003e\u003cli\u003eRA index Soundarajan–Hopcroft\u003c/li\u003e\u003cli\u003eWithin–inter-cluster ratio\u003c/li\u003e\u003cli\u003eCommon neighbor centrality\u003c/li\u003e\u003c/ul\u003e                                                                                                                                                                                                                                                                                                                                                        |        | Link prediction algorithms                                |\n| [**Community**](src/community/algorithms.rs)         | \u003cul\u003e\u003cli\u003eLabel propagation\u003c/li\u003e\u003cli\u003eLouvain method\u003c/li\u003e\u003cli\u003eGirvan–Newman algorithm\u003c/li\u003e\u003cli\u003eSpectral clustering\u003c/li\u003e\u003cli\u003ePersonalized PageRank\u003c/li\u003e\u003cli\u003eInfomap\u003c/li\u003e\u003cli\u003eConnected components\u003c/li\u003e\u003c/ul\u003e                                                                                                                                                                                                                                                                                                                                                                                                                                    |        | Community detection and clustering algorithms             |\n| [**Approximation**](src/approximation/algorithms.rs) | \u003cul\u003e\u003cli\u003eLocal node connectivity (BFS-based)\u003c/li\u003e\u003cli\u003eMaximum independent set (greedy with neighbor caching)\u003c/li\u003e\u003cli\u003eMaximum clique (greedy heuristic)\u003c/li\u003e\u003cli\u003eClique removal\u003c/li\u003e\u003cli\u003eLarge clique size\u003c/li\u003e\u003cli\u003eAverage clustering coefficient\u003c/li\u003e\u003cli\u003eDensest subgraph (greedy peeling)\u003c/li\u003e\u003cli\u003eDiameter lower bound\u003c/li\u003e\u003cli\u003eMinimum weighted vertex cover (greedy re‑evaluated)\u003c/li\u003e\u003cli\u003eMinimum maximal matching (greedy)\u003c/li\u003e\u003cli\u003eApproximate Ramsey R2\u003c/li\u003e\u003cli\u003eTSP approximations (greedy, simulated annealing, threshold accepting, Christofides placeholder)\u003c/li\u003e\u003cli\u003eTreewidth decompositions (min degree, min fill-in)\u003c/li\u003e\u003c/ul\u003e |        | Approximations and heuristic methods for NP‑hard problems |\n\n\u003e [!NOTE]\n\u003e Status shows whether the module is `Tested` and `Benchmarked`.\n\u003e Empty status means the module is implemented but not tested and benchmarked yet.\n\n### Installation\n\n```shell\ncargo add graphina\n```\n\nOr add this to your `Cargo.toml`:\n\n```toml\n[dependencies]\ngraphina = \"0.2\"\n```\n\n*Graphina requires Rust 1.83 or later.*\n\n### Documentation\n\nSee the [docs](docs/README.md) for the latest documentation.\n\nCheck out the [docs.rs/graphina](https://docs.rs/graphina) for the latest API documentation.\n\n#### Simple Example\n\n```rust\nuse graphina::core::types::Graph;\n\nfn main() {\n    // Create a new undirected graph\n    let mut graph = Graph::new();\n\n    // Add nodes and edges to the graph\n    let n0 = graph.add_node(1);\n    let n1 = graph.add_node(1);\n    let n2 = graph.add_node(2);\n    let n3 = graph.add_node(3);\n    graph.add_edge(n0, n1, 1.0);\n    graph.add_edge(n1, n2, 1.0);\n    graph.add_edge(n2, n3, 1.0);\n\n    // Get the neighbors of node 1\n    for neighbor in graph.neighbors(n1) {\n        println!(\"Node 1 has neighbor: {}\", neighbor.index());\n    }\n}\n```\n\nSee the [examples](examples) and [tests](tests) directories for more usage examples.\n\n### Contributing\n\nSee [CONTRIBUTING.md](CONTRIBUTING.md) for details on how to make a contribution.\n\n### Logo\n\nThe mascot is named \"Graphina the Dinosaur\".\nAs the name implies, she's a dinosaur, however, she herself thinks she's a dragon.\n\nThe logo was created using Gimp, ComfyUI, and a Flux Schnell v2 model.\n\n### Licensing\n\nGraphina is licensed under either of these:\n\n* MIT License ([LICENSE-MIT](LICENSE-MIT))\n* Apache License, Version 2.0 ([LICENSE-APACHE](LICENSE-APACHE))\n\nPyGraphina is licensed under the MIT License ([LICENSE](pygraphina/LICENSE)).\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fhabedi%2Fgraphina","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fhabedi%2Fgraphina","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fhabedi%2Fgraphina/lists"}