pub struct TopologicalGenerationsTrace {
pub generations: Vec<Vec<(usize, Option<usize>)>>,
pub unprocessed: Vec<usize>,
pub in_degree: Vec<usize>,
pub scanned: Vec<(usize, usize)>,
pub gen_offsets: Vec<usize>,
}Expand description
Kahn’s generations as far as they go, with what networkx’s lazy
topological_generations loop holds at every generation boundary.
networkx processes generation k (decrementing its children’s in-degree
on the LIVE graph) just before yielding it. A caller that mutates the
graph between two yields makes networkx continue from its state at that
boundary: in_degree minus every decrement in scanned[..gen_offsets[k]],
with generation k as the zero-in-degree list. Indices are positions in
DiGraph::nodes_ordered().
Fields§
§generations: Vec<Vec<(usize, Option<usize>)>>Per generation: (node, zeroing parent), in networkx’s order.
unprocessed: Vec<usize>Nodes whose in-degree never reached zero (on or behind a cycle), in node order. Empty exactly when the graph is acyclic.
in_degree: Vec<usize>Each node’s in-degree before any processing.
scanned: Vec<(usize, usize)>(parent, child) of every successor edge scanned, in scan order.
gen_offsets: Vec<usize>gen_offsets[k] is scanned.len() when processing generation k began.
Trait Implementations§
Source§impl Clone for TopologicalGenerationsTrace
impl Clone for TopologicalGenerationsTrace
Source§impl Debug for TopologicalGenerationsTrace
impl Debug for TopologicalGenerationsTrace
impl Eq for TopologicalGenerationsTrace
impl StructuralPartialEq for TopologicalGenerationsTrace
Auto Trait Implementations§
impl Freeze for TopologicalGenerationsTrace
impl RefUnwindSafe for TopologicalGenerationsTrace
impl Send for TopologicalGenerationsTrace
impl Sync for TopologicalGenerationsTrace
impl Unpin for TopologicalGenerationsTrace
impl UnsafeUnpin for TopologicalGenerationsTrace
impl UnwindSafe for TopologicalGenerationsTrace
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
Source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
Source§impl<Q, K> Equivalent<K> for Q
impl<Q, K> Equivalent<K> for Q
Source§impl<Q, K> Equivalent<K> for Q
impl<Q, K> Equivalent<K> for Q
Source§fn equivalent(&self, key: &K) -> bool
fn equivalent(&self, key: &K) -> bool
key and return true if they are equal.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> ⓘ
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> ⓘ
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