https://github.com/habedi/graphina

A graph data science library for Rust :crab:

https://github.com/habedi/graphina

Science Score: 26.0%

This score indicates how likely this project is to be science-related based on various indicators:

  • CITATION.cff file
  • codemeta.json file
    Found codemeta.json file
  • .zenodo.json file
    Found .zenodo.json file
  • DOI references
  • Academic publication links
  • Committers with academic emails
  • Institutional organization owner
  • JOSS paper metadata
  • Scientific vocabulary similarity
    Low similarity (16.6%) to scientific vocabulary

Keywords

crates-io data-mining-algorithms data-science graph-algorithms graph-analytics graph-theory network-analysis rust-lang social-network-analysis
Last synced: 6 months ago · JSON representation

Repository

A graph data science library for Rust :crab:

Basic Info
  • Host: GitHub
  • Owner: habedi
  • License: apache-2.0
  • Language: Rust
  • Default Branch: main
  • Homepage:
  • Size: 147 KB
Statistics
  • Stars: 61
  • Watchers: 3
  • Forks: 6
  • Open Issues: 8
  • Releases: 0
Topics
crates-io data-mining-algorithms data-science graph-algorithms graph-analytics graph-theory network-analysis rust-lang social-network-analysis
Created about 1 year ago · Last pushed 6 months ago
Metadata Files
Readme Contributing Funding License Code of conduct

README.md

Graphina the Dinosaur


Graphina

Tests Code Coverage CodeFactor Crates.io Docs.rs Downloads MSRV Docs License

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 and rustworkx, 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. The main goal is to make Graphina as feature-rich as NetworkX, but with the performance of Rust.

Additionally, PyGraphina Python library allows users to use Graphina in Python. Check out pygraphina directory for more details.

[!IMPORTANT] Graphina is in the early stages of development, so breaking changes may occur. Bugs and API inconsistencies are also expected, and the algorithms may not yet be optimized for performance.

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 | Feature or Algorithm | Status | Notes | |------------------------------------------|-----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------|--------|---------------------------------------------------| | Types |

  • Directed and undirected graphs
  • Weighted and unweighted graphs
| Tested | Graph types that Graphina supports |
| Exceptions |
  • List of exceptions
| Tested | Custom error types for Graphina | | IO |
  • Edge list
  • Adjacency list
| Tested | I/O routines for reading and writing graph data | | Generators |
  • Erdős–Rényi graph
  • Watts–Strogatz graph
  • Barabási–Albert graph
  • Complete graph
  • Bipartite graph
  • Star graph
  • Cycle graph
| Tested | Graph generators for random and structured graphs | | Paths |
  • Dijkstra’s algorithm
  • Bellman–Ford algorithm
  • Floyd–Warshall algorithm
  • Johnson’s algorithm
  • A* search algorithm
  • Iterative deepening A*
| Tested | Shortest paths algorithms | | MST |
  • Prim’s algorithm
  • Kruskal’s algorithm
  • Borůvka’s algorithm
| Tested | Minimum spanning tree algorithms | | Traversal |
  • Breadth-first search (BFS)
  • Depth-first search (DFS)
  • Iterative deepening DFS
  • Bidirectional search
| Tested | Graph traversal algorithms |

Extensions

| Module | Feature/Algorithm | Status | Notes | |------------------------------------------------------|--------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------|--------|-----------------------------------------------------------| | Centrality |

  • Degree centrality
  • Closeness centrality
  • Betweenness centrality
  • Eigenvector centrality
  • PageRank centrality
  • Katz centrality
  • Harmonic centrality
  • Local/global reaching centrality
  • Voterank centrality
  • Laplacian centrality
| Tested | Centrality measures | | Links |
  • Resource allocation index
  • Jaccard coefficient
  • Adamic–Adar index
  • Preferential attachment
  • CN Soundarajan–Hopcroft
  • RA index Soundarajan–Hopcroft
  • Within–inter-cluster ratio
  • Common neighbor centrality
| Tested | Link prediction algorithms | | Community |
  • Label propagation
  • Louvain method
  • Girvan–Newman algorithm
  • Spectral clustering
  • Personalized PageRank
  • Infomap
  • Connected components
| Tested | Community detection and clustering algorithms | | Approximation |
  • 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)
| Tested | Approximations and heuristic methods for NP‑hard problems |

[!NOTE] Status shows whether the module is Tested and Benchmarked. Empty status means the module is implemented but not tested and benchmarked yet.

Installation

shell cargo add graphina

Or add this to your Cargo.toml:

toml [dependencies] graphina = "0.3.0-a1"

Graphina requires Rust 1.86 or later.

Documentation

See the docs for the latest documentation.

Check out the docs.rs/graphina for the latest API documentation.

Simple Example

```rust use graphina::core::types::Graph;

fn main() { // Create a new undirected graph let mut graph = Graph::new();

// Add nodes and edges to the graph
let n0 = graph.add_node(1);
let n1 = graph.add_node(1);
let n2 = graph.add_node(2);
let n3 = graph.add_node(3);
graph.add_edge(n0, n1, 1.0);
graph.add_edge(n1, n2, 1.0);
graph.add_edge(n2, n3, 1.0);

// Get the neighbors of node 1
for neighbor in graph.neighbors(n1) {
    println!("Node 1 has neighbor: {}", neighbor.index());
}

} ```

