GATE Computer ScienceVery hardGATE CS (PYQ pattern)

A directed graph has edges 0→1 (3), 1→2 (2), 2→0 (4), 1→3 (1), 3→4 (5), 4→1 (−1), 2→4 (6), 4→0 (2), 3→0 (1). What is the minimum mean weight over all directed cycles?

  1. A. 3/2
  2. B. 2
  3. C. 5/3
  4. D. 7/3

Correct answer: C. 5/3

Enumerating simple cycles (the minimum mean cycle is always simple): 0→1→3→0 has weight 5 over 3 edges, and 1→3→4→1 also has 5 over 3 edges, giving 5/3; no cycle is cheaper (for example 0→1→2→0 has mean 3). Karp's algorithm computes it in O(VE).

More Algorithms questions

Exams that ask this topic