## Abstract

We study popular matchings in the many-to-many matching problem, which is given by a graph \(G = (V,E)\) and, for every agent \(u\in V\), a capacity \(\textsf {cap}(u) \ge 1\) and a preference list strictly ranking her neighbors. A matching in *G* is popular if it weakly beats every matching in a majority vote when agents cast votes for one matching versus the other according to their preferences. First, we show that when \(G = (A\cup B,E)\) is bipartite, e.g., when matching students to courses, every pairwise stable matching is popular. In particular, popular matchings are guaranteed to exist. Our main contribution is to show that a max-size popular matching in *G* can be computed in linear time by the *2-level Gale–Shapley* algorithm, which is an extension of the classical Gale–Shapley algorithm. We prove its correctness via linear programming. Second, we consider the problem of computing a max-size popular matching in \(G = (V,E)\) (not necessarily bipartite) when every agent has capacity 1, e.g., when matching students to dorm rooms. We show that even when *G* admits a stable matching, this problem is \(\mathsf {NP}\)-hard, which is in contrast to the tractability result in bipartite graphs.

## Keywords

Matchings under preferences Gale–Shapley algorithm Linear programming duality NP-hardness## Notes

### Acknowledgements

We thank the reviewers for their helpful comments. The first author wishes to thank Larry Samuelson for comments on the motivation for popular matchings. The second author wishes to thank David Manlove and Bruno Escoffier for asking her about popular matchings in the hospitals/residents setting.

## References

