Skip to main content

Stable Roommates and Constraint Programming

  • Conference paper
Integration of AI and OR Techniques in Constraint Programming (CPAIOR 2014)

Abstract

In the stable roommates (SR) problem we have n agents, where each agent ranks all n − 1 other agents. The problem is then to match agents into pairs such that no two agents prefer each other to their matched partners. A remarkably simple constraint encoding is presented that uses O(n 2) binary constraints, and in which arc-consistency (the phase-1 table) is established in O(n 3) time. This leads us to a specialized n-ary constraint that uses O(n) additional space and establishes arc-consistency in O(n 2) time. This can model stable roommates with incomplete lists (SRI), consequently it can also model stable marriage (SM) problems with complete and incomplete lists (SMI). That is, one model suffices. An empirical study is performed and it is observed that the n-ary constraint model can read in, model and output all matchings for instances with n = 1,000 in about 2 seconds on current hardware platforms. Enumerating all matchings is a crude solution to the egalitarian SR problem, and the empirical results suggest that although NP-hard, egalitarian SR is practically easy.

This is a preview of subscription content, log in via an institution to check access.

Access this chapter

Chapter
USD 29.95
Price excludes VAT (USA)
  • Available as PDF
  • Read on any device
  • Instant download
  • Own it forever
eBook
USD 39.99
Price excludes VAT (USA)
  • Available as PDF
  • Read on any device
  • Instant download
  • Own it forever
Softcover Book
USD 54.99
Price excludes VAT (USA)
  • Compact, lightweight edition
  • Dispatched in 3 to 5 business days
  • Free shipping worldwide - see info

Tax calculation will be finalised at checkout

Purchases are for personal use only

Institutional subscriptions

Preview

Unable to display preview. Download preview PDF.

Unable to display preview. Download preview PDF.

References

  1. choco constraint programming system, http://choco.sourceforge.net/

  2. Stable Roommates, http://www.dcs.gla.ac.uk/~pat/roommates/distribution

  3. Cheeseman, P., Kanefsky, B., Taylor, W.M.: Where the really hard problems are, pp. 331–337. Morgan Kaufmann (1991)

    Google Scholar 

  4. Gale, D., Shapley, L.S.: College admissions and the stability of marriage. American Mathematical Monthly 69, 9–15 (1962)

    Article  MathSciNet  Google Scholar 

  5. Gale, D., Sotomayor, M.: Some remarks on the stable matching problem. Discrete Applied Mathematics 11, 223–232 (1985)

    Article  MathSciNet  Google Scholar 

  6. Gent, I.P., Irving, R.W., Manlove, D.F., Prosser, P., Smith, B.M.: A constraint programming approach to the stable marriage problem. In: Walsh, T. (ed.) CP 2001. LNCS, vol. 2239, pp. 225–239. Springer, Heidelberg (2001)

    Chapter  Google Scholar 

  7. Gusfield, D., Irving, R.W.: The Stable Marriage Problem: Structure and Algorithms. The MIT Press (1989)

    Google Scholar 

  8. Irving, R.W.: An efficient algorithm for the “stable roommates” problem. J. Algorithms 6(4), 577–595 (1985)

    Article  MathSciNet  Google Scholar 

  9. Irving, R.W.: Optimal Stable Marriage. In: Encyclopedia of Algorithms. Springer (2008)

    Google Scholar 

  10. Mackworth, A.K.: Consistency in networks of relations. Artificial Intelligence 8, 99–118 (1977)

    Article  Google Scholar 

  11. Manlove, D.: Algorithmics of Matching under Preferences. Theoretical Computer Science, vol. 2. World Scientific (2013)

    Google Scholar 

  12. Manlove, D.F., O’Malley, G.: Modelling and solving the stable marriage problem using constraint programming. In: Proceedings of the Fifth Workshop on Modelling and Solving Problems with Constraints, held at the 19th International Joint Conference on Artificial Intelligence (IJCAI 2005), pp. 10–17 (2005)

    Google Scholar 

  13. Mertens, S.: Random stable matchings. In: Journal of Statistical Mechanics: Theory and Experiments (2005)

    Google Scholar 

  14. Pittel, B., Irving, R.W.: An upper bound for the solvability of a random stable roommates instance. Random Struct. Algorithms 5(3), 465–487 (1994)

    Article  MathSciNet  Google Scholar 

  15. Roth, A.E.: The evolution of the labor market for medical interns and residents: a case study in game theory. Journal of Political Economy 92(6), 991–1016 (1984)

    Article  Google Scholar 

  16. Roth, A.E., Sotomayor, M.A.O.: Two-sided matching: a study in game-theoretic modeling and analysis. Econometric Society Monographs, vol. 18. Cambridge University Press (1990)

    Google Scholar 

  17. Unsworth, C., Prosser, P.: An n-ary constraint for the stable marriage problem. In: Proceedings of the Fifth Workshop on Modelling and Solving Problems with Constraints, held at the 19th International Joint Conference on Artificial Intelligence (IJCAI 2005) (2005)

    Google Scholar 

  18. Unsworth, C., Prosser, P.: A specialised binary constraint for the stable marriage problem. In: Zucker, J.-D., Saitta, L. (eds.) SARA 2005. LNCS (LNAI), vol. 3607, pp. 218–233. Springer, Heidelberg (2005)

    Chapter  Google Scholar 

  19. van Hentenryck, P., Deville, Y., Teng, C.-M.: A generic arc-consistency algorithm and its specializations. Artificial Intelligence 57, 291–321 (1992)

    Article  MathSciNet  Google Scholar 

Download references

Author information

Authors and Affiliations

Authors

Editor information

Editors and Affiliations

Rights and permissions

Reprints and permissions

Copyright information

© 2014 Springer International Publishing Switzerland

About this paper

Cite this paper

Prosser, P. (2014). Stable Roommates and Constraint Programming. In: Simonis, H. (eds) Integration of AI and OR Techniques in Constraint Programming. CPAIOR 2014. Lecture Notes in Computer Science, vol 8451. Springer, Cham. https://doi.org/10.1007/978-3-319-07046-9_2

Download citation

  • DOI: https://doi.org/10.1007/978-3-319-07046-9_2

  • Publisher Name: Springer, Cham

  • Print ISBN: 978-3-319-07045-2

  • Online ISBN: 978-3-319-07046-9

  • eBook Packages: Computer ScienceComputer Science (R0)

Publish with us

Policies and ethics