pub struct PushRelabelMaxFlow { /* private fields */ }Expand description
Push-Relabel maximum flow algorithm with FIFO selection and highest-label strategy.
Time complexity: O(V² √E).
§Example
use scirs2_graph::flow::max_flow::PushRelabelMaxFlow;
let mut pr = PushRelabelMaxFlow::new(4);
pr.add_edge(0, 1, 10);
pr.add_edge(0, 2, 10);
pr.add_edge(1, 3, 10);
pr.add_edge(2, 3, 10);
let flow = pr.max_flow(0, 3);
assert_eq!(flow, 20);Implementations§
Trait Implementations§
Source§impl Clone for PushRelabelMaxFlow
impl Clone for PushRelabelMaxFlow
Source§fn clone(&self) -> PushRelabelMaxFlow
fn clone(&self) -> PushRelabelMaxFlow
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 moreAuto Trait Implementations§
impl Freeze for PushRelabelMaxFlow
impl RefUnwindSafe for PushRelabelMaxFlow
impl Send for PushRelabelMaxFlow
impl Sync for PushRelabelMaxFlow
impl Unpin for PushRelabelMaxFlow
impl UnsafeUnpin for PushRelabelMaxFlow
impl UnwindSafe for PushRelabelMaxFlow
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<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