# Edmonds-Karp Algorithm
**A complete implementation of the [[Ford-Fulkerson algorithm]].**
The *Edmonds-Karp algorithm* fully implements the Ford-Fulkerson algorithm by specifying the search order of [[Flow Network#Augmenting path|augmenting paths]] as the order of shortest paths with available capacity first. Typically, the shortest paths are found using [[breadth-first search]] on the network with all edges weighted as $1$.
The *worst-case time complexity* is $O(VE^2)$ which is defined from requiring $O(E)$ time to find each augmenting path, of which there are $O(VE)$.
> [!Example]+
> ![[Edmonds-KarpExample1.svg|450]]
> ***
> ![[Edmonds-KarpExample2.svg|450]]
> ***
> ![[Edmonds-KarpExample3.svg|450]]
> ***
> ![[Edmonds-KarpExample4.svg|450]]
> *The Edmonds-Karp algorithm running on a flow network; each iteration is the result of flow augmentation with the augmenting path (red) of the previous flow, updating some of the flow (yellow)*