Work with directed graphs
Installation
Add the following to your Cargo.toml:
[]
= "0.47.2"
Overview
Operations
Build and query digraphs.
use ;
let mut graph = empty;
graph.add_arc;
graph.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 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_arc;
graph.add_arc;
assert!;
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
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.