pub struct BDD { /* private fields */ }Expand description
Binary Decision Diagram (BDD) for exact network reliability computation.
Represents the reliability function as an ordered BDD over edge boolean
variables. Each variable x_e = 1 means edge e is functioning.
The BDD is built by Shannon expansion on each edge variable in order:
- Set
x_e = 1(edge alive): recurse on remaining problem. - Set
x_e = 0(edge failed): recurse. - Merge isomorphic subgraphs (unique table) for compactness.
Reliability is computed by a single bottom-up traversal weighting
each path by p_e^{x_e} (1−p_e)^{1−x_e}.
Implementations§
Source§impl BDD
impl BDD
Sourcepub fn build_all_terminal(adj: &Array2<f64>) -> Result<Self>
pub fn build_all_terminal(adj: &Array2<f64>) -> Result<Self>
Build a BDD for all-terminal reliability.
Only feasible for |E| ≤ 20.
Sourcepub fn reliability(&self, probs: &[f64]) -> Result<f64>
pub fn reliability(&self, probs: &[f64]) -> Result<f64>
Compute the all-terminal reliability R = E[connected(G_p)] using the BDD.
§Arguments
probs— survival probability for each edge, in the same order as the adjacency matrix edge enumeration (upper-triangle, row-major).
Sourcepub fn num_network_nodes(&self) -> usize
pub fn num_network_nodes(&self) -> usize
Return the number of nodes in the underlying network.
Trait Implementations§
Auto Trait Implementations§
impl Freeze for BDD
impl RefUnwindSafe for BDD
impl Send for BDD
impl Sync for BDD
impl Unpin for BDD
impl UnsafeUnpin for BDD
impl UnwindSafe for BDD
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