lgl
Small graph library written in Rust.
Motivation
I read that writing a graph library in Rust is difficult do Rust's builtin ownership and borrowing, since each vertex can be referenced by an arbitrary number of other vertices. So I figured I'd give it a shot to learn the language. Plus, this will hopefully serve as a useful utility for compiler writing in Rust later on.
Usage
let d1 = 1;
let d2 = 2;
let mut g = new;
g.add_vertex;
g.add_vertex;
g.add_edge;
let neighbors = g.neighbors;
assert!;
assert!;
assert!;
Testing
$ cargo test