Run breadth first search on an undirected graph. Runs in O(E + V) time. Run breadth-first search on a digraph. Runs in O(E + V) time.
| 30 | /// Run breadth-first search on a digraph. |
| 31 | /// Runs in O(E + V) time. |
| 32 | pub struct BreadthFirstPaths { |
| 33 | marked: Vec<bool>, // marked[v] = is there an s-v path |
| 34 | edge_to: Vec<usize>, // edgeTo[v] = previous edge on shortest s-v path |
| 35 | dist_to: Vec<usize>, // distTo[v] = number of edges shortest s-v path |
| 36 | s: usize, // source vertex |
| 37 | } |
| 38 | |
| 39 | impl Paths for DepthFirstPaths { |
| 40 | fn has_path(&self, v: usize) -> bool { |
nothing calls this directly
no outgoing calls
no test coverage detected