pub struct DynamicCutWatcher { /* private fields */ }Expand description
Dynamic cut watcher using incremental min-cut updates
Tracks the minimum cut value of the graph and identifies weak boundaries. Uses Stoer-Wagner for global min-cut and incremental updates for efficiency.
Implementations§
Source§impl DynamicCutWatcher
impl DynamicCutWatcher
pub fn new() -> Self
Sourcepub fn remove_edge(&mut self, u: u32, v: u32)
pub fn remove_edge(&mut self, u: u32, v: u32)
Remove an edge
Sourcepub fn min_cut_value(&mut self) -> f64
pub fn min_cut_value(&mut self) -> f64
Get current min-cut value (computes if cache invalid)
Sourcepub fn crosses_weak_cut(&mut self, u: u32, v: u32, threshold: f64) -> bool
pub fn crosses_weak_cut(&mut self, u: u32, v: u32, threshold: f64) -> bool
Check if an edge crosses a weak cut
Sourcepub fn same_partition(&mut self, u: u32, v: u32) -> bool
pub fn same_partition(&mut self, u: u32, v: u32) -> bool
Get nodes in the same partition
Sourcepub fn boundary_edges(&mut self) -> &HashSet<(u32, u32)>
pub fn boundary_edges(&mut self) -> &HashSet<(u32, u32)>
Get boundary edges
Auto Trait Implementations§
impl Freeze for DynamicCutWatcher
impl RefUnwindSafe for DynamicCutWatcher
impl Send for DynamicCutWatcher
impl Sync for DynamicCutWatcher
impl Unpin for DynamicCutWatcher
impl UnwindSafe for DynamicCutWatcher
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> Instrument for T
impl<T> Instrument for T
Source§fn instrument(self, span: Span) -> Instrumented<Self>
fn instrument(self, span: Span) -> Instrumented<Self>
Source§fn in_current_span(self) -> Instrumented<Self>
fn in_current_span(self) -> Instrumented<Self>
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