Graaf

Build, search, and manipulate digraphs.
Project goals
- A flexible API for digraph operations
- A comprehensive set of algorithms
- Generators for common digraphs
- Competitive performance
- Full documentation
- Extensive property tests
- Complete unit test and benchmark coverage
Installation
Add the following to your Cargo.toml:
[]
= "0.53.4"
Example
use ;
let mut digraph = empty;
// 0 -> {1, 2}
// 1 -> {}
// 2 -> {}
digraph.add_arc;
digraph.add_arc;
assert_eq!;
assert_eq!;
assert_eq!;
// 0 -> {}
// 1 -> {0}
// 2 -> {1}
// 3 -> {0, 2}
let digraph = ;
assert_eq!;
assert_eq!;
// 0 -> {}
// 1 -> {}
// 2 -> {}
assert!;
// 0 -> {1}
// 1 -> {2}
// 2 -> {0}
assert!;
// 0 -> {1, 2}
// 1 -> {0, 2}
// 2 -> {0, 1}
assert!;
let tournament = Vec::random_tournament;
assert_eq!;
assert_eq!;
for s in tournament.iter_vertices
let mut digraph = new;
// 0 -> {1}
// 1 -> {1}
digraph.add_arc;
digraph.add_arc;
assert!;
Features
These features require nightly Rust.
adjacency_matrixenables the adjacency matrix representation.
Changelog
See CHANGELOG.md for a list of changes.
License
Licensed under Apache License, Version 2.0 or MIT license at your option.