- 1.Abraham, D.J., Irving, R.W., Kavitha, T., Mehlhorn, K.: Popular matchings. SIAM J. Comput.
**37**(4), 1030–1045 (2007)MathSciNetCrossRefzbMATHGoogle Scholar - 2.Askalidis, G., Immorlica, N., Kwanashie, A., Manlove, D., Pountourakis, E.: Socially Stable matchings in the hospitals/residents problem. In: the 13th International Symposium on Algorithms and Data Structures (WADS), pp. 85–96 (2013)Google Scholar
- 3.Blair, C.: The lattice structure of the set of stable matchings with multiple partners. Math. Oper. Res.
**13**, 619–628 (1988)MathSciNetCrossRefzbMATHGoogle Scholar - 4.Biro, P., Irving, R.W., Manlove, D.F.: Popular matchings in the marriage and roommates problems. In: the 7th International Conference in Algorithms and Complexity (CIAC), pp. 97–108 (2010)Google Scholar
- 5.Brandl, F., Kavitha, T.: Popular matchings with multiple partners. In: the 37th Foundations of Software Technology and Theoretical Computer Science (FSTTCS) (2017)Google Scholar
- 6.Canadian Resident Matching Service. How the matching algorithm works. Web document available at http://carms.ca/algorithm.htm
- 7.Condorcet, J.A.N.C.: Essai sur l’application de l’analyse à la probabilité des décisions rendues à la pluralité des voix. Imprimerie Royale, Paris (1785)Google Scholar
- 8.Cseh, Á.: Popular matchings. In: Trends in Computational Social Choice, Edited by Ulle Endriss, COST (European Cooperation in Science and Technology), pp. 105–122 (2017)Google Scholar
- 9.Cseh, Á., Huang, C.-C., Kavitha, T.: Popular matchings with two-sided preferences and one-sided ties. In: the 42nd International Colloquium on Automata, Languages, and Programming (ICALP): Part I, pp. 367–379 (2015)Google Scholar
- 10.Cseh, Á., Kavitha, T.: Popular edges and dominant matchings. In: the 18th International Conference on Integer Programming and Combinatorial Optimization (IPCO), pp. 138–151 (2016)Google Scholar
- 11.Faenza, Y., Kavitha, T., Powers, V., Zhang, X.: Popular matchings and limits to tractability. In: The Conference is the 30th Annual ACM-SIAM Symposium on Discrete Algorithms, SODA 2019, pp. 2790–2809 (2019)Google Scholar
- 12.Gale, D., Shapley, L.S.: College admissions and the stability of marriage. Am. Math. Month.
**69**(1), 9–15 (1962)MathSciNetCrossRefzbMATHGoogle Scholar - 13.Gale, D., Sotomayor, M.: Some remarks on the stable matching problem. Discrete Appl. Math.
**11**(3), 223–232 (1985)MathSciNetCrossRefzbMATHGoogle Scholar - 14.Gärdenfors, P.: Match making: assignments based on bilateral preferences. Behav. Sci.
**20**(3), 166–173 (1975)CrossRefGoogle Scholar - 15.Gupta, S., Misra, P., Saurabh, S., Zehavi, M.: Popular matching in roommates setting is NP-hard. The Conference is the 30th Annual ACM-SIAM Symposium on Discrete Algorithms, SODA 2019, pp. 2810–2822 (2019)Google Scholar
- 16.Gusfield, D., Irving, R.W.: The Stable Marriage Problem: Structure and Algorithms. MIT Press, Boston (1989)zbMATHGoogle Scholar
- 17.Hamada, K., Iwama, K., Miyazaki, S.: The hospitals/residents problem with lower quotas. Algorithmica
**74**(1), 440–465 (2016)MathSciNetCrossRefzbMATHGoogle Scholar - 18.Hirakawa, M., Yamauchi, Y., Kijima, S., Yamashita, M.: On the structure of popular matchings in the stable marriage problem—who can join a popular matching? In: The 3rd International Workshop on Matching Under Preferences (MATCH-UP) (2015)Google Scholar
- 19.Huang, C.-C.: Classified stable matching. In: the 21st Annual ACM-SIAM Symposium on Discrete Algorithms (SODA), pp. 1235–1253 (2010)Google Scholar
- 20.Huang, C.-C., Kavitha, T.: Popular matchings in the stable marriage problem. Inf. Comput.
**222**, 180–194 (2013)MathSciNetCrossRefzbMATHGoogle Scholar - 21.Huang, C.-C., Kavitha, T.: Popularity, self-duality, and mixed matchings. In: the 28th Annual ACM-SIAM Symposium on Discrete Algorithms (SODA), pp. 2294–2310 (2017)Google Scholar
- 22.Irving, R.W.: An efficient algorithm for the stable roommates problem. J. Algorithms
**6**, 577–595 (1985)MathSciNetCrossRefzbMATHGoogle Scholar - 23.Irving, R.W., Manlove, D.F., Scott, S.: The hospitals/residents problem with ties. In: the 7th Scandinavian Workshop on Algorithm Theory (SWAT), pp. 259–271 (2000)Google Scholar
- 24.Irving, R.W., Manlove, D.F., Scott, S.: Strong stability in the hospitals/residents problem. In the 20th Annual Symposium on Theoretical Aspects of Computer Science (STACS), pp. 439–450 (2003)Google Scholar
- 25.Kavitha, T.: A size-popularity tradeoff in the stable marriage problem. SIAM J. Comput.
**43**(1), 52–71 (2014)MathSciNetCrossRefzbMATHGoogle Scholar - 26.Kavitha, T.: Popular half-integral matchings. In: the 43rd International Colloquium on Automata, Languages, and Programming (ICALP), pp. 22.1–22.13 (2016)Google Scholar
- 27.Kavitha, T.: Max-size popular matchings and extensions. http://arxiv.org/pdf/1802.07440.pdf
- 28.Kavitha, T., Mestre, J., Nasre, M.: Popular mixed matchings. Theor. Comput. Sci.
**412**(24), 2679–2690 (2011)MathSciNetCrossRefzbMATHGoogle Scholar - 29.Király, T., Mészáros-Karkus, Zs: Finding strongly popular b-matchings in bipartite graphs. Electron. Notes Discrete Math.
**61**, 735–741 (2017)CrossRefzbMATHGoogle Scholar - 30.Manlove, D.F.: Algorithmics of Matching Under Preferences. World Scientific Publishing Company Incorporated, Singapore (2013)CrossRefzbMATHGoogle Scholar
- 31.Manlove, D.F.: The Hospitals/Residents Problem. Encyclopedia of Algorithms, pp. 926–930. Springer, Berlin (2015)Google Scholar
- 32.Nasre, M., Rawat, A.: Popularity in the generalized hospital residents setting. In: the 12th International Computer Science Symposium in Russia (CSR), pp. 245–259 (2017)Google Scholar
- 33.National Resident Matching Program. Why the Match? Web document available at http://www.nrmp.org/whythematch.pdf
- 34.Roth, A.E.: The evolution of the labor market for medical interns and residents: a case study in game theory. J. Polit. Econ.
**92**(6), 991–1016 (1984)CrossRefGoogle Scholar - 35.Roth, A.E.: Stability and polarization of interest in job matching. Econometrica
**53**, 47–57 (1984)CrossRefzbMATHGoogle Scholar - 36.Roth, A.E.: On the allocation of residents to rural hospitals: a general property of two-sided matching markets. Econometrica
**54**(2), 425–427 (1986)MathSciNetCrossRefGoogle Scholar - 37.Sotomayor, M.: Three remarks on the many-to-many stable matching problem. Math. Soc. Sci.
**38**, 55–70 (1999)CrossRefzbMATHGoogle Scholar - 38.Subramanian, A.: A new approach to stable matching problems. SIAM J. Comput.
**23**(4), 671–700 (1994)MathSciNetCrossRefzbMATHGoogle Scholar - 39.Teo, C.-P., Sethuraman, J.: The geometry of fractional stable matchings and its applications. Math. Oper. Res.
**23**(4), 874–891 (1998)MathSciNetCrossRefzbMATHGoogle Scholar