Struct petgraph::visit::SubTopo
[−]
[src]
pub struct SubTopo<N, VM> { /* fields omitted */ }
A topological order traversal for a subgraph.
SubTopo
starts at a node, and does a topological order traversal of
all nodes reachable from the starting point.
Methods
impl<N, VM> SubTopo<N, VM> where
N: Clone,
VM: VisitMap<N>,
[src]
N: Clone,
VM: VisitMap<N>,
pub fn from_node<'a, G>(graph: &'a G, node: N) -> Self where
G: Externals<'a> + Visitable<NodeId = N, Map = VM>,
[src]
G: Externals<'a> + Visitable<NodeId = N, Map = VM>,
Create a new SubTopo
, using the graph's visitor map, and put single
node in the to-visit list.
pub fn reset_with_node<G>(&mut self, graph: &G, node: N) where
G: Revisitable<NodeId = N, Map = VM>,
[src]
G: Revisitable<NodeId = N, Map = VM>,
Clear visited state, and put a single node into the visit list.
pub fn next<'a, G>(&mut self, g: &'a G) -> Option<N> where
G: NeighborsDirected<'a> + Visitable<NodeId = N, Map = VM>,
[src]
G: NeighborsDirected<'a> + Visitable<NodeId = N, Map = VM>,
Return the next node in the current topological order traversal, or
None
if the traversal is at the end.
Note: The subgraph may not have a complete topological order. If there is a cycle in the subgraph, then nodes of that cycle are included in this traversal.