Data Structures & AlgorithmsVery hardICPC regional · flow algorithms

Problem: Which statement about the Edmonds-Karp maximum-flow algorithm (BFS augmenting paths) is correct?

  1. A. It runs in O(V E^2) because each augmenting path is shortest in edges, bounding the number of augmentations
  2. B. It runs in O(E) regardless of capacities
  3. C. It is exponential when capacities are integers
  4. D. It always finds a minimum-cost flow

Correct answer: A. It runs in O(V E^2) because each augmenting path is shortest in edges, bounding the number of augmentations

Choosing shortest augmenting paths guarantees that each edge becomes critical O(V) times, which gives O(V E^2) overall. The statement about minimum-cost flow describes a different algorithm.

More Coding Interview Problems questions

Exams that ask this topic