pub struct MinCutResult {
pub source_side: AHashSet<i64>,
pub sink_side: AHashSet<i64>,
pub cut_edges: Vec<(i64, i64)>,
pub cut_size: usize,
}Expand description
Result of minimum s-t edge cut computation.
Represents the minimum set of edges whose removal disconnects the source from the target in a directed graph.
§Fields
source_side: Nodes reachable from source in the residual graph (after max-flow)sink_side: All other nodes (complement of source_side)cut_edges: Edges crossing from source_side to sink_side (the minimum cut)cut_size: Number of edges in the minimum cut (equals max flow value)
§Example
ⓘ
let graph = SqliteGraph::open_in_memory()?;
// ... build graph ...
let result = min_st_cut(&graph, 1, 5)?;
println!("Source side: {:?}", result.source_side);
println!("Sink side: {:?}", result.sink_side);
println!("Cut edges (remove these to disconnect): {:?}", result.cut_edges);
println!("Cut size: {} (min edges to remove)", result.cut_size);Fields§
§source_side: AHashSet<i64>Source side of the cut (nodes reachable from source in residual graph)
sink_side: AHashSet<i64>Sink side of the cut (all other nodes)
cut_edges: Vec<(i64, i64)>Edges crossing the cut (from source_side to sink_side)
cut_size: usizeNumber of edges in the minimum cut
Trait Implementations§
Source§impl Clone for MinCutResult
impl Clone for MinCutResult
Source§fn clone(&self) -> MinCutResult
fn clone(&self) -> MinCutResult
Returns a duplicate of the value. Read more
1.0.0 · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from
source. Read moreSource§impl Debug for MinCutResult
impl Debug for MinCutResult
Source§impl PartialEq for MinCutResult
impl PartialEq for MinCutResult
impl Eq for MinCutResult
impl StructuralPartialEq for MinCutResult
Auto Trait Implementations§
impl Freeze for MinCutResult
impl RefUnwindSafe for MinCutResult
impl Send for MinCutResult
impl Sync for MinCutResult
impl Unpin for MinCutResult
impl UnsafeUnpin for MinCutResult
impl UnwindSafe for MinCutResult
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> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
Source§impl<Q, K> Equivalent<K> for Q
impl<Q, K> Equivalent<K> for Q
Source§impl<Q, K> Equivalent<K> for Q
impl<Q, K> Equivalent<K> for Q
Source§impl<Q, K> Equivalent<K> for Q
impl<Q, K> Equivalent<K> for Q
Source§fn equivalent(&self, key: &K) -> bool
fn equivalent(&self, key: &K) -> bool
Compare self to
key and return true if they are equal.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