pub struct ForestPacking { /* private fields */ }Expand description
Forest packing for witness guarantees
A forest packing consists of multiple edge-disjoint spanning forests. Each forest witnesses certain cuts - a cut that cuts many edges in a forest is likely to be important.
§Witness Property
A cut (S, V\S) is witnessed by a forest F if |F ∩ δ(S)| ≥ 1, where δ(S) is the set of edges crossing the cut.
Implementations§
Source§impl ForestPacking
impl ForestPacking
Sourcepub fn greedy_packing(
graph: &DynamicGraph,
lambda_max: usize,
epsilon: f64,
) -> Self
pub fn greedy_packing( graph: &DynamicGraph, lambda_max: usize, epsilon: f64, ) -> Self
Create greedy forest packing with ⌈λ_max · log(m) / ε²⌉ forests
§Algorithm
Greedy algorithm:
- Start with empty forests
- For each forest, greedily add edges that don’t create cycles
- Continue until we have enough forests for witness guarantees
§Arguments
graph- The graph to packlambda_max- Upper bound on maximum cut valueepsilon- Approximation parameter
§Returns
A forest packing with witness guarantees
Sourcepub fn witnesses_cut(&self, cut_edges: &[(VertexId, VertexId)]) -> bool
pub fn witnesses_cut(&self, cut_edges: &[(VertexId, VertexId)]) -> bool
Sourcepub fn num_forests(&self) -> usize
pub fn num_forests(&self) -> usize
Get number of forests
Auto Trait Implementations§
impl Freeze for ForestPacking
impl RefUnwindSafe for ForestPacking
impl Send for ForestPacking
impl Sync for ForestPacking
impl Unpin for ForestPacking
impl UnwindSafe for ForestPacking
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