The core of roommate problems: size and rank-fairness within matched pairs


This paper deals with roommate problems (Gale and Shapley, Am Math Mon 69(1):9–15, 1962) that are solvable, i.e., have a non-empty core (set of stable matchings). We study rank-fairness within pairs of stable matchings and the size of the core by means of maximal and average rank gaps. We provide upper bounds in terms of maximal and average disagreements in the agents’ rankings. Finally, we show that most of our bounds are tight.

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


  1. 1.

    More precisely (and without loss of generality), if the set of agents is \(N=\{1,\ldots ,n\}\), then agent i’s ranking is (from most to least preferred) \(1,2,\ldots ,i-1,i+1,\ldots ,n-1,n\) (being unmatched is the worst option).

  2. 2.

    Klaus and Klijn (2010) do make comparisons between all agents, but they only consider “weak rankings” that contain stable mates (i.e., partners obtained at stable matchings). More precisely, let S be a set of \(2k+1\) stable matchings. For each agent i consider the “weak ranking” that is obtained by restricting his original ranking to mates obtained in S and such that if he is matched to some agent j at exactly l stable matchings in S then j is listed l times. Then, assigning each agent to his \((k+1)\)-st (weakly) most preferred mate in the weak ranking constitutes a stable matching (Klaus and Klijn 2010, Theorem 2). Klaus and Klijn (2010, Corollary 1) deals with the case of a set with an even number of stable matchings.

  3. 3.

    Gale and Shapley (1962) exhibit an unsolvable roommate problem, i.e., a roommate problem in which there is no stable matching.

  4. 4.

    Irving (1985) presents an algorithm that either outputs a stable matching or “no” if none exists. Using Irving’s (1985) algorithm, Tan (1991, Theorem 6.7) provides a necessary and sufficient condition for the existence of a stable matching in roommate problems.

  5. 5.

    The maximum and the average are taken over all pairs of matched agents.

  6. 6.

    Note the difference between “average/maximal rank gap (between mates)” (studied in Sect. 3) and “average/maximal rank gap in the core” (studied in Sect. 4).

  7. 7.

    We refer to Demange and Wooders (2004) and Jackson (2008) for surveys on coalition and network formation.

  8. 8.

    For instance, unlike roommate problems, the core of any marriage problem is non-empty (Gale and Shapley 1962, Theorem 1) and is a distributive lattice (Roth and Sotomayor 1990, Theorems 2.16 and 3.8).

  9. 9.

    We refer to the books of Gusfield and Irving (1989) and Manlove (2013) and the review of Gudmundsson (2014) for comprehensive overviews of the literature on roommate problems.

  10. 10.

    For any real number x, \(\lfloor {x}\rfloor \) is the largest integer k with \(k\le x\). Recall that any stable matching contains exactly \(\lfloor {\frac{n}{2}}\rfloor \) pairs of agents (and additionally one “lone wolf” in the case of an odd number of agents).

  11. 11.

    For each \(n\in \{2,3\}\), for each solvable roommate problem r, and for each stable matching \(\mu \in S(r)\), \(\Gamma ^A(r,\mu )\, = \, {B^1(r)}\). For \(n=2\), there is a unique solvable roommate problem r and for its unique stable matching \(\mu \in S(r)\) we have \(\Gamma ^A(r,\mu )\, = \, {B^2(r)}\).

  12. 12.

    The first version of the decomposition lemma for marriage problems appears in Knuth (1976, page 29) and is attributed to J.H. Conway. See also Roth and Sotomayor (1990, Corollary 2.21).

  13. 13.

    Diamantoudi et al. (2004) prove the decomposition lemma for any number of agents and also for problems in which agents can be unacceptable to other agents.

  14. 14.

    Since the functions \(\mu ^B\) and \(\mu ^W\) are in general not matchings (Lemma 1), we can only apply the decomposition lemma as follows. Let \(i\in N\). Let \(\mu \) and \(\mu '\) be any stable matchings such that \(\mu (i)=\mu ^B(i)\) and \(\mu '(i)=\mu ^W(i)\). Since agent i prefers \(\mu ^B(i)\) to \(\mu ^W(i)\), it follows from the decomposition lemma that agent \(\mu ^W(i)\) prefers his mate at \(\mu '\) (which is i) to his mate at \(\mu \). Our Lemma 3 shows that in fact \(\mu ^W(i)\) prefers i to any other stable mate, i.e., not only the mates at the matchings in the set \(\{\mu : \mu \text{ is } \text{ stable } \text{ and } \mu (i)=\mu ^B(i)\}\).

  15. 15.

    The proof for odd n is as follows. Suppose that for some solvable roommate problem r, \(\Gamma ^M(r)>n-3\). Then, \(\Gamma ^M(r)=n-2\) and there exists an agent i such that \(r_i(\mu ^W(i))-r_i(\mu ^B(i))=n-2\). In particular, there exists a stable matching \(\mu \in S(r)\) such that \(r_i(\mu (i))=n-1\), i.e., i is matched to his least preferred agent. But then i together with the lone wolf block \(\mu \), which contradicts its stability.

  16. 16.

    One immediately verifies that for each solvable roommate problem r, \(B^4(r)\le B^3(r)\).

  17. 17.

    In other words, each man (woman) puts any other man (woman) below the outside option of being single.

  18. 18.

    Holzman and Samet (2014, p. 283) conjecture that the marriage counterpart of \(B^2\) can be reduced significantly.

  19. 19.

    We thank a reviewer for posing this question.


  1. Alcalde J (1994) Exchange-proofness or divorce-proofness? Stability in one-sided matching markets. Econ Design 1(1):275–287

    Article  Google Scholar 

  2. Bogomolnaia A, Jackson MO (2002) The stability of hedonic coalition structures. Games Econ Behav 38(2):201–230

    Article  Google Scholar 

  3. Chung K-S (2000) On the existence of stable roommate matchings. Games Econ Behav 33(2):206–230

    Article  Google Scholar 

  4. Demange G, Wooders M (2004) Group formation in economics: networks, clubs and coalitions. Cambridge University Press, Cambridge

    Google Scholar 

  5. Diamantoudi E, Miyagawa E, Xue L (2004) Random paths to stability in the roommate problem. Games Econ Behav 48(1):18–28

    Article  Google Scholar 

  6. Gale D, Shapley LS (1962) College admissions and the stability of marriage. Am Math Mon 69(1):9–15

    Article  Google Scholar 

  7. Gudmundsson J (2014) When do stable roommate matchings exist? A review. Rev Econ Design 18(2):151–161

    Article  Google Scholar 

  8. Gusfield D, Irving R (1989) The stable marriage problem: structure and algorithms. MIT Press, Boston

    Google Scholar 

  9. Holzman R, Samet D (2014) Matching of like rank and the size of the core in the marriage problem. Games Econ Behav 88:277–285

    Article  Google Scholar 

  10. Irving RW (1985) An efficient algorithm for the stable roommates problem. J Algorithms 6:577–595

    Article  Google Scholar 

  11. Jackson MO (2008) Social and economic networks. Princeton University Press, Princeton

    Google Scholar 

  12. Jackson MO, Watts A (2002) The evolution of social and economic networks. J Econ Theory 106(2):265–295

    Article  Google Scholar 

  13. Klaus B, Klijn F (2010) Smith and Rawls share a room: stability and medians. Soc Choice Welf 35(4):647–667

    Article  Google Scholar 

  14. Knuth DE (1976) Mariages stables et leurs relations avec d’autres problèmes combinatoires. Les Presses de l’Université de Montréal, Montréal

    Google Scholar 

  15. Manlove D (2013) Algorithmics of matching under preferences. Series on Theoretical Computer Science, vol 2. World Scientific Publishing, Singapore

  16. Pittel B (1993) The “stable roommates” problem with random preferences. Ann Prob 21(3):1441–1477

    Article  Google Scholar 

  17. Roth AE, Sotomayor MAO (1990) Two-sided matching: a study in game-theoretic modeling and analysis. econometric society monograph series. Cambridge University Press, New York

    Google Scholar 

  18. Tan J (1991) A necessary and sufficient condition for the existence of a complete stable matching. J Algorithms 12(1):154–178

    Article  Google Scholar 

Download references

Author information



Corresponding author

Correspondence to Flip Klijn.

Additional information

We thank David Manlove for useful suggestions on the computation of stable matchings for roommate problems. We thank Bettina Klaus, Fuhito Kojima, Andreu Mas-Colell, Elena Molis, and seminar audiences at Universitat de Barcelona, Universidad de Granada, and Universitat Rovira i Virgili for useful comments and discussions. We thank an Associate Editor and three anonymous reviewers for their valuable comments and suggestions.

The first draft of this paper was written while F. Klijn was visiting Universidad del Rosario. He gratefully acknowledges the hospitality of Universidad del Rosario and support from AGAUR-Generalitat de Catalunya (2014-SGR-1064 and 2017-SGR-1359), the Spanish Ministry of Economy and Competitiveness through Plan Estatal de Investigación Científica y Técnica y de Innovación 2013-2016 (ECO2014-59302-P and ECO2017-88130-P), and the Severo Ochoa Programme for Centres of Excellence in R&D (SEV-2015-0563).

Rights and permissions

Reprints and Permissions

About this article

Verify currency and authenticity via CrossMark

Cite this article

Jaramillo, P., Kayı, Ç. & Klijn, F. The core of roommate problems: size and rank-fairness within matched pairs. Int J Game Theory 48, 157–179 (2019).

Download citation


  • Matching
  • Roommate problem
  • Stability
  • Core
  • Rank-fairness
  • Rank gap
  • Bound

JEL Classification

  • C78