Basic Edmonds-Karp algorithm. Needs further testing.