29 releases (14 breaking)
| new 0.15.0 | Dec 14, 2025 |
|---|---|
| 0.14.0 | Nov 28, 2025 |
| 0.11.0 | Jul 29, 2025 |
| 0.1.0 | Mar 28, 2025 |
#700 in Data structures
55 downloads per month
Used in 5 crates
(3 directly)
1MB
20K
SLoC
Linnet
Linnet is a graph library, specifically designed and developed to represent tensor networks and Feynman diagrams as used in projects like gammaloop and spenso.
The choice of a half-edge data structure is central to Linnet's design. This structure is exceptionally well-suited for these applications because it intrinsically supports the definition and manipulation of subgraphs that can be cleanly and efficiently "split" along edges (so that node degree is preserved).
All of the graph algorithms, iterators and graph manipulations operate at the level of subgraphs (which can also be the whole graph).
Key Features
- Efficient Half-Edge Data Structure: Utilizes a half-edge representation, enabling efficient graph traversal, easy graph modifications like:
- node identification
- subgraph excision (splitting graphs in two)
- graph joining along sewn along half edges
- edge contraction
- Subgraph Manipulation: Provides capabilities for defining, extracting, and analyzing various types of subgraphs, such as those induced by node properties, connectivity patterns (e.g., cycles, biconnected components), or graph cuts.
- Graph Drawing & Visualization: Includes functionalities for generating visual representations of graphs. Provides graph layouting based on simulated annealing of pseudo spring forces.
- Dot Parsing Integrates
dot-parsercurtesy of Martin Vassor integrated in a macro.
Getting Started
To start using Linnet in your Rust project, add it as a dependency in your Cargo.toml:
[dependencies]
linnet = "0.6.2"
Acknowledgement
This crate was written by Lucien Huber
Dependencies
~7–22MB
~305K SLoC