Ford–Fulkerson

Find how much water can reach a tank from a pump each minute through all the pipes together. Each pipe has a limit, so it can help to send some water another way.

Find a route by depth-first search. Its narrowest pipe limits the increase. A reverse arrow lets us cancel earlier flow.

For integer capacities and maximum flow F, time is O((V + E)(F + 1) + V²).