A Collection of Constraint Programming Models for the Three-Dimensional Stable Matching Problem with Cyclic Preferences

Authors Ágnes Cseh , Guillaume Escamocher , Begüm Genç , Luis Quesada

Thumbnail PDF


  • Filesize: 1.05 MB
  • 19 pages

Document Identifiers

Author Details

Ágnes Cseh
  • Hasso-Plattner-Institute, Universität Potsdam, Germany
  • Institute of Economics, Centre for Economic and Regional Studies, Pécs, Hungary
Guillaume Escamocher
  • Insight Centre for Data Analytics, School of Computer Science and Information Technology, University College Cork, Ireland
Begüm Genç
  • Insight Centre for Data Analytics, School of Computer Science and Information Technology, University College Cork, Ireland
Luis Quesada
  • Insight Centre for Data Analytics, School of Computer Science and Information Technology, University College Cork, Ireland


COST Action CA16228 European Network for Game Theory.

Cite AsGet BibTex

Ágnes Cseh, Guillaume Escamocher, Begüm Genç, and Luis Quesada. A Collection of Constraint Programming Models for the Three-Dimensional Stable Matching Problem with Cyclic Preferences. In 27th International Conference on Principles and Practice of Constraint Programming (CP 2021). Leibniz International Proceedings in Informatics (LIPIcs), Volume 210, pp. 22:1-22:19, Schloss Dagstuhl – Leibniz-Zentrum für Informatik (2021)


We introduce five constraint models for the 3-dimensional stable matching problem with cyclic preferences and study their relative performances under diverse configurations. While several constraint models have been proposed for variants of the two-dimensional stable matching problem, we are the first to present constraint models for a higher number of dimensions. We show for all five models how to capture two different stability notions, namely weak and strong stability. Additionally, we translate some well-known fairness notions (i.e. sex-equal, minimum regret, egalitarian) into 3-dimensional matchings, and present how to capture them in each model. Our tests cover dozens of problem sizes and four different instance generation methods. We explore two levels of commitment in our models: one where we have an individual variable for each agent (individual commitment), and another one where the determination of a variable involves pairing the three agents at once (group commitment). Our experiments show that the suitability of the commitment depends on the type of stability we are dealing with. Our experiments not only led us to discover dependencies between the type of stability and the instance generation method, but also brought light to the role that learning and restarts can play in solving this kind of problems.

Subject Classification

