https://github.com/habedi/graphina
A high-level graph mining and network analysis library for Rust :crab:
https://github.com/habedi/graphina
crates-io data-mining-algorithms data-science graph-algorithms graph-theory network-analysis rust-lang social-network-analysis
Last synced: 2 months ago
JSON representation
A high-level graph mining and network analysis library for Rust :crab:
- Host: GitHub
- URL: https://github.com/habedi/graphina
- Owner: habedi
- License: apache-2.0
- Created: 2025-02-19T07:39:00.000Z (2 months ago)
- Default Branch: main
- Last Pushed: 2025-02-19T17:25:35.000Z (2 months ago)
- Last Synced: 2025-02-19T17:27:34.959Z (2 months ago)
- Topics: crates-io, data-mining-algorithms, data-science, graph-algorithms, graph-theory, network-analysis, rust-lang, social-network-analysis
- Language: Rust
- Homepage:
- Size: 20.5 KB
- Stars: 0
- Watchers: 1
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- Contributing: CONTRIBUTING.md
- License: LICENSE-APACHE
- Code of conduct: CODE_OF_CONDUCT.md
Awesome Lists containing this project
README
# Graphina
[](https://github.com/habedi/graphina/actions/workflows/tests.yml)
[](https://github.com/habedi/graphina/actions/workflows/lint.yml)
[](https://codecov.io/gh/habedi/graphina)
[](https://www.codefactor.io/repository/github/habedi/graphina)
[](https://crates.io/crates/graphina)
[](https://docs.rs/graphina)
[](https://crates.io/crates/graphina)
[](https://github.com/rust-lang/rust/releases/tag/1.83.0)
[](docs)
[](https://github.com/habedi/graphina)Graphina is a graph data science library for Rust.
It provides the common data structures and algorithms used for analyzing the graphs of real-world networks such as
social, transportation, and biological networks.Compared to other Rust graph libraries like [petgraph](https://github.com/petgraph/petgraph)
and [rustworkx](https://www.rustworkx.org/), Graphina aims to provide a more high-level API and a wide range of
ready-to-use algorithms for network analysis and graph mining tasks.> [!IMPORTANT]
> Graphina is in the early stages of development, so breaking changes may occur.## Structure
Graphina consists of two main parts: a core library and extensions.
The core library provides the basic data structures and algorithms for working with graphs.
The extensions are modules outside the core library that contain more advanced algorithms for specific tasks like
community detection, link prediction, and calculating node and edge centrality scores.The extensions are independent of each other. However, they depend on the core library for the basic graph operations.
### Graphina Core
| Module | Features/Algorithms | Status | Notes |
|------------------------------------------|-----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------|--------|---------------------------------------------------|
| [**Types**](src/core/types.rs) |
- Directed and undirected graphs
- Weighted and unweighted graphs
| [**Exceptions**](src/core/exceptions.rs) |
- List of exceptions
| [**IO**](src/core/io.rs) |
- Edge list
- Adjacency list
| [**Generators**](src/core/generators.rs) |
- Erdős–Rényi graph
- Watts–Strogatz graph
- Barabási–Albert graph
- Complete graph
- Bipartite graph
- Star graph
- Cycle graph
| [**Paths**](src/core/paths.rs) |
- Dijkstra’s algorithm
- Bellman–Ford algorithm
- Floyd–Warshall algorithm
- Johnson’s algorithm
- A* search algorithm
- Iterative deepening A*
| [**MST**](src/core/mst.rs) |
- Prim’s algorithm
- Kruskal’s algorithm
- Borůvka’s algorithm
| [**Traversal**](src/core/traversal.rs) |
- Breadth-first search (BFS)
- Depth-first search (DFS)
- Iterative deepening DFS
- Bidirectional search
### Extensions
| Module | Features/Algorithms | Status | Notes |
|------------------------------------------------------|--------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------|--------|-----------------------------------------------------------|
| [**Centrality**](src/centrality/algorithms.rs) |
- Degree centrality
- Closeness centrality
- Betweenness centrality
- Eigenvector centrality
- PageRank centrality
- Katz centrality
- Harmonic centrality
- Local/global reaching centrality
- VoteRank centrality
- Laplacian centrality
| [**Links**](src/links/algorithms.rs) |
- Resource allocation index
- Jaccard coefficient
- Adamic–Adar index
- Preferential attachment
- CN Soundarajan–Hopcroft
- RA Index Soundarajan–Hopcroft
- Within–inter-cluster ratio
- Common neighbor centrality
| [**Community**](src/community/algorithms.rs) |
- Label Propagation
- Louvain Method
- Girvan–Newman algorithm
- Spectral Clustering
- Personalized PageRank
- Infomap
- Connected components
| [**Approximation**](src/approximation/algorithms.rs) |
- Local node connectivity (BFS-based)
- Maximum independent set (greedy with neighbor caching)
- Maximum clique (greedy heuristic)
- Clique removal
- Large clique size
- Average clustering coefficient
- Densest subgraph (greedy peeling)
- Diameter lower bound
- Minimum weighted vertex cover (greedy re‑evaluated)
- Minimum maximal matching (greedy)
- Approximate Ramsey R2
- TSP approximations (greedy, simulated annealing, threshold accepting, Christofides placeholder)
- Treewidth decompositions (min degree, min fill-in)
> [!NOTE]
> Status shows whether the module is tested and benchmarked.
> Empty status means the module is implemented but not tested and benchmarked yet.
## Installation
```
cargo add graphina
```
*Graphina requires Rust 1.83 or later.*
## Documentation
See the [docs](docs/README.md) for the latest documentation.
Check out the [docs.rs/graphina](https://docs.rs/graphina) for the latest API documentation.
## Contributing
See [CONTRIBUTING.md](CONTRIBUTING.md) for details on how to make a contribution.
## License
This project is licensed under either of these:
* MIT License ([LICENSE-MIT](LICENSE-MIT))
* Apache License, Version 2.0 ([LICENSE-APACHE](LICENSE-APACHE))