wolf-graph 0.1.0

Data structures and algorithms for working with graphs with reference or value semantics.
Documentation
mod common;
use common::*;

use wolf_graph::prelude::*;

#[test]
fn test_topological_sort() {
    let graph = make_dag();
    let result = graph.topological_sort().unwrap();
    assert_eq!(format_ids(result), "[H, J, F, B, I, G, K, A, C, E, D]");

    let graph = make_graph();
    let result = graph.topological_sort();
    assert!(result.is_err());
}

#[test]
fn test_is_dag() {
    assert!(make_dag().is_dag());
    assert!(!make_graph().is_dag());
}