XDag
A simple DAG (Directed Acyclic Graph) library
Note
This lib just provides a data-structure to store DAG with checking. It doesn't contain any algorithm about DAG.
Details
XDAG stores DAG by HashMap. it CANNOT ensure the order of children and edges
Docs
Examples
// Create a new DAG
let mut dag = new;
// insert 3 nodes with data '()'
dag.insert_node;
dag.insert_node;
dag.insert_node;
// insert 2 edges with data '()'
dag.insert_edge.unwrap;
dag.insert_edge.unwrap;
// Get all roots and leaves in DAG
let roots = dag.roots.map.;
let leaves = dag.leaves.map.;
assert_eq!;
for id in .iter