ACM Subject Classification
  • Theory of computation → Constraint and logic programming
  • Theory of computation → Design and analysis of algorithms
  • Three-dimensional stable matching with cyclic preferences
  • 3DSM-cyc
  • Constraint Programming
  • fairness


  • Access Statistics
  • Total Accesses (updated on a weekly basis)
    PDF Downloads


  1. D. J. Abraham, A. Levavi, D. F. Manlove, and G. O'Malley. The stable roommates problem with globally-ranked pairs. Internet Mathematics, 5:493-515, 2008. Google Scholar
  2. Ahmet Alkan. Nonexistence of stable threesome matchings. Mathematical Social Sciences, 16(2):207-209, 1988. URL: https://www.sciencedirect.com/science/article/pii/0165489688900534.
  3. Michel Balinski and Tayfun Sönmez. A tale of two mechanisms: Student placement. Journal of Economic Theory, 84(1):73-94, 1999. URL: https://www.sciencedirect.com/science/article/pii/S0022053198924693.
  4. Péter Biró, Robert W Irving, and Ildikó Schlotter. Stable matching with couples: An empirical study. Journal of Experimental Algorithmics (JEA), 16:Article no. 1.2, 2011. Google Scholar
  5. Péter Biró and Eric McDermid. Three-sided stable matchings with cyclic preferences. Algorithmica, 58(1):5-18, 2010. URL: https://doi.org/10.1007/s00453-009-9315-2.
  6. Endre Boros, Vladimir Gurvich, Steven Jaslar, and Daniel Krasner. Stable matchings in three-sided systems with cyclic preferences. Discret. Math., 289(1-3):1-10, 2004. URL: https://doi.org/10.1016/j.disc.2004.08.012.
  7. Sebastian Braun, Nadja Dwenger, and Dorothea Kübler. Telling the truth may not pay off: An empirical study of centralized university admissions in Germany. The B.E. Journal of Economic Analysis and Policy, 10, article 22, 2010. Google Scholar
  8. Yan Chen and Tayfun Sönmez. Improving efficiency of on-campus housing: an experimental study. American Economic Review, 92:1669-1686, 2002. Google Scholar
  9. Geoffrey Chu. Improving combinatorial optimization. PhD thesis, University of Melbourne, Australia, 2011. URL: http://hdl.handle.net/11343/36679.
  10. Sofie De Clercq, Steven Schockaert, Martine De Cock, and Ann Nowé. Solving stable matching problems using answer set programming. Theory Pract. Log. Program., 16(3):247-268, 2016. URL: https://doi.org/10.1017/S147106841600003X.
  11. Lin Cui and Weijia Jia. Cyclic stable matching for three-sided networking services. Comput. Networks, 57(1):351-363, 2013. URL: https://doi.org/10.1016/j.comnet.2012.09.021.
  12. Vladimir I. Danilov. Existence of stable matchings in some three-sided systems. Math. Soc. Sci., 46(2):145-148, 2003. URL: https://doi.org/10.1016/S0165-4896(03)00073-8.
  13. Joanna Drummond, Andrew Perrault, and Fahiem Bacchus. SAT is an effective and complete method for solving stable matching problems with couples. In Proceedings of the Twenty-Fourth International Joint Conference on Artificial Intelligence, IJCAI 2015, Buenos Aires, Argentina, July 25-31, 2015, pages 518-525. AAAI Press, 2015. URL: http://ijcai.org/Abstract/15/079.
  14. Pavlos Eirinakis, Dimitris Magos, Ioannis Mourtos, and Panayiotis Miliotis. Finding all stable pairs and solutions to the many-to-many stable matching problem. INFORMS J. Comput., 24(2):245-259, 2012. URL: https://doi.org/10.1287/ijoc.1110.0449.
  15. Kimmo Eriksson, Jonas Sjöstrand, and Pontus Strimling. Three-dimensional stable matching with cyclic preferences. Math. Soc. Sci., 52(1):77-87, 2006. URL: https://doi.org/10.1016/j.mathsocsci.2006.03.005.
  16. Guillaume Escamocher and Barry O'Sullivan. Three-dimensional matching instances are rich in stable matchings. In Integration of Constraint Programming, Artificial Intelligence, and Operations Research - 15th International Conference, CPAIOR 2018, Delft, The Netherlands, June 26-29, 2018, Proceedings, volume 10848, pages 182-197. Springer, 2018. URL: https://doi.org/10.1007/978-3-319-93031-2_13.
  17. Tomás Feder. A new fixed point approach for stable networks and stable marriages. J. Comput. Syst. Sci., 45(2):233-284, 1992. URL: https://doi.org/10.1016/0022-0000(92)90048-N.
  18. Tomás Feder. Network flow and 2-satisfiability. Algorithmica, 11(3):291-319, 1994. URL: https://doi.org/10.1007/BF01240738.
  19. Anh-Tuan Gai, Dmitry Lebedev, Fabien Mathieu, Fabien de Montgolfier, Julien Reynier, and Laurent Viennot. Acyclic preference systems in P2P networks. In Euro-Par 2007, Parallel Processing, 13th International Euro-Par Conference, Rennes, France, August 28-31, 2007, Proceedings, volume 4641, pages 825-834. Springer, 2007. URL: https://doi.org/10.1007/978-3-540-74466-5_88.
  20. D. Gale and L. S. Shapley. College admissions and the stability of marriage. Am. Math. Mon., 120(5):386-391, 2013. URL: https://doi.org/10.4169/amer.math.monthly.120.05.386.
  21. Gecode Team. Gecode: Generic constraint development environment, 2019. Available from http://www.gecode.org. Google Scholar
  22. Ian P. Gent, Robert W. Irving, David F. Manlove, Patrick Prosser, and Barbara M. Smith. A constraint programming approach to the stable marriage problem. In Principles and Practice of Constraint Programming - CP 2001, 7th International Conference, CP 2001, Paphos, Cyprus, November 26 - December 1, 2001, Proceedings, volume 2239, pages 225-239. Springer, 2001. URL: https://doi.org/10.1007/3-540-45578-7_16.
  23. Dan Gusfield. Three fast algorithms for four problems in stable marriage. SIAM J. Comput., 16(1):111-128, 1987. URL: https://doi.org/10.1137/0216010.
  24. Dan Gusfield and Robert W. Irving. The Stable marriage problem - structure and algorithms. MIT Press, 1989. Google Scholar
  25. Magnús M. Halldórsson, Robert W. Irving, Kazuo Iwama, David F. Manlove, Shuichi Miyazaki, Yasufumi Morita, and Sandy Scott. Approximability results for stable marriage problems with ties. Theor. Comput. Sci., 306(1-3):431-447, 2003. URL: https://doi.org/10.1016/S0304-3975(03)00321-9.
  26. Chien-Chung Huang. Two’s company, three’s a crowd: Stable family and threesome roommates problems. In Algorithms - ESA 2007, 15th Annual European Symposium, Eilat, Israel, October 8-10, 2007, Proceedings, volume 4698, pages 558-569. Springer, 2007. URL: https://doi.org/10.1007/978-3-540-75520-3_50.
  27. Robert W. Irving. An efficient algorithm for the "stable roommates" problem. J. Algorithms, 6(4):577-595, 1985. URL: https://doi.org/10.1016/0196-6774(85)90033-1.
  28. Robert W. Irving, Paul Leather, and Dan Gusfield. An efficient algorithm for the "optimal" stable marriage. J. ACM, 34(3):532-543, 1987. URL: https://doi.org/10.1145/28869.28871.
  29. Kazuo Iwama and Shuichi Miyazaki. A survey of the stable marriage problem and its variants. In International Conference on Informatics Education and Research for Knowledge-Circulating Society (ICKS 2008), pages 131-136, 2008. Google Scholar
  30. Akiko Kato. Complexity of the sex-equal stable marriage problem. Japan Journal of Industrial and Applied Mathematics, 10:1-19, 1993. Google Scholar
  31. Donald E. Knuth. Mariages Stables. Les Presses de L'Université de Montréal, 1976. English translation in Stable Marriage and its Relation to Other Combinatorial Problems, volume 10 of CRM Proceedings and Lecture Notes, American Mathematical Society, 1997. Google Scholar
  32. Chi-Kit Lam and C. Gregory Plaxton. On the existence of three-dimensional stable matchings with cyclic preferences. In Algorithmic Game Theory - 12th International Symposium, SAGT 2019, Athens, Greece, September 30 - October 3, 2019, Proceedings, volume 11801, pages 329-342. Springer, 2019. URL: https://doi.org/10.1007/978-3-030-30473-7_22.
  33. David F. Manlove. Algorithmics of Matching Under Preferences, volume 2. WorldScientific, 2013. URL: https://doi.org/10.1142/8591.
  34. David F. Manlove, Gregg O'Malley, Patrick Prosser, and Chris Unsworth. A constraint programming approach to the hospitals / residents problem. In Integration of AI and OR Techniques in Constraint Programming for Combinatorial Optimization Problems, 4th International Conference, CPAIOR 2007, Brussels, Belgium, May 23-26, 2007, Proceedings, volume 4510, pages 155-170. Springer, 2007. URL: https://doi.org/10.1007/978-3-540-72397-4_12.
  35. Eric McDermid and Robert W Irving. Sex-equal stable matchings: Complexity and exact algorithms. Algorithmica, 68(3):545-570, 2014. Google Scholar
  36. Robert Mcgill, John W. Tukey, and Wayne A. Larsen. Variations of box plots. The American Statistician, 32(1):12-16, 1978. URL: https://doi.org/10.1080/00031305.1978.10479236.
  37. Nicholas Nethercote, Peter J. Stuckey, Ralph Becket, Sebastian Brand, Gregory J. Duck, and Guido Tack. Minizinc: Towards a standard CP modelling language. In Principles and Practice of Constraint Programming - CP 2007, 13th International Conference, CP 2007, Providence, RI, USA, September 23-27, 2007, Proceedings, volume 4741, pages 529-543. Springer, 2007. URL: https://doi.org/10.1007/978-3-540-74970-7_38.
  38. Cheng Ng and Daniel S. Hirschberg. Three-dimensional stable matching problems. SIAM J. Discrete Math., 4(2):245-252, 1991. URL: https://doi.org/10.1137/0404023.
  39. Gregg O'Malley. Algorithmic aspects of stable matching problems. PhD thesis, University of Glasgow, UK, 2007. URL: http://theses.gla.ac.uk/64/.
  40. Nikita Panchal and Seema Sharma. An efficient algorithm for three dimensional cyclic stable matching. International Journal of Engineering Research and Technology, 3(4), 2014. Google Scholar
  41. Kanstantsin Pashkovich and Laurent Poirrier. Three-dimensional stable matching with cyclic preferences. Optim. Lett., 14(8):2615-2623, 2020. URL: https://doi.org/10.1007/s11590-020-01557-4.
  42. Nitsan Perach, Julia Polak, and Uriel G. Rothblum. A stable matching model with an entrance criterion applied to the assignment of students to dormitories at the Technion. Int. J. Game Theory, 36(3-4):519-535, 2008. URL: https://doi.org/10.1007/s00182-007-0083-4.
  43. Neetu Raveendran, Yiyong Zha, Yunfei Zhang, Xin Liu, and Zhu Han. Virtual core network resource allocation in 5G systems using three-sided matching. In ICC 2019-2019 IEEE International Conference on Communications (ICC), pages 1-6. IEEE, 2019. Google Scholar
  44. Alvin E. Roth and Marilda A. Oliveira Sotomayor. Two-Sided Matching: A Study in Game-Theoretic Modeling and Analysis. Cambridge University Press, 1990. URL: https://doi.org/10.1017/CCOL052139015X.
  45. Mohamed Siala and Barry O’Sullivan. Revisiting two-sided stability constraints. In International Conference on AI and OR Techniques in Constraint Programming for Combinatorial Optimization Problems, pages 342-357. Springer, 2016. Google Scholar
  46. Mohamed Siala and Barry O’Sullivan. Rotation-based formulation for stable matching. In International Conference on Principles and Practice of Constraint Programming, pages 262-277. Springer, 2017. Google Scholar
  47. Ashok Subramanian. A new approach to stable matching problems. SIAM J. Comput., 23(4):671-700, 1994. URL: https://doi.org/10.1137/S0097539789169483.
  48. Chris Unsworth and Patrick Prosser. A specialised binary constraint for the stable marriage problem. In Abstraction, Reformulation and Approximation, 6th International Symposium, SARA 2005, Airth Castle, Scotland, UK, July 26-29, 2005, Proceedings, volume 3607, pages 218-233. Springer, 2005. URL: https://doi.org/10.1007/11527862_16.
  49. Chris Unsworth and Patrick Prosser. An n-ary constraint for the stable marriage problem. CoRR, abs/1308.0183, 2013. URL: http://arxiv.org/abs/1308.0183.
  50. Gerhard J. Woeginger. Core stability in hedonic coalition formation. In Proceedings of SOFSEM 2013, 39th International Conference on Current Trends in Theory and Practice of Computer Science, volume 7741, pages 33-50. Springer, 2013. URL: https://doi.org/10.1007/978-3-642-35843-2_4.