Function rs_graph::mcf::simplex::network_simplex
source · pub fn network_simplex<G, F, Bs, Ls, Us, Cs>(
g: &G,
balances: Bs,
lower: Ls,
upper: Us,
costs: Cs
) -> Option<(F, Vec<(G::Edge<'_>, F)>)>where
G: IndexDigraph,
F: NumAssign + NumCast + FromPrimitive + Ord + Signed + Bounded + Copy,
Bs: Fn(G::Node<'_>) -> F,
Ls: Fn(G::Edge<'_>) -> F,
Us: Fn(G::Edge<'_>) -> F,
Cs: Fn(G::Edge<'_>) -> F,
Expand description
Solve a min-cost-flow problem with a network simplex algorithm.
The function returns the objective value and the optimal flow.