Trait rs_graph::maxflow::MaxFlow

source ·
pub trait MaxFlow<'a> {
    type Graph: IndexGraph<'a>;
    type Flow: Num + Ord;

    fn new(g: &'a Self::Graph) -> Self;
    fn as_graph(&self) -> &'a Self::Graph;
    fn value(&self) -> Self::Flow;
    fn flow(&self, a: <Self::Graph as Graph<'a>>::Edge) -> Self::Flow;
    fn solve<Us>(
        &mut self,
        src: <Self::Graph as Graph<'a>>::Node,
        snk: <Self::Graph as Graph<'a>>::Node,
        upper: Us
    )
    where
        Us: EdgeMap<'a, Self::Graph, Self::Flow>
; fn mincut(&self) -> Vec<<Self::Graph as Graph<'a>>::Node>; fn flow_vec(&self) -> IndexEdgeVec<'a, Self::Graph, Self::Flow> { ... } }
Expand description

Trait for max flow algorithms.

Required Associated Types

Type of the underlying graph.

Type of flows.

Required Methods

Create a new maxflow algorithm instance for a graph.

Return the underlying graph.

Return the value of the latest computed maximum flow.

The flow of an Edge.

Solve the maxflow problem.

The method solves the max flow problem from the source nodes src to the sink node snk with the given upper bounds on the edges.

Return the mincut associated with the current flow.

Provided Methods

The flow as vector.

Implementors