szyk 0.1.0

generic topological sort
Documentation

Generic topological sort algorithm (depth-first)

Examples

use szyk::*;

let result = topsort_values(
&[
Node::new("wooden pickaxe", vec!["planks", "sticks"], "Pickaxe"),
Node::new("planks", vec!["wood"], "Planks"),
Node::new("sticks", vec!["planks"], "Sticks"),
Node::new("wood", vec![], "Wood"),
],
"wooden pickaxe",
);
assert_eq!(result, Ok(vec!["Wood", "Planks", "Sticks", "Pickaxe"]));