pub struct LocalKCut { /* private fields */ }Expand description
Deterministic Local K-Cut algorithm
Implementations§
Source§impl LocalKCut
impl LocalKCut
Sourcepub fn new(graph: Arc<DynamicGraph>, k: usize) -> Self
pub fn new(graph: Arc<DynamicGraph>, k: usize) -> Self
Sourcepub fn find_cut(&self, v: VertexId) -> Option<LocalCutResult>
pub fn find_cut(&self, v: VertexId) -> Option<LocalCutResult>
Find local minimum cut near vertex v with value ≤ k
§Algorithm
- Enumerate all 4^depth color combinations
- For each combination, perform color-constrained BFS
- Check if reachable set forms a valid cut
- Return the minimum cut found
§Arguments
v- Starting vertex
§Returns
Some(LocalCutResult) if a cut ≤ k is found, None otherwise
Sourcepub fn enumerate_paths(
&self,
v: VertexId,
depth: usize,
) -> Vec<HashSet<VertexId>>
pub fn enumerate_paths( &self, v: VertexId, depth: usize, ) -> Vec<HashSet<VertexId>>
Enumerate all color-constrained paths from vertex up to depth
This generates all possible reachable sets for different color combinations, which is the core of the deterministic enumeration.
§Arguments
v- Starting vertexdepth- Maximum path depth
§Returns
Vector of reachable vertex sets, one per color combination
Sourcepub fn edge_color(&self, edge_id: EdgeId) -> Option<EdgeColor>
pub fn edge_color(&self, edge_id: EdgeId) -> Option<EdgeColor>
Get the color of an edge
Sourcepub fn max_cut_size(&self) -> usize
pub fn max_cut_size(&self) -> usize
Get maximum cut size
Auto Trait Implementations§
impl Freeze for LocalKCut
impl !RefUnwindSafe for LocalKCut
impl Send for LocalKCut
impl Sync for LocalKCut
impl Unpin for LocalKCut
impl !UnwindSafe for LocalKCut
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