Skip to content

Instantly share code, notes, and snippets.

@Ms2ger
Last active August 29, 2015 14:22
Show Gist options
  • Save Ms2ger/40c96c0d5c1ac5e56b99 to your computer and use it in GitHub Desktop.
Save Ms2ger/40c96c0d5c1ac5e56b99 to your computer and use it in GitHub Desktop.
fn searcher(g: &Graph<Node,Edge>, ni: NodeIndex) -> Vec<Vec<Node>> {
let mut v = Vec::new();
for neighbor in g.neighbors_directed(ni, EdgeDirection::Outgoing) {
let result = searcher(&g, neighbor);
for mut nodev in result {
let node = g.node_weight(ni).unwrap().clone();
nodev.insert(0, node);
v.push(nodev);
}
}
v
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment