Work with directed graphs
Installation
Add the following to your Cargo.toml:
[]
= "0.44.0"
Overview
Operations
Build and query graphs.
use ;
let mut graph = empty;
graph.add_edge;
graph.add_edge;
assert_eq!;
assert_eq!;
assert_eq!;
Algorithms
Search, traverse, and analyze graphs.
use single_pair_shortest_path as spsp;
// 0 ← 1
// ↑ ↑
// 3 → 2
let graph = ;
assert_eq!;
assert_eq!;
assert_eq!;
assert_eq!;
Representations
An adjacency matrix representation is available with the adjacency_matrix
feature.
use ;
let mut graph = new;
graph.add_edge;
graph.add_edge;
assert!;
Generators
Generate parameterized graphs.
use *;
assert_eq!;
assert_eq!;
assert_eq!;
Features
These features require nightly Rust.
adjacency_matrixenables the adjacency matrix representation.
Changelog
See CHANGELOG.md.
License
Use graaf under either the Apache License, Version 2.0, or the MIT license at your option.