Skip to content

@graphty/algorithms / index / fordFulkerson

Function: fordFulkerson() ​

fordFulkerson(graph, source, sink): MaxFlowResult

Defined in: flow/ford-fulkerson.ts:394

Ford-Fulkerson algorithm using DFS for finding augmenting paths

Parameters ​

graph ​

Graph

Adjacency list representation with capacities - accepts Graph class or Map

source ​

string

Source node

sink ​

string

Sink node

Returns ​

MaxFlowResult

Maximum flow value and flow graph

Time Complexity: O(E * f) where f is the maximum flow Space Complexity: O(V + E)