Data Structures & AlgorithmsHardGATE CS · ICPC regional

A bipartite graph has left side P1, P2, P3, P4 and right side Q1, Q2, Q3, with edges P4–Q2, P3–Q3, P4–Q3, P1–Q3, P2–Q1, P4–Q1. What is the size of a maximum matching (the largest set of edges with no shared endpoint)?

  1. A. 6
  2. B. 2
  3. C. 3
  4. D. 4

Correct answer: C. 3

Augmenting paths (Kuhn's algorithm) reach a matching of size 3. Greedy matching that takes the first free neighbour for each left vertex gets 3, and the smaller side only bounds the matching at 3.

More Trees, Graphs, Recursion and Dynamic Programming questions

Exams that ask this topic