Keyboard shortcuts

Press or to navigate between chapters

Press S or / to search in the book

Press ? to show this help

Press Esc to hide this help

rust-igraph

A pure-Rust port of igraph, the network-analysis library. Targets full API parity with igraph C v1.0.x (≈ 850 public functions), validated continuously against three official implementations:

  • igraph Ctests/unit/*.c + *.out
  • python-igraphtests/test_*.py
  • R-igraph (rigraph) — tests/testthat/test-*.R

Status: 308 algorithm work units complete across Phases 1–7 and 9. 1,297 public APIs, 8,577 tests (unit + integration + doctest + proptest). WASM-compatible (wasm32-unknown-unknown). See the master plan for the roadmap, and the algorithm tracker for per-algorithm progress.

What's implemented

CategoryHighlights
TraversalBFS, DFS, shortest paths (Dijkstra, Bellman-Ford, Johnson, Floyd-Warshall, A*), widest paths
CentralityPageRank, betweenness, closeness, harmonic, eigenvector, HITS, constraint
CommunityLouvain, Leiden, Infomap, Spinglass, label propagation, fluid communities, fast greedy, edge betweenness, walktrap, leading eigenvector, Voronoi
ConnectivityComponents, articulation points, bridges, biconnected components, cohesive blocks
FlowMax flow (Dinic), min cut, Gomory-Hu tree, vertex/edge connectivity, all s-t cuts
IsomorphismVF2 (graph + subgraph), BLISS canonical labeling, LAD subgraph isomorphism
ColoringGreedy vertex coloring (CN + DSatur), chordality, bipartite matching
Constructors40+ graph generators (Erdős-Rényi, Barabási-Albert, Watts-Strogatz, SBM, lattices, famous graphs, ...)
I/O8 formats: GML, GraphML, DOT, Pajek, NCOL, LGL, DL, LEDA — all attribute-aware
OperatorsUnion, intersection, difference, complement, simplify, permute, line graph

Why another Rust graph library?

petgraph is excellent for general-purpose graph work, but its API does not express what igraph_t expresses (rich attributes, vertex/edge selectors, full C API parity). Users coming from igraph's C, Python, or R bindings need a Rust home where:

  • function names mirror igraph_*
  • numerical results match python-igraph within tight tolerance
  • the build is WASM-friendly by default (no unsafe, no system deps)

License

GPL-2.0-or-later, matching upstream igraph. The architecture decision record explains why.

How this site is built

mdBook builds the prose sections; cargo doc builds the API rustdoc; CI publishes both to GitHub Pages. To build locally:

cargo install mdbook
mdbook serve --open