pub struct StubInstance { /* private fields */ }Expand description
Stub instance that does brute-force min cut computation
This implementation:
- Stores a local copy of all edges
- Enumerates all proper subsets on each query
- Checks connectivity via BFS
- Computes exact boundary values
§Performance
- Query: O(2^n · m) where n = vertices, m = edges
- Only practical for n < 20
§Purpose
Used as a reference implementation to test the wrapper logic before the real LocalKCut algorithm is ready.
Implementations§
Source§impl StubInstance
impl StubInstance
Sourcepub fn new(graph: &DynamicGraph, lambda_min: u64, lambda_max: u64) -> Self
pub fn new(graph: &DynamicGraph, lambda_min: u64, lambda_max: u64) -> Self
Create a new stub instance with initial graph state
This is used for direct testing. The wrapper should use init() instead.
Trait Implementations§
Source§impl ProperCutInstance for StubInstance
impl ProperCutInstance for StubInstance
Source§fn init(_graph: &DynamicGraph, lambda_min: u64, lambda_max: u64) -> Self
fn init(_graph: &DynamicGraph, lambda_min: u64, lambda_max: u64) -> Self
Initialize instance on graph with given bounds Read more
Source§fn apply_inserts(&mut self, edges: &[(EdgeId, VertexId, VertexId)])
fn apply_inserts(&mut self, edges: &[(EdgeId, VertexId, VertexId)])
Apply batch of edge insertions Read more
Source§fn apply_deletes(&mut self, edges: &[(EdgeId, VertexId, VertexId)])
fn apply_deletes(&mut self, edges: &[(EdgeId, VertexId, VertexId)])
Apply batch of edge deletions Read more
Source§fn query(&mut self) -> InstanceResult
fn query(&mut self) -> InstanceResult
Query current minimum proper cut Read more
Auto Trait Implementations§
impl Freeze for StubInstance
impl RefUnwindSafe for StubInstance
impl Send for StubInstance
impl Sync for StubInstance
impl Unpin for StubInstance
impl UnwindSafe for StubInstance
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