Rework DepthFirstSearch API

This expands the API to be more flexible, allowing for more visitation patterns
on graphs. This will be useful to avoid extra datasets (and allocations) in
cases where the expanded DFS API is sufficient.

This also fixes a bug with the previous DFS constructor, which left the start
node not marked as visited (even though it was immediately returned).
This commit is contained in:
Niko Matsakis
2020-11-23 09:26:10 -05:00
committed by Mark Rousskov
parent 11bbb52313
commit c9d46eb224
3 changed files with 69 additions and 3 deletions

View File

@@ -32,7 +32,7 @@ where
where
Self: WithNumNodes,
{
iterate::DepthFirstSearch::new(self, from)
iterate::DepthFirstSearch::new(self).with_start_node(from)
}
}