#data-structure #graph #hypergraph


Hypergraph is data structure library to create a directed hypergraph in which an hyperedge can join any number of vertices

13 releases (4 stable)

new 1.0.3 Sep 21, 2021
1.0.2 Sep 5, 2021
1.0.1 Aug 21, 2021
0.2.1 Jun 28, 2021
0.1.3 Nov 15, 2020

#250 in Data structures

44 downloads per month

MIT license

930 lines


GitHub Workflow Status Crates.io docs.rs

Hypergraph is a data structure library to generate directed hypergraphs.

A hypergraph is a generalization of a graph in which a hyperedge can join any number of vertices.


This library enables you to:

  • represent non-simple hypergraphs with two or more hyperedges - with different weights - containing the exact same set of vertices
  • represent self-loops - i.e., hyperedges containing vertices directed to themselves one or more times
  • represent unaries - i.e., hyperedges containing a unique vertex

Additional features:

  • Safe Rust implementation
  • Proper error handling
  • Stable indexes assigned for each hyperedge and each vertex


Add this to your Cargo.toml (replace current_version with the latest version of the library):

hypergraph = "curent_version"


Please read the documentation to get started.


~35K SLoC