Run depth-first search on an undirected graph. Determine reachability in a digraph from a given vertex using depth-first search. Runs in O(E + V) time.
| 19 | /// depth-first search. |
| 20 | /// Runs in O(E + V) time. |
| 21 | pub struct DepthFirstPaths { |
| 22 | marked: Vec<bool>, // marked[v] = is there an s-v path? |
| 23 | edge_to: Vec<usize>, // edgeTo[v] = last edge on s-v path |
| 24 | s: usize, // source vertex |
| 25 | } |
| 26 | |
| 27 | /// Run breadth first search on an undirected graph. |
| 28 | /// Runs in O(E + V) time. |
nothing calls this directly
no outgoing calls
no test coverage detected