pub struct PushRelabel<'a, G, F>where
G: 'a + IndexDigraph,{
pub cnt_relabel: usize,
pub use_global_relabelling: bool,
/* private fields */
}Expand description
The push-relabel algorithm.
This struct contains all algorithmic working data.
Fields§
§cnt_relabel: usizeThe number of relabel operations performed during the algorithm.
use_global_relabelling: boolWhether to use the global relabelling heuristic.
Implementations§
Source§impl<'a, G, F> PushRelabel<'a, G, F>
impl<'a, G, F> PushRelabel<'a, G, F>
Sourcepub fn new(g: &'a G) -> Self
pub fn new(g: &'a G) -> Self
Return a new push-relabel algorithm data structure for the digraph g.
Sourcepub fn value(&self) -> F
pub fn value(&self) -> F
Return the flow value.
The function returns 0 if the flow has not been computed, yet.
Sourcepub fn flow(&self, e: G::Edge<'_>) -> F
pub fn flow(&self, e: G::Edge<'_>) -> F
Return the flow value over some edge.
The function returns 0 if the flow has not been computed, yet.
Sourcepub fn flow_iter<'b>(&'b self) -> impl Iterator<Item = (G::Edge<'a>, F)> + 'b
pub fn flow_iter<'b>(&'b self) -> impl Iterator<Item = (G::Edge<'a>, F)> + 'b
Return an iterator over all (edge, flow) pairs.
Auto Trait Implementations§
impl<'a, G, F> Freeze for PushRelabel<'a, G, F>where
F: Freeze,
impl<'a, G, F> RefUnwindSafe for PushRelabel<'a, G, F>where
F: RefUnwindSafe,
G: RefUnwindSafe,
impl<'a, G, F> Send for PushRelabel<'a, G, F>
impl<'a, G, F> Sync for PushRelabel<'a, G, F>
impl<'a, G, F> Unpin for PushRelabel<'a, G, F>where
F: Unpin,
impl<'a, G, F> UnwindSafe for PushRelabel<'a, G, F>where
F: UnwindSafe,
G: RefUnwindSafe,
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