pub struct ReachabilityAnalysis {
pub reachable_from: HashMap<usize, HashSet<usize>>,
pub can_reach: HashMap<usize, HashSet<usize>>,
pub sccs: Vec<HashSet<usize>>,
pub topo_order: Option<Vec<usize>>,
}Expand description
Result of reachability analysis.
Fields§
§reachable_from: HashMap<usize, HashSet<usize>>Which nodes can be reached from each node
can_reach: HashMap<usize, HashSet<usize>>Which nodes can reach each node
sccs: Vec<HashSet<usize>>Strongly connected components
topo_order: Option<Vec<usize>>Topological ordering (if DAG)
Implementations§
Source§impl ReachabilityAnalysis
impl ReachabilityAnalysis
Sourcepub fn is_reachable(&self, from: usize, to: usize) -> bool
pub fn is_reachable(&self, from: usize, to: usize) -> bool
Check if node to is reachable from node from.
Sourcepub fn get_reachable(&self, from: usize) -> HashSet<usize>
pub fn get_reachable(&self, from: usize) -> HashSet<usize>
Get all nodes reachable from a given node.
Sourcepub fn get_predecessors(&self, to: usize) -> HashSet<usize>
pub fn get_predecessors(&self, to: usize) -> HashSet<usize>
Get all nodes that can reach a given node.
Sourcepub fn get_topo_order(&self) -> Option<&[usize]>
pub fn get_topo_order(&self) -> Option<&[usize]>
Get the topological order if it exists.
Trait Implementations§
Source§impl Clone for ReachabilityAnalysis
impl Clone for ReachabilityAnalysis
Source§fn clone(&self) -> ReachabilityAnalysis
fn clone(&self) -> ReachabilityAnalysis
Returns a duplicate of the value. Read more
1.0.0 · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from
source. Read moreSource§impl Debug for ReachabilityAnalysis
impl Debug for ReachabilityAnalysis
Auto Trait Implementations§
impl Freeze for ReachabilityAnalysis
impl RefUnwindSafe for ReachabilityAnalysis
impl Send for ReachabilityAnalysis
impl Sync for ReachabilityAnalysis
impl Unpin for ReachabilityAnalysis
impl UnwindSafe for ReachabilityAnalysis
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