pub struct DynamicCutWatcher { /* private fields */ }Expand description
Background process for continuous min-cut monitoring
Maintains incremental estimate of min-cut and detects significant changes
Implementations§
Source§impl DynamicCutWatcher
impl DynamicCutWatcher
Sourcepub fn new(config: CutWatcherConfig) -> Self
pub fn new(config: CutWatcherConfig) -> Self
Create a new dynamic cut watcher
Sourcepub fn insert_edge(
&mut self,
u: u32,
v: u32,
weight: f64,
) -> Result<(), DynamicMinCutError>
pub fn insert_edge( &mut self, u: u32, v: u32, weight: f64, ) -> Result<(), DynamicMinCutError>
Insert an edge
Time: O(log n) amortized when λ is bounded
Sourcepub fn delete_edge(&mut self, u: u32, v: u32) -> Result<(), DynamicMinCutError>
pub fn delete_edge(&mut self, u: u32, v: u32) -> Result<(), DynamicMinCutError>
Delete an edge
Time: O(log n) amortized
Sourcepub fn current_mincut(&self) -> f64
pub fn current_mincut(&self) -> f64
Get current min-cut estimate without recomputation
Sourcepub fn cut_changed(&self) -> bool
pub fn cut_changed(&self) -> bool
Check if cut changed significantly since last check
Sourcepub fn is_cut_sensitive(&self, u: u32, v: u32) -> bool
pub fn is_cut_sensitive(&self, u: u32, v: u32) -> bool
Heuristic: does this edge likely affect min-cut?
Uses local flow score and connectivity information
Sourcepub fn recompute_exact(
&mut self,
adj_matrix: &[Vec<f64>],
) -> Result<f64, DynamicMinCutError>
pub fn recompute_exact( &mut self, adj_matrix: &[Vec<f64>], ) -> Result<f64, DynamicMinCutError>
Full recomputation using Stoer-Wagner
Fallback when incremental methods are insufficient
Sourcepub fn process_updates(&mut self) -> Result<usize, DynamicMinCutError>
pub fn process_updates(&mut self) -> Result<usize, DynamicMinCutError>
Process pending updates incrementally
Sourcepub fn stats(&self) -> WatcherStats
pub fn stats(&self) -> WatcherStats
Get statistics about the watcher state
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