Last active
August 29, 2015 14:22
-
-
Save Ms2ger/40c96c0d5c1ac5e56b99 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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