Skip to main content
Log in

The roommate problem with externalities

International Journal of Game Theory Aims and scope Submit manuscript

Cite this article


This paper extends the roommate problem to include externalities, allowing preferences for a partner to depend on the situation of others. Stability concepts for matchings and partitions of the set of agents are proposed and characterized, conditional on all agents having prudent expectations about other agents’ reactions to deviations. We prove that any roommate problem with externalities has a stable partition and that a stable matching exists if there is a stable partition without odd rings. These results allow us to find restrictions on the space of preferences ensuring the existence of a stable matching. We also show that some classical properties are lost in the presence of externalities: the existence of paths to stability from any unstable matching, the coincidence of the core with the set of stable matchings, and the invariance of the set of agents who are alone in a stable matching.

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

Access this article

Price excludes VAT (USA)
Tax calculation will be finalised during checkout.

Instant access to the full article PDF.

Institutional subscriptions


  1. In an ordered group \(\{a_1,\ldots , a_k\}\), \(a_{i-1}\) is the predecessor of \(a_i\) for each \(i\in \{1,\ldots , k\}\) (subscripts modulo k). Stability of a partition P also requires that \(a_i\) prefers to be matched with \(a_{i+1}\) than with \(a_{i-1}\), for any \(\{a_1,\ldots , a_k\}\in P\) and \(k\ge 3\).

  2. Chung (2000) analyses the roommate problem with weak preferences. He determines several types of restrictions on the space of individuals’ preferences that ensure the existence of a stable matching.

  3. The effect of externalities in two-sided matching models has been extensively studied in the last years [see Bando et al. (2016) for a systematic survey].

  4. In our framework, the prudence of agents is a necessary and sufficient condition to guarantee solvability in the entire subclass of marriage problems with externalities [see Sasaki and Toda (1996, Proposition 3.1 and Theorem 4.1)].

  5. The case where a blocks \(\mu \) to be alone is captured by taking \(b=a\).

  6. A comment about terminology: In all roommate problems, with or without externalities, a considers b acceptable if and only if a does not want to deviate from a matching in \({\mathcal {M}}(a,b)\) to be alone. However, only in models without externalities this last property is equivalent to assume that a prefers to be matched with b than remain alone: \(\mu \succ _a \eta \) for all \((\mu ,\eta )\in {\mathcal {M}}(a,b)\times {\mathcal {M}}(a,a)\). From this perspective, our concept of acceptable partner can be viewed as a weaker notion than the traditional one, as we only require that there exists \(\eta \in {\mathcal {M}}(a,a)\) such that \(\mu \succ _a \eta \) for all \(\mu \in {\mathcal {M}}(a,b)\).

  7. All through the text, properties in which subscripts are in a set \(\{1,\ldots ,m\}\) hold modulo m.

  8. For classical roommate problems, Pęski (2017) describes stable partitions through bijective mappings \(f:N\rightarrow N\), that he refers to as improper matchings when \(f(f(a))\ne a\) for some \(a\in N\). Underlying his approach is the following one-to-one correspondence between ordered partitions P and bijections \(f:N\rightarrow N\): \(\{a_1,\ldots , a_k\}\in P\) if and only if \(f(a_i)=a_{i-1}\) for all \(i\in \{1,\ldots , k\}\) and \(k\ge 1\) (f is referred as the bijection induced by P). Since this one-to-one correspondence does not depend on the presence of externalities, in our context stable partitions can also be described in terms of self-bijections of the set of agents. Indeed, a partition P is stable, in the sense of Definition 2 above, if and only if the bijection \(f:N\rightarrow N\) induced by P satisfies the following properties:

    1. (a)

      f associates to each a a potential mate f(a) who is acceptable to her.

    2. (b)

      If \(f(a)\ne f^{-1}(a)\), then a considers that \(f^{-1}(a)\) is more interesting than f(a).

    3. (c)

      If a forms a pair with either f(a) or \(f^{-1}(a)\) in a matching \(\mu \in {\mathcal {M}}(P)\), then a cannot block \(\mu \) by deviating with an agent b that forms a pair with either f(b) or \(f^{-1}(b)\) in \(\mu \).

    Notice that, f satisfies requirements (a) and (b) if and only if the partition P satisfies Definition 2(i).

    Moreover, f satisfies (c) if and only if any blocking pair of a matching \(\mu \in {\mathcal {M}}(P)\) includes an agent \(a_i\) that is not paired with either \(f(a_i)\) or \(f^{-1}(a_{i})\) in \(\mu \). Since the bijection f was induced by P, it follows that f satisfies (c) if and only if any blocking pair of a matching \(\mu \in {\mathcal {M}}(P)\) includes an agent who is alone under \(\mu \) and belongs to a ring of P. Hence, (c) and Definition 2(ii) are equivalent.

  9. In the adapted proof, \(\mu _{a,b}\) must be defined as the least preferred matching on \({\mathcal {M}}_a(b)\).

  10. This property is a consequence of Sasaki and Toda (1996, Proposition 3.1), the proof of Corollary 1 (see Sect. 4), and Theorem 1. The first result guarantees that, when individuals have sophisticated beliefs, there are unsolvable marriage markets with externalities. The proof of Corollary 1 ensure that marriage markets with externalities do not allow for odd rings. Therefore, as a consequence of Theorem 1, it is sufficient to consider a roommate problem that is an instance of an unsolvable marriage market (see Sect. 4 for definitions).

  11. In the literature of general equilibrium, there are works exploring whether stable matchings and commodity trade can coexist in competitive markets when agents’ deviations do not affect endogenous variables (cf., Gersbach and Haller 2010, 2011; Contreras 2014; Gersbach et al. 2015). These models focus on marriage markets and assume that individuals may get utility from private consumption, from discrete actions as job choice, or from externalities associated to partner’s observable characteristics or to the reduction of consumption rivalry.

  12. On stable algorithms. It is not difficult to verify that a stable matching of the problem without externalities \((N, (\succ ^*)_{a\in N})\) is also stable in \((N,(\succ _a)_{a\in N})\). Hence, when \((N, (\succ ^*)_{a\in N})\) is solvable, the classical algorithm proposed by Irving (1985) can be applied to it in order to find a stable matching for \((N,(\succ _a)_{a\in N})\). Alternatively, if \((N, (\succ ^*)_{a\in N})\) has no stable matching, we can apply any of the algorithms proposed by Tan (1991) and Tan and Hsueh (1995) in order to find a stable partition, which is also stable for \((N, (\succ )_{a\in N})\) (see the proof of Theorem 1). However, the stable partitions of \((N, (\succ ^*)_{a\in N})\) do not necessarily induce stable matchings of \((N, (\succ )_{a\in N})\). For instance, in Example 2 the matchings induced by the stable partitions of \((N, (\succ ^*)_{a\in N})\) are \(\{\mu _1, \mu _2, \mu _3\}\), while \(\mu _0\) is the only stable matching of \((N, (\succ )_{a\in N})\).

  13. Indeed, \(\mu _2\) is blocked by (2, 3), while \(\mu _3\) and \(\mu _0\) are blocked by (1, 3).

  14. Notice that, without externalities, if a roommate problem has a non-empty set of stable matchings, then \({\mathcal {A}}\) is an absorbing set if and only if \({\mathcal {A}}=\{\mu \}\) for some stable matching \(\mu \) [see Iñarra et al. (2013, Proposition 2)].


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

    Article  Google Scholar 

  • Bando K (2012) Many-to-one matching markets with externalities among firms. J Math Econ 48:14–20

    Article  Google Scholar 

  • Bando, (2014) A modified deferred acceptance algorithm for many-to-one matching markets with externalities among firms. J Math Econ 52:173–181

  • Bando K, Kawasaki R, Muto S (2016) Two-sided matching with externalities: a survey. J Oper Res Soc Jpn 59:35–71

    Google Scholar 

  • Biró P, Iñarra E, Molis E (2016) A new solution concept for the roommate problem: \({\cal{Q}}\)-stable matchings. Math Soc Sci 79:74–82

    Article  Google Scholar 

  • Contreras JL (2014) Olympics, externalities and matching: three essays in microeconomics. Ph.D. Dissertation, University of Chile. Available at

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

    Article  Google Scholar 

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

    Article  Google Scholar 

  • Fisher J, Hafalir I (2016) Matching with aggregate externalities. Math Soc Sci 81:1–7

    Article  Google Scholar 

  • Gale D, Shapley L (1962) Collegue admisions and the stability of marriage. Am Math Mon 69:9–15

    Article  Google Scholar 

  • Gersbach H, Haller H (2010) Club theory and household formation. J Math Econ 46:715–724

    Article  Google Scholar 

  • Gersbach H, Haller H (2011) Groups, collective decisions and markets. J Econ Theory 146:275–299

    Article  Google Scholar 

  • Gersbach H, Haller H, Konishi H (2015) Household formation and markets. Econ Theory 59:461–507

    Article  Google Scholar 

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

    Google Scholar 

  • Hafalir I (2008) Stability of marriage with externalities. Int J Game Theory 37:353–369

    Article  Google Scholar 

  • Iñarra E, Larrea C, Molis E (2008) Random paths to \(P\)-stability in the roommate problem. Int J Game Theory 36:461–471

    Article  Google Scholar 

  • Iñarra E, Larrea C, Molis E (2013) Absorbing sets in roommate problems. Games Econ Behav 81:165–178

    Article  Google Scholar 

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

    Article  Google Scholar 

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

    Article  Google Scholar 

  • Pęski M (2017) Large roommate problem with non-transferable random utility. J Econ Theory 168:432–471

    Article  Google Scholar 

  • Pycia M, Yenmez M (2017) Matching with externalities. Working paper

  • Rodrigues-Neto J (2007) Representing roommates’ preferences with symmetric utilities. J Econ Theory 135:545–550

    Article  Google Scholar 

  • Sasaki H, Toda M (1996) Two-sided matching problems with externalities. J Econ Theory 70:93–108

    Article  Google Scholar 

  • Roth A, Vande Vate J (1990) Random paths to stability in two-sided matching. Econometrica 58:1475–1480

    Article  Google Scholar 

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

    Article  Google Scholar 

  • Tan J, Hsueh Y (1995) A generalization of the stable matching problem. Discrete Appl Math 59:87–102

    Article  Google Scholar 

Download references

Author information

Authors and Affiliations


Corresponding author

Correspondence to Juan Pablo Torres-Martínez.

Additional information

Publisher's Note

Springer Nature remains neutral with regard to jurisdictional claims in published maps and institutional affiliations.

We are grateful to Milton Braitt, María Haydée Fonseca, Alejandro González, Daniel Jaar, Adriana Piazza, Francisco Pino, and Matteo Triossi for helpful comments and discussions.

Rights and permissions

Reprints and Permissions

About this article

Check for updates. Verify currency and authenticity via CrossMark

Cite this article

Contreras, J.L., Torres-Martínez, J.P. The roommate problem with externalities. Int J Game Theory 50, 149–165 (2021).

Download citation

  • Accepted:

  • Published:

  • Issue Date:

  • DOI:


JEL Classification