Data Structures & AlgorithmsHardICPC regional · matching theory

Problem: Which statement about Hall's theorem for a bipartite graph with sides L and R is correct?

  1. A. A matching exists iff the graph is connected
  2. B. A matching saturating L exists iff |L| = |R|
  3. C. Every bipartite graph with equal sides has a perfect matching of size |R| + 1
  4. D. A matching saturating L exists iff every subset S of L has at least |S| neighbours in R

Correct answer: D. A matching saturating L exists iff every subset S of L has at least |S| neighbours in R

Hall's condition on neighbourhoods is necessary and sufficient for matching every vertex of L. Equal side sizes alone do not guarantee a perfect matching.

More Coding Interview Problems questions

Exams that ask this topic