Struct rs_graph::maxflow::pushrelabel::PushRelabel[][src]

pub struct PushRelabel<'a, G, F> where
    G: 'a + IndexDigraph<'a>, 
{ pub cnt_relabel: usize, pub use_global_relabelling: bool, // some fields omitted }

The push-relabel algorithm.

This struct contains all algorithmic working data.

Fields

cnt_relabel: usize

The number of relabel operations performed during the algorithm.

use_global_relabelling: bool

Whether to use the global relabelling heuristic.

Trait Implementations

impl<'a, G, F> MaxFlow<'a> for PushRelabel<'a, G, F> where
    G: IndexDigraph<'a>,
    F: NumAssign + Ord + Copy
[src]

fn new(g: &'a G) -> Self[src]

Return a new push-relabel algorithm data structure for the digraph g.

fn as_graph(&self) -> &'a Self::Graph[src]

Return a reference to the underlying graph.

fn value(&self) -> F[src]

Return the flow value.

The function returns 0 if the flow has not been computed, yet.

fn flow(&self, e: G::Edge) -> F[src]

Return the flow value over some edge.

The function returns 0 if the flow has not been computed, yet.

fn solve<Us>(&mut self, src: G::Node, snk: G::Node, upper: Us) where
    Us: Fn(G::Edge) -> Self::Flow
[src]

Run the push-relabel algorithm from some source to some sink node.

fn mincut(&self) -> Vec<G::Node>[src]

Return the minimal cut.

type Graph = G

Type of the underlying graph.

type Flow = F

Type of flows.

fn flow_vec(&self) -> EdgeVec<'a, &'a Self::Graph, Self::Flow>[src]

The flow as vector.

Auto Trait Implementations

impl<'a, G, F> RefUnwindSafe for PushRelabel<'a, G, F> where
    F: RefUnwindSafe,
    G: RefUnwindSafe,
    <G as GraphType<'a>>::Edge: RefUnwindSafe,
    <G as Directed<'a>>::IncidentIt: RefUnwindSafe,
    <G as GraphType<'a>>::Node: RefUnwindSafe

impl<'a, G, F> Send for PushRelabel<'a, G, F> where
    F: Send,
    G: Sync,
    <G as GraphType<'a>>::Edge: Send,
    <G as Directed<'a>>::IncidentIt: Send,
    <G as GraphType<'a>>::Node: Send

impl<'a, G, F> Sync for PushRelabel<'a, G, F> where
    F: Sync,
    G: Sync,
    <G as GraphType<'a>>::Edge: Sync,
    <G as Directed<'a>>::IncidentIt: Sync,
    <G as GraphType<'a>>::Node: Sync

impl<'a, G, F> Unpin for PushRelabel<'a, G, F> where
    F: Unpin,
    <G as GraphType<'a>>::Edge: Unpin,
    <G as Directed<'a>>::IncidentIt: Unpin,
    <G as GraphType<'a>>::Node: Unpin

impl<'a, G, F> UnwindSafe for PushRelabel<'a, G, F> where
    F: UnwindSafe,
    G: RefUnwindSafe,
    <G as GraphType<'a>>::Edge: UnwindSafe,
    <G as Directed<'a>>::IncidentIt: UnwindSafe,
    <G as GraphType<'a>>::Node: UnwindSafe

Blanket Implementations

impl<T> Any for T where
    T: 'static + ?Sized
[src]

pub fn type_id(&self) -> TypeId[src]

Gets the TypeId of self. Read more

impl<T> Borrow<T> for T where
    T: ?Sized
[src]

pub fn borrow(&self) -> &T[src]

Immutably borrows from an owned value. Read more

impl<T> BorrowMut<T> for T where
    T: ?Sized
[src]

pub fn borrow_mut(&mut self) -> &mut T[src]

Mutably borrows from an owned value. Read more

impl<T> From<T> for T[src]

pub fn from(t: T) -> T[src]

Performs the conversion.

impl<T, U> Into<U> for T where
    U: From<T>, 
[src]

pub fn into(self) -> U[src]

Performs the conversion.

impl<T, U> TryFrom<U> for T where
    U: Into<T>, 
[src]

type Error = Infallible

The type returned in the event of a conversion error.

pub fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>[src]

Performs the conversion.

impl<T, U> TryInto<U> for T where
    U: TryFrom<T>, 
[src]

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.

pub fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>[src]

Performs the conversion.