pub trait IterDepthFirst<'a, G: GraphInterface> {
// Required methods
fn iter_depth_first(&'a self, start: NodeID) -> DepthFirstSearch<'a, G> ⓘ;
fn connected_components(&'a self) -> Vec<HashSet<NodeID>>;
}
Expand description
Under development
Required Methods§
Sourcefn iter_depth_first(&'a self, start: NodeID) -> DepthFirstSearch<'a, G> ⓘ
fn iter_depth_first(&'a self, start: NodeID) -> DepthFirstSearch<'a, G> ⓘ
Returns a depth first search iterator starting from a given node
Sourcefn connected_components(&'a self) -> Vec<HashSet<NodeID>>
fn connected_components(&'a self) -> Vec<HashSet<NodeID>>
Returns a vector of sets of node IDs, where each set is a connected component.
Starts a DFS at every node (except if it’s already been visited) and marks all reachable nodes as being part of the same component.