pub struct GraphTraverser {}Expand description
Traverser for dependency graphs
Implementations§
Source§impl GraphTraverser
impl GraphTraverser
Sourcepub fn traverse_bfs(
&self,
graph: &DiGraph<RichNode, DependencyEdgeType>,
start: NodeIndex,
options: &TraversalOptions,
) -> Vec<NodeIndex>
pub fn traverse_bfs( &self, graph: &DiGraph<RichNode, DependencyEdgeType>, start: NodeIndex, options: &TraversalOptions, ) -> Vec<NodeIndex>
Perform breadth-first traversal from a starting node
Sourcepub fn traverse_dfs(
&self,
graph: &DiGraph<RichNode, DependencyEdgeType>,
start: NodeIndex,
options: &TraversalOptions,
) -> Vec<NodeIndex>
pub fn traverse_dfs( &self, graph: &DiGraph<RichNode, DependencyEdgeType>, start: NodeIndex, options: &TraversalOptions, ) -> Vec<NodeIndex>
Perform depth-first traversal from a starting node
Sourcepub fn topological_sort(
&self,
graph: &DiGraph<RichNode, DependencyEdgeType>,
) -> Result<Vec<NodeIndex>>
pub fn topological_sort( &self, graph: &DiGraph<RichNode, DependencyEdgeType>, ) -> Result<Vec<NodeIndex>>
Perform topological sort on the graph
Sourcepub fn find_reachable_nodes(
&self,
graph: &DiGraph<RichNode, DependencyEdgeType>,
start: NodeIndex,
) -> HashSet<NodeIndex>
pub fn find_reachable_nodes( &self, graph: &DiGraph<RichNode, DependencyEdgeType>, start: NodeIndex, ) -> HashSet<NodeIndex>
Find all nodes reachable from a starting node
Sourcepub fn get_nodes_at_depth(
&self,
graph: &DiGraph<RichNode, DependencyEdgeType>,
start: NodeIndex,
target_depth: usize,
) -> Vec<NodeIndex>
pub fn get_nodes_at_depth( &self, graph: &DiGraph<RichNode, DependencyEdgeType>, start: NodeIndex, target_depth: usize, ) -> Vec<NodeIndex>
Get nodes at a specific depth from a starting node
Sourcepub fn find_shortest_path(
&self,
graph: &DiGraph<RichNode, DependencyEdgeType>,
start: NodeIndex,
end: NodeIndex,
) -> Option<Vec<NodeIndex>>
pub fn find_shortest_path( &self, graph: &DiGraph<RichNode, DependencyEdgeType>, start: NodeIndex, end: NodeIndex, ) -> Option<Vec<NodeIndex>>
Find the shortest path between two nodes
Trait Implementations§
Auto Trait Implementations§
impl Freeze for GraphTraverser
impl RefUnwindSafe for GraphTraverser
impl Send for GraphTraverser
impl Sync for GraphTraverser
impl Unpin for GraphTraverser
impl UnwindSafe for GraphTraverser
Blanket Implementations§
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more
Source§impl<T> IntoEither for T
impl<T> IntoEither for T
Source§fn into_either(self, into_left: bool) -> Either<Self, Self>
fn into_either(self, into_left: bool) -> Either<Self, Self>
Converts
self into a Left variant of Either<Self, Self>
if into_left is true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read moreSource§fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
Converts
self into a Left variant of Either<Self, Self>
if into_left(&self) returns true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read more