pub fn build_order(
g: &Vec<Vec<usize>>,
roots: &[usize],
) -> Result<Vec<usize>, usize>Expand description
The dependency build order of roots in graph g: Ok(order), the DFS
post-order, holds exactly the nodes reachable from roots, each once and
after all of its dependencies; Err(w), at a node w on a cycle,
exactly when a cycle is reachable from roots.