Expand description
Depth-first-search.
Example
use rs_graph::LinkedListGraph;
use rs_graph::traits::*;
use rs_graph::classes;
use rs_graph::search::dfs;
let g: LinkedListGraph = classes::peterson();
let mut cnt = 0;
for (u, e) in dfs::start(g.neighbors(), g.id2node(0)) {
assert_ne!(g.node_id(u), 0);
cnt += 1;
}
assert_eq!(cnt, g.num_nodes() - 1);
Structs
Functions
- Start and return a DFS iterator using default data structures.
- Start and return a DFS iterator with user defined data structures.
Type Aliases
- DFS iterator with default data structures.