pub struct InducedDag { /* private fields */ }Expand description
The open DAG a compositional model induces (Lorenz & Tull, arXiv:2602.16612, Example 61): one vertex per node of the model’s grouping, one edge per wire leaving one node and entering another. Derived, never stored beside the model.
The graph is a plain adjacency set with the reachability queries the abstraction layer needs:
parents and children for the structural precheck, blocked reachability for Definition 49’s
α(X), plain reachability for the parallelisable test of §7.2, and a cycle test for build().
Implementations§
Source§impl InducedDag
impl InducedDag
Sourcepub fn add_edge(&mut self, a: usize, b: usize) -> &mut Self
pub fn add_edge(&mut self, a: usize, b: usize) -> &mut Self
Adds the edge a → b. Out-of-range endpoints are ignored, so a caller building from a
validated model never sees a panic here.
Sourcepub fn num_vertices(&self) -> usize
pub fn num_vertices(&self) -> usize
The vertex count.
Sourcepub fn reaches(&self, a: usize, b: usize) -> bool
pub fn reaches(&self, a: usize, b: usize) -> bool
Whether a directed path of at least one edge runs from a to b.
Sourcepub fn reaches_avoiding(
&self,
start: usize,
targets: &BTreeSet<usize>,
blocked: &BTreeSet<usize>,
) -> bool
pub fn reaches_avoiding( &self, start: usize, targets: &BTreeSet<usize>, blocked: &BTreeSet<usize>, ) -> bool
Whether some vertex of targets is reached from start along a directed path none of
whose vertices, start included, lies in blocked. A start in targets counts through
the empty path, which is Definition 49’s π(X) ⊆ α(X).
Sourcepub fn topological_order(&self) -> Option<Vec<usize>>
pub fn topological_order(&self) -> Option<Vec<usize>>
A topological order, or None if the graph has a cycle. Kahn’s algorithm, ties broken by
ascending vertex.
Trait Implementations§
Source§impl Clone for InducedDag
impl Clone for InducedDag
Source§fn clone(&self) -> InducedDag
fn clone(&self) -> InducedDag
1.0.0 (const: unstable) · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source. Read more