Function rs_graph::maxflow::pushrelabel::pushrelabel
source · pub fn pushrelabel<'a, G, F, Us>(
g: &'a G,
src: G::Node<'_>,
snk: G::Node<'_>,
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 push-relabel algorithm.
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.