Skip to main content

max_flow

Function max_flow 

Source
pub fn max_flow(
    store: &LpgStore,
    source: NodeId,
    sink: NodeId,
    capacity_property: Option<&str>,
) -> Option<MaxFlowResult>
Expand description

Computes maximum flow using the Edmonds-Karp algorithm.

Edmonds-Karp is a specific implementation of Ford-Fulkerson that uses BFS to find augmenting paths, guaranteeing O(VE²) complexity.

§Arguments

  • store - The graph store
  • source - Source node ID
  • sink - Sink node ID
  • capacity_property - Optional property name for edge capacities (defaults to 1.0)

§Returns

Maximum flow value and flow assignment on edges.

§Complexity

O(V × E²)