Skip to content

@graphty/algorithms / index / edmondsKarp

Function: edmondsKarp() ​

edmondsKarp(graph, source, sink): MaxFlowResult

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

Edmonds-Karp algorithm (Ford-Fulkerson with BFS) More efficient implementation with better time complexity

Parameters ​

graph ​

Adjacency list representation with capacities - accepts Graph class or Map

Graph | Map<string, Map<string, number>>

source ​

string

Source node

sink ​

string

Sink node

Returns ​

MaxFlowResult

Maximum flow value and flow graph

Time Complexity: O(V * E²)