Work with directed graphs.
Installation
Add the following to your Cargo.toml:
[]
= "0.50.1"
Overview
Operations
Build and query digraphs.
use ;
let mut digraph = empty;
digraph.add_arc;
digraph.add_arc;
assert_eq!;
assert_eq!;
assert_eq!;
Algorithms
Search, traverse, and analyze digraphs.
use single_pair_shortest_path as spsp;
// 0 ← 1
// ↑ ↑
// 3 → 2
let digraph = ;
assert_eq!;
assert_eq!;
assert_eq!;
assert_eq!;
Generators
Generate parameterized digraphs.
use *;
assert_eq!;
assert_eq!;
assert_eq!;
Generate random digraphs.
use ;
let tournament = Vec::random_tournament;
assert_eq!;
assert_eq!;
for s in tournament.iter_vertices
Representations
An adjacency matrix representation is available with the adjacency_matrix
feature.
use ;
let mut digraph = new;
digraph.add_arc;
digraph.add_arc;
assert!;
Project goals
- A flexible API for digraph operations
- A comprehensive set of algorithms
- Generators for common digraphs
- Competitive performance
- Complete documentation
- Full unit test coverage
- Full benchmark coverage
- Extensive property tests
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.