Function rs_graph::maxflow::edmondskarp::edmondskarp
source · pub fn edmondskarp<'a, G, F, Us>(
g: &'a G,
src: G::Node<'a>,
snk: G::Node<'a>,
upper: Us
) -> (F, Vec<(G::Edge<'a>, F)>, Vec<G::Node<'a>>)where
G: IndexDigraph,
F: 'a + NumAssign + Ord + Copy,
Us: Fn(G::Edge<'_>) -> F,
Expand description
Solve the maxflow problem using the algorithm of Edmonds-Karp.
The function solves the max flow problem from the source nodes
src
to the sink node snk
with the given upper
bounds on
the edges.
The function returns the flow value, the flow on each edge and the nodes in a minimal cut.