pub struct SimpleDag { /* private fields */ }Expand description
A simple directed acyclic graph.
Implementations§
Source§impl SimpleDag
impl SimpleDag
Sourcepub fn successors(&self, node: usize) -> &[usize]
pub fn successors(&self, node: usize) -> &[usize]
Returns the successors of node.
Sourcepub fn can_reach(&self, from: usize, to: usize) -> bool
pub fn can_reach(&self, from: usize, to: usize) -> bool
Returns true if from can reach to via DFS.
Sourcepub fn topological_sort(&self) -> Option<Vec<usize>>
pub fn topological_sort(&self) -> Option<Vec<usize>>
Returns the topological order of nodes, or None if a cycle is detected.
Auto Trait Implementations§
impl Freeze for SimpleDag
impl RefUnwindSafe for SimpleDag
impl Send for SimpleDag
impl Sync for SimpleDag
impl Unpin for SimpleDag
impl UnsafeUnpin for SimpleDag
impl UnwindSafe for SimpleDag
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