Data Structures & AlgorithmsVery hardICPC regional · flow

Problem: What is the complexity of the Edmonds-Karp algorithm in terms of V and E?

  1. A. O(E log V)
  2. B. O(V^3)
  3. C. O(V E^2)
  4. D. O(2^V)

Correct answer: C. O(V E^2)

The number of augmentations is O(V E) and each BFS is O(E), giving O(V E^2).

More Coding Interview Problems questions

Exams that ask this topic