See the examples and tests directories for more usage examples.

Contributing

See CONTRIBUTING.md for details on how to make a contribution.

Logo

The mascot is named "Graphina the Dinosaur". As the name implies, she's a dinosaur, however, she herself thinks she's a dragon.

The logo was created using GIMP, ComfyUI, and a Flux Schnell v2 model.

Licensing

Graphina is licensed under either of these:

PyGraphina is licensed under the MIT License (LICENSE).

GitHub Events

Total
  • Issues event: 11
  • Watch event: 50
  • Delete event: 5
  • Issue comment event: 10
  • Public event: 1
  • Push event: 218
  • Pull request event: 16
  • Fork event: 5
  • Create event: 12
Last Year
  • Issues event: 11
  • Watch event: 50
  • Delete event: 5
  • Issue comment event: 10
  • Public event: 1
  • Push event: 218
  • Pull request event: 16
  • Fork event: 5
  • Create event: 12

Committers

Last synced: 7 months ago

All Time
  • Total Commits: 8
  • Total Committers: 2
  • Avg Commits per committer: 4.0
  • Development Distribution Score (DDS): 0.125
Past Year
  • Commits: 8
  • Committers: 2
  • Avg Commits per committer: 4.0
  • Development Distribution Score (DDS): 0.125
Top Committers
Name Email Commits
Hassan Abedi h****t@g****m 7
Alsenz 7****z 1

Issues and Pull Requests

Last synced: 6 months ago

All Time
  • Total issues: 8
  • Total pull requests: 11
  • Average time to close issues: 2 days
  • Average time to close pull requests: about 16 hours
  • Total issue authors: 2
  • Total pull request authors: 3
  • Average comments per issue: 0.25
  • Average comments per pull request: 0.18
  • Merged pull requests: 8
  • Bot issues: 0
  • Bot pull requests: 0
Past Year
  • Issues: 8
  • Pull requests: 11
  • Average time to close issues: 2 days
  • Average time to close pull requests: about 16 hours
  • Issue authors: 2
  • Pull request authors: 3
  • Average comments per issue: 0.25
  • Average comments per pull request: 0.18
  • Merged pull requests: 8
  • Bot issues: 0
  • Bot pull requests: 0
Top Authors
Issue Authors
  • habedi (7)
  • alsenz (1)
Pull Request Authors
  • habedi (5)
  • dizzyi (4)
  • alsenz (2)
Top Labels
Issue Labels
development (4) enhancement (3) documentation (2)
Pull Request Labels
development (3) bug (2) enhancement (1) Idea (1)

Packages

  • Total packages: 2
  • Total downloads:
    • pypi 6 last-month
    • cargo 2,516 total
  • Total dependent packages: 0
    (may contain duplicates)
  • Total dependent repositories: 0
    (may contain duplicates)
  • Total versions: 6
  • Total maintainers: 2
pypi.org: pygraphina

Python bindings for the Graphina library

  • Versions: 1
  • Dependent Packages: 0
  • Dependent Repositories: 0
  • Downloads: 6 Last month
Rankings
Dependent packages count: 9.6%
Average: 31.8%
Dependent repos count: 53.9%
Maintainers (1)
Last synced: 6 months ago
crates.io: graphina

A graph data science library for Rust

  • Versions: 5
  • Dependent Packages: 0
  • Dependent Repositories: 0
  • Downloads: 2,516 Total
Rankings
Dependent repos count: 23.2%
Dependent packages count: 30.8%
Average: 48.7%
Downloads: 92.3%
Maintainers (1)
Last synced: 6 months ago

Dependencies

.github/workflows/lint.yml actions
  • actions-rust-lang/setup-rust-toolchain v1 composite
  • actions/checkout v4 composite
.github/workflows/publish.yml actions
  • actions-rust-lang/setup-rust-toolchain v1 composite
  • actions/checkout v4 composite
.github/workflows/tests.yml actions
  • actions-rust-lang/setup-rust-toolchain v1 composite
  • actions/checkout v4 composite
  • codecov/codecov-action v5 composite
Cargo.toml cargo
  • criterion 0.5 development
  • ctor 0.2.9
  • petgraph 0.7.1
  • rand 0.9.0
  • tracing 0.1.41
  • tracing-subscriber 0.3.19
.github/workflows/publish_py.yml actions
  • actions/checkout v4 composite
  • actions/setup-python v4 composite
pygraphina/Cargo.toml cargo
pygraphina/pyproject.toml pypi
pyproject.toml pypi
  • maturin ^1.8.2
  • mypy ^1.11.1
  • poetry-dynamic-versioning ^1.4.0
  • pytest ^8.0.1
  • pytest-benchmark ^5.1.0
  • pytest-cov ^6.0.0
  • pytest-mock ^3.14.0
  • python ^3.9
  • ruff ^0.9.3
  • twine ^6.1.0