Skip to main content

maximum_flow

Function maximum_flow 

Source
pub fn maximum_flow<G, F>(
    graph: &G,
    source: G::Node,
    sink: G::Node,
    edge_capacity: F,
) -> Result<Option<MaxFlow<G::Node, G::Edge>>>
where G: IndexGraphView, F: FnMut(G::Edge) -> u64,
Expand description

Computes a directed maximum flow with Dinic’s blocking-flow algorithm.

The returned source-side residual partition also describes a minimum cut.

§Errors

Returns an error if the total flow is larger than u64::MAX.