Skip to main content

transshipment

Function transshipment 

Source
pub fn transshipment(
    supply: &[f64],
    arcs: &[(usize, usize, f64, f64)],
) -> Result<LpResult, GeomError>
Expand description

The transshipment problem: ship from sources to sinks through intermediate nodes at least cost.

supply[i] is positive at a source, negative at a sink, and zero at a pure transshipment node; the entries must sum to zero. arcs lists (from, to, unit cost, capacity).

Generalises the transportation problem by allowing goods to pass through a node rather than only from a source directly to a sink, which is what makes it a network rather than a bipartite matching.

§Errors

Returns an error if an arc names a node out of range or the supplies do not balance.