Proceedings of the Twenty-Ninth International Joint Conference on Artificial Intelligence (IJCAI-20)

Stable Roommate Problem with Diversity Preferences ∗

Niclas Boehmer1† and Edith Elkind2 1TU Berlin, Berlin, Germany 2University of Oxford, Oxford, UK [email protected], [email protected]

Abstract has a relation over her possible roommates. The most popular notion of stability in this context is stabil- In the multidimensional stable roommate problem, ity: no two agents should strictly prefer each other to their agents have to be allocated to rooms and have current roommate. Another relevant notion is exchange sta- preferences over sets of potential roommates. We bility: no two agents should want to swap their places. How- study the complexity of finding good allocations of ever, for the stable roommate problem, neither core stable agents to rooms under the assumption that agents nor exchange stable outcomes are guaranteed to exist. Fur- have diversity preferences [Bredereck et al., 2019]: ther, while Irving [1985] proved that it is possible to decide each agent belongs to one of the two types (e.g., in time linear in the size of the input if an instance of the juniors and seniors, artists and engineers), and roommate problem with strict preferences admits a core sta- agents’ preferences over rooms depend solely on ble outcome, many other algorithmic problems for core and the fraction of agents of their own type among their exchange stability are computationally hard [Cechlarov´ a´ and potential roommates. We consider various solution Manlove, 2005; Ronn, 1990]. For the s-dimensional stable concepts for this setting, such as core and exchange roommate problem, where each room has size s and agents stability, Pareto optimality and envy-freeness. On have preferences over all s − 1-subsets of agents as their po- the negative side, we prove that envy-free, core sta- tential roommates, even the core non-emptiness problem for ble or (strongly) exchange stable outcomes may fail strict preferences is NP-complete for s ≥ 3 [Huang, 2007; to exist and that the associated decision problems Ng and Hirschberg, 1991]. are NP-complete. On the positive side, we show that these problems are in FPT with respect to the However, Charlie then notes that Alice and Bob’s prob- room size, which is not the case for the general sta- lem has additional structure: the invitees can be classified as ble roommate problem. bride’s family or groom’s family, and it appears that all con- straints on seating arrangements can be expressed in terms of this classification: each person only has preferences over 1 Introduction the ratio of groom’s relatives and bride’s relatives at her table. Alice and Bob are planning their wedding. They have agreed Thus, the problem in question is closely related to hedonic di- on the gift registry and the music to be played, but they still versity games, recently introduced by Bredereck et al. [2019]. need to decide on the seating plan for the wedding reception. These are coalition formation games where agents have diver- They expect 120 guests, and the reception venue has 20 ta- sity preferences, i.e., they are partitioned into two groups (say, bles, with each table seating 6 guests. However, this task is far red and blue), and every agent is indifferent among coalitions from being easy: e.g., Alice’s great-aunt does not get along with the same ratio of red and blue agents. However, positive with Bob’s family and prefers not to share the table with any results for hedonic diversity games are not directly applica- of them; on the contrary, Bob’s younger brother is keen to ble to the roommate setting: in hedonic games, agents form meet Alice’s family and would be upset if he were stuck with groups of varying sizes, while the wedding guests have to be his relatives. After spending an evening trying to find a seat- split into groups of six. ing plan that would keep everyone happy, Alice and Bob are In this paper, we investigate the multidimensional stable on the brink of canceling the wedding altogether. roommate problem (for arbitrary room size s) with diversity Bob’s friend Charlie wonders if the hapless couple may preferences; we refer to the resulting problem as the room- benefit from consulting the literature on the stable roommate mate diversity problem. This model captures important as- problem. In this problem, the goal is to find a stable assign- pects of several real-world group formation scenarios, such ment of 2n agents into n rooms of size 2, where every agent as flat-sharing, splitting students into teams for group projects ∗An extended abstract of this paper appears in the proceedings and seating arrangements at important events. We consider of AAMAS’20. common solution concepts from the literature on the stable †Most of this research was done when the first author was an roommate problem; for each , we analyze the MSc student at the University of Oxford. complexity of checking if a given outcome is a valid solution,

96 Proceedings of the Twenty-Ninth International Joint Conference on Artificial Intelligence (IJCAI-20) whether the set of solutions is guaranteed to be non-empty, great practical relevance, the multidimensional version of the and, if not, how hard it is to check if an instance admits a roommate problem has not attracted much attention yet. solution as well as to compute a solution if it exists. One possibility to circumvent these negative results is to search for reasonable subclasses of the stable roommate 1.1 Our Contribution problem, i.e., to identify realistic restrictions on the agents’ We show that for room size two, every instance admits an preferences for which the associated computational prob- outcome that is core stable, exchange stable and Pareto opti- lems become tractable. This approach has been successful mal. For s > 2, we provide counterexamples showing that in the study of the two-dimensional stable roommate prob- core stable, exchange stable or envy-free outcomes may fail lem [Abraham et al., 2007; Bartholdi III and Trick, 1986; to exist. We also prove that for core stability, strong exchange Bredereck et al., 2017; Chung, 2000; Cseh and Juhos, 2019], stability and envy-freeness the existence questions are com- as well as in the context of hedonic games [Aziz et al., 2019; putationally hard; for Pareto optimality, we show that it is not Banerjee et al., 2001; Bogomolnaia and Jackson, 2002]. only hard to find a Pareto optimal outcome, but also to verify In particular, Bredereck et al. [2019] and Boehmer and whether a given outcome is Pareto optimal. We provide an Elkind [2020a] analyzed the complexity of finding stable out- overview of our results in Table 1. comes in hedonic diversity games for several notions of sta- On the positive side, we show that all existence questions bility, such as Nash stability, individual stability and core sta- we consider are in FPT with respect to the room size. To the bility. However, these results do not directly translate to our best of our knowledge, apart from some work on the multidi- model: first, with the exception of core stability, the solution mensional stable roommate problem with cyclic preferences concepts we consider are different from those considered in [Hofbauer, 2016], this is one of the first positive results for hedonic diversity games, and second, the hard constraint on the multidimensional stable roommate problem. Thus, the the room sizes in the roommate problem changes both the set roommate diversity problem offers an attractive combination of feasible allocations and the set of possible deviations. of expressive power and computational tractability. Finally, we note that Bredereck et al. [2019] and Boehmer and Elkind [2020a] related hedonic games with diversity 1.2 Related Work preferences to anonymous hedonic games [Bogomolnaia and The stable roommate problem was proposed by Gale and Jackson, 2002], where the agents’ preferences over coalitions Shapley [1962]. While Irving [1985] proved that it is pos- only depend on coalition sizes. This connection proves use- sible to check in time linear in the input whether a room- ful in our setting as well: e.g., in our hardness reductions mate problem admits a core stable outcome if the preferences we use the fact that it is NP-complete to decide whether an are restricted to be strict, Ronn [1990] showed that this prob- anonymous admits a Nash or core stable out- lem becomes NP-complete if ties in the preference relations come [Ballester, 2004]. are allowed. As in practice a group deviation usually re- Diversity-related questions have also been studied in the quires some regrouping, Alcalde [1994] initiated the study context of stable matching problems [Huang, 2010; Kamada of local stability notions that do not require reallocating non- and Kojima, 2015]. However, our approach is fundamentally deviating agents, by introducing the notion of exchange sta- different: in our model, types are used to define agents’ pref- bility. Subsequently, Cechlarov´ a´ and Manlove [2005] proved erences rather than distributional constraints on the outcome. that it is NP-complete to decide whether an instance of the Full version. The full version of the paper is available on stable roommate problem with strict preferences admits an arXiv [Boehmer and Elkind, 2020b]. It contains all miss- exchange stable outcome. Another concept that is relevant ing proofs and some preliminary results on extensions of our for the roommate problem is Pareto optimality [Abraham model, such as non-uniform room sizes and more than two et al., 2005; Cseh et al., 2019; Sotomayor, 2011]. Mor- types of agents. rill [2010] proved that for room size two it is possible to check if a given outcome is Pareto optimal, and to find 2 Preliminaries a Pareto improvement if it exists, in time quadratic in the number of agents. This implies that a Pareto optimal out- For every positive integer t, we denote the set {1, . . . , t} by come can be found in polynomial time. Researchers have [t], and we write [0, t] to denote {0} ∪ [t]. also considered various notions of fairness in the context of Definition 1. A roommate diversity problem with room size [ the roommate problem Abdulkadiroglu˘ and Sonmez,¨ 2003; s is a quadruple G = (R, B, s, (%i)i∈R∪B) with N = R ∪· B ] Aziz and Klaus, 2019 . One such notion is envy-freeness: an and |N| = k · s for some k ∈ N. The preference relation %i outcome is said to be envy-free if no agent wants to take the j of each agent i ∈ N is a weak order over the set D = { s : place of another agent. j ∈ [0, s]}. While much of the work on the stable roommate prob- lem focuses on the case s = 2, there are a few papers In the following, we call all agents in R red agents and all that consider the three-dimensional stable roommate problem agents in B blue agents, and write r = |R|, b = |B| and [Huang, 2007; Ng and Hirschberg, 1991]. For different pos- n = |R ∪· B| . We refer to size-s subsets of N as coalitions |N| sible definitions of the agents’ preferences, it is NP-complete or rooms; the quantity k = s is then the number of rooms. to decide whether an instance with strict preferences admits For each i ∈ N, let Ni = {S ⊆ N : |S| = s, i ∈ S} denote a core stable outcome [Huang, 2007; Iwama et al., 2007; all size-s subsets of N containing i, i.e., all possible rooms Ng and Hirschberg, 1991]. For this reason, despite its that i can be part of.

97 Proceedings of the Twenty-Ninth International Joint Conference on Artificial Intelligence (IJCAI-20)

unrestricted strict dichotomous Gu. Ex. Co. Gu. Ex. Co. Gu. Ex. Co. Core  (2) NPc (3) NPh (3)  (2) NPc (3) NPh (3)  (4) - P (4) Strong Core  (2) NPc (5) NPh (5)  (2) NPc (5) NPh (5)  (5) NPc (5) NPh (5) Same Ex.  (6) - P (6)  (6) - P (6)  (6) - P (6) Exch.  (7) ??  (7) ?? ??? Strong Ex.  (7) NPc (8) NPh (8)  (7) ??  (7) NPc (8) NPh (8) Pareto  - NPh (9)  - ?  - NPh (9) Envy-free  (10) NPc (12) NPh (12)  (10) NPc (12) NPh (12)  (10) NPc (12) NPh (12)

Table 1: Overview of complexity results for different solution concepts and restrictions on the preference relations. For each solution concept and restriction, we indicate whether every instance satisfying this restriction is guaranteed to admit an outcome with the respective property (Gu.), the complexity of deciding if an instance admits such an outcome (Ex.) and of finding one if it exists (Co.). The number in brackets is the number of the respective theorem. For all solution concepts, the problem of verifying whether a given outcome has the desired property is in P except for Pareto optimality, for which this problem is coNP-complete. We prove that all existence problems in this table are in FPT with respect to the room size.

An outcome of G is a partition of all agents into k rooms π if for all i ∈ S it holds that θ(S) i θ(π(i)); we say π = {C1,...,Ck} such that |Ci| = s for all i ∈ [k]. Let π(i) that S weakly blocks an outcome π if for all i ∈ S it holds denote i’s coalition in π. Given a coalition C ⊆ N, let θ(C) that θ(S) %i θ(π(i)) and there exists an i ∈ S such that |C∩R| denote the fraction of red agents in C, i.e., θ(C) = : we θ(S) i θ(π(i)). An outcome π is called (strongly) core |C| stable if no coalition (weakly) blocks it. say that C is of fraction θ(C). A coalition C ⊆ N is called In an outcome π, a pair of agents i, j ∈ N with π(i) 6= pure if C ⊆ R or C ⊆ B and mixed otherwise. π(j) has an exchange deviation if they would like to exchange For each agent i ∈ N, we interpret her preference relation   % places, i.e., θ (π(j) \{j}) ∪ {i} i θ π(i) and θ (π(i) \ i over D as her preferences over the fraction of red agents in   her coalition; for instance, 2 % 3 means that agent i prefers {i}) ∪ {j} j θ π(j) . Further, a pair of agents i, j ∈ N 5 i 5 a room where two out of five agents are red to a room where with π(i) 6= π(j) has a weak exchange deviation if θ (π(j) \ 1 %     three out of five agents are red. Thereby, i induces agent {j})∪{i} i θ π(i) and θ (π(i)\{i})∪{j} %j θ π(j) . i’s preferences over all possible rooms she can be part of.2 An outcome is called (strongly) exchange stable if no pair of Given two rooms S, T ∈ Ni, overloading notation, we write agents has a (weak) exchange deviation [Alcalde, 1994]. S i T and say that i strictly prefers S to T if θ(S) %i θ(T ) An outcome π is called Pareto optimal if there is no other and θ(T ) 6%i θ(S). Further, we write S %i T and say that i outcome that makes all agents weakly better off and some 0 weakly prefers S to T if θ(T ) = θ(S) or θ(T ) %i θ(S). If i agents strictly better off, i.e., there is no outcome π such that 0 0 weakly prefers S to T and T to S, we write S ∼i T and say θ(π (i)) %i θ(π(i)) for all i ∈ N and θ(π (i)) i θ(π(i)) that i is indifferent between S and T . for some i ∈ N. The preference relation of agent i is said to be single- An outcome π is called envy-free if there does not exist a peaked if there exists a peak pi ∈ D such that for all α, β ∈ D pair of agents i, j ∈ N with π(i) 6= π(j) such that i envies %   such that pi ≤ α < β or β < α ≤ pi it holds that α i β. j’s place, i.e., θ (π(j) \{j}) ∪ {i} i θ π(i) . The preference relation of i is said to be dichotomous if it is Due to space constraints, we defer several proofs to the full possible to partition D into two sets D+ and D− so that for all version of the paper. + 0 − 0 0 − d ∈ D , d ∈ D it holds that d i d , for all d, d ∈ D it 0 0 + 0 holds that d ∼i d and for all d, d ∈ D it holds that d ∼i d . 3 Roommate Diversity Problem With Room We say that i approves all fractions in D+ and disapproves all fractions in D−. Size Two Generalizing the definition of Gale and Shapley [1962], we For s = 2, the roommate diversity problem becomes a spe- say that a coalition S ⊆ N with |S| = s blocks an outcome cial case of the classical stable roommate problem. Our first observation is that diversity preferences make the classical 1We could equivalently define the agents’ preferences over the problem significantly easier: we can efficiently find an out- number of red agents in each room; we chose the ratio-based defini- come that is Pareto optimal, core stable and exchange stable. tion for consistency with the hedonic diversity games literature and This result motivates us to focus on the case s > 2 in the to emphasize the room size. remainder of the paper. 2For succinctness and consistency with prior work, we assume that each agent has preferences over the entire set D, including 0 Theorem 1. Every instance of the roommate diversity prob- and 1, even though a red agent cannot be part of a room with ratio lem with room size two admits an outcome that is Pareto op- 0 and a blue agent cannot be part of a room with ratio 1. Allowing timal, core stable and exchange stable, even if we allow for agents to have preferences over ‘impossible’ ratios has no impact indifferences in the preferences. on our results: even if, say, a blue agent ranks 1 highly, she cannot deviate to a coalition with this ratio. In all of our examples, the Proof sketch. We say that a mixed pair is happy if both agents impossible ratios are ranked at the bottom of agent’s preferences. in the pair weakly prefer a mixed pair to a pure pair. The

98 Proceedings of the Twenty-Ninth International Joint Conference on Artificial Intelligence (IJCAI-20) general idea of the is to first create as many happy Using the construction in the proof of Theorem 3, we can mixed pairs as possible. The algorithm then attempts to put map the single-peaked anonymous hedonic game with empty the remaining agents in pure pairs. If at this point the number core constructed by Banerjee et al. [2001] to a single-peaked of blue agents is odd, this is not possible. In this case, de- instance of the roommate diversity problem with an empty pending on the preferences of agents in mixed pairs, it either core. We obtain the following corollary. inserts an additional mixed pair or breaks up one of the mixed Corollary 1. An instance of the roommate diversity problem pairs to create two pure pairs: one red and one blue. may fail to have a core stable outcome, even if all agents’ preferences are single-peaked. 4 (Strong) Core Stability In contrast, if agents’ preferences are dichotomous, the We have seen that for the roommate diversity problem with core is non-empty, and an outcome in the core can be com- s = 2 a core stable outcome is guaranteed to exist. However, puted efficiently: following the approach of Peters [2016], to for larger values of s this is not the case. construct a core stable outcome, we iterate over all fractions Theorem 2. An instance of the roommate diversity problem ` s for ` ∈ [0, s] and add the maximum possible number of may fail to have a core stable outcome, even if no indiffer- rooms consisting of ` red agents and s−` blue agents who all ences in the preferences are allowed. ` approve s . The rest of the agents are split into the remaining rooms. We obtain the following result. Proof. Let G = ({r1, r2, r3, r4}, {b1, b2, b3, b4}, 4, (%i)i∈N ) with Theorem 4. Every instance of the roommate diversity prob- 2 4 3 1 0 4 1 2 3 0 lem with dichotomous preferences admits a core stable out- r1, r2, r3 : ; r4 : come; moreover, an outcome in the core can be computed in 4 4 4 4 4 4 4 4 4 4 polynomial time. 1 2 3 0 4 b , b , b , b : . 1 2 3 4 4 4 4 4 4 However, this positive result does not extend to the more de- Assume for the sake of contradiction that G has a core sta- manding notion of strong core stability. 2 ble outcome π. If π consists of two coalitions of fraction 4 , Theorem 5. It is NP-complete to decide whether a given {r4, b1, b2, b3} is blocking. If π consists of one coalition of roommate diversity problem admits a strongly core stable 3 1 fraction 4 and one coalition of fraction 4 , {r1, r2, r3, r4} is outcome, even if the preferences are restricted to be dichoto- blocking. If π consists of a purely blue and a purely red coali- mous and every agent approves at most four fractions. tion, {r1, r2, b1, b2} is blocking. Proof sketch. Peters [2016] showed that the corresponding Further, if we assume that the room size is flexible and part problem for anonymous hedonic games is NP-complete. By of the input, the associated existence question becomes NP- reducing from this problem, we can establish that our prob- complete. lem is NP-hard as well; the reduction is similar to the one Theorem 3. It is NP-complete to decide whether a given in- used in the proof of Theorem 3. stance of the roommate diversity problem admits a core stable outcome. The hardness result holds even if no indifferences 5 (Strong) Exchange Stability in the preferences are allowed. As pointed out in the introduction, it is not always plausible to Proof sketch. To check whether an outcome is core stable, we assume that agents are allowed to perform group deviations. iterate over all j ∈ [0, s] and check if there are j red agents Therefore, in this section, we focus on stability concepts that j are defined in terms of agent swaps. and s − j blue agents preferring s to the fraction of their cur- rent coalition. To prove hardness, we reduce from the prob- 5.1 Same-Type Swaps lem of deciding whether an anonymous hedonic game admits a core stable outcome [Ballester, 2004]. Given an anonymous If the set of possible deviations is limited to agent swaps, hedonic game G0 with n agents, we build an n-dimensional it may be the case that only agents of the same type are al- instance G of the roommate diversity problem. To this end, lowed to swap their places: we call the resulting stability no- 0 same-type-exchange stability for each agent i in G , we introduce a red agent ri whose pref- tion . For example, if a professor erence relation is constructed by replacing each size ` ∈ [n] in forms fixed-size teams for a group project, she may want to the preferences of i with fraction ` . Moreover, for all ` ∈ [n], fix the fraction of graduate students in each group (e.g., to n ensure that the experienced students are equally distributed) we introduce n2 blue agents preferring ` to every other frac- n but still allow for swaps between two undergraduate students tion, while they rank all other fractions arbitrarily. To con- or between two graduate students. Under this weaker version G π0 G0 struct an outcome of from an outcome of , for each of exchange stability, the agents are guaranteed to eventually S ∈ π0 coalition , we insert a coalition consisting of the cor- converge to a stable outcome. responding red agents {ri : i ∈ S} and n − |S| blue agents |S| 0 Theorem 6. Every instance of the roommate diversity prob- with n as their top fraction. If a coalition T blocks π in 0 lem has a (strongly) same-type-exchange stable outcome, and G , the coalition consisting of red agents {ri : i ∈ T } and |T | some such outcome can be computed in polynomial time. n−|T | blue agents with n as their top fraction is a blocking coalition for the respective outcome of G. The other direction Proof. To compute a (strongly) same-type-exchange stable works analogously. outcome, we start at an arbitrary outcome π and swap pairs

99 Proceedings of the Twenty-Ninth International Joint Conference on Artificial Intelligence (IJCAI-20) who have a (weak) same-type-exchange deviation until this is 6 Pareto Optimality no longer possible. To see that this procedure always termi- In the roommate problem, Pareto optimality emerges as a nat- nates, note that same-type exchange deviations do not change ural notion of stability. Indeed, an outcome is not Pareto the fraction of red agents in any coalition. Thereby, nothing optimal if and only if we can rearrange the agents so that changes for agents who are not involved in the swap, while all of them are weakly better off and at least some of both agents involved in the swap weakly improve and at least them are strictly better off, i.e., there is a weakly improv- one of them strictly improves. As every agent’s preference ing deviation by the grand coalition [Elkind et al., 2016; s + 1 relation is defined over elements, the total number of Morrill, 2010]. swaps is at most ns. While for many other stability concepts we consider sta- ble outcomes are not guaranteed to exist, by the definition 5.2 Unrestricted Swaps of Pareto optimality, every instance of the roommate diver- Unfortunately, the existence guarantee for same-type swaps sity problem admits a Pareto optimal outcome. Indeed, we does not extend to unrestricted swaps. can start at an arbitrary outcome and perform a sequence of at most ns Pareto improvements, i.e., rearrangements of the Theorem 7. An instance of the roommate diversity problem agents that make all agents weakly better off and some agents may fail to have an exchange stable outcome, even if the pref- strictly better off. However, it is still computationally hard to erences are single-peaked and no indifferences in the prefer- compute a Pareto optimal outcome, as finding a Pareto im- ences are allowed. provement is difficult. Theorem 9. For the unrestricted roommate diversity prob- Proof sketch. The following single-peaked roommate diver- lem, it is coNP-complete to decide whether a given outcome sity game G = ({r1, r2, r3, r4, r5}, {b1, b2, b3, b4}, 3, (%i is Pareto optimal; moreover, we cannot compute a Pareto op- )i∈N ) with: timal outcome in polynomial time unless P=NP. These results hold even if preferences are dichotomous. 3 2 1 0 2 1 3 0 r , r : ; r , r , r : ; 1 2 3 3 3 3 3 4 5 3 3 3 3 Proof sketch. To show that an outcome is not Pareto optimal, 0 1 2 3 1 2 0 3 it suffices to guess a Pareto improvement and verify that it b1 : ; b2, b3, b4 : . indeed makes all agents weakly better off and some agents 3 3 3 3 3 3 3 3 strictly better off; this establishes that our decision problem does not admit an exchange-stable outcome. is in coNP. To prove hardness for the unrestricted case, we construct reductions from the related problems for anony- mous hedonic games, which are NP-hard, as proven by Aziz Further, the associated existence problem for strong exchange et al. [2013]. The reductions are similar to the reduction in stability is NP-complete. the proof of Theorem 8. Theorem 8. It is NP-complete to decide whether a given in- stance of the roommate diversity problem admits a strongly 7 Envy-Freeness exchange stable outcome. The hardness result still holds if We can think of envy-freeness as a “one-sided” version of ex- the preferences are dichotomous and every agent approves at change stability. Thus, similarly to same-type-exchange sta- most four fractions. bility, we can define same-type-envy-freeness by only con- sidering envy among agents of the same type. Same-type- Proof sketch. To show hardness, we reduce from the prob- envy-freeness is a plausible variant of envy-freeness, as peo- lem of deciding whether an anonymous hedonic game admits ple tend to envy those who are similar to them [Salovey and a Nash stable outcome [Ballester, 2004; Peters, 2016]; recall Rodin, 1984]. Moreover, same-type-envy-freeness is also an that an outcome of a hedonic game is said to be Nash stable appealing notion of fairness: if agent i and agent j are of the if no agent wants to move from her current coalition to an- same type and i envies j, swapping i and j has no effect on other existing coalition or to form a singleton coalition. Our other agents, so the decision which of these agents should get reduction is similar to the one in the proof of Theorem 3: we a better set of roommates is essentially arbitrary. Unfortu- map an anonymous hedonic game G0 with n agents to an n- nately, an outcome that is fair in this sense is not guaranteed dimensional instance of the roommate diversity problem G to exist. 0 so that an agent i in G is mapped to a red agent in G whose Theorem 10. There exists an instance of the roommate di- preference relation is obtained from that of i by replacing ` versity problem with room size two that has no same-type- ` 2 with n for all ` ∈ [1, n]; however, here, we introduce n − n envy-free outcome and thereby also no envy-free outcome. blue agents who are indifferent among all fractions. Moreover, in this instance the agents’ preferences are single- peaked and dichotomous. We believe that deciding whether a roommate diversity % problem admits an exchange stable outcome is NP-complete Proof. Let G = ({r1}, {b1, b2, b3}, 2, ( i)i∈N ) with: as well, but we were unable to extend the proof of Theorem 8 2 1 0 0 1 2 r : ; b , b , b : . to show this. 1 2 2 2 1 2 3 2 2 2

100 Proceedings of the Twenty-Ninth International Joint Conference on Artificial Intelligence (IJCAI-20)

2 This game is clearly single-peaked and can be transformed can be upper-bounded by 2 ∗ 2(s+1) . For each such agent into a dichotomous game by putting the two bottom fractions class, we introduce s + 1 variables denoting the number of for each agent in the same equivalence class. As every out- agents from this class that are put into a room with i ∈ [0, s] come of this game consists of one mixed and one purely blue red agents. Using these variables, we can check whether coalition, the blue agent in the mixed coalition always envies they induce a valid outcome and whether this outcome is the two blue agents in the pure coalition. (strongly) core stable by appropriately selected linear con- straints. Thereby, it is possible to formalize this problem as On the positive side, there exist two special cases where the an Integer Linear Program (ILP) and use the algorithm of existence of a same-type-envy-free outcome is guaranteed. Lenstra Jr [1983] that solves an ILP with ρ variables and input Theorem 11. A same-type-envy-free outcome is guaranteed length L in time O(ρ2.5ρ+o(ρ)L). to exist if the number of red agents is divisible by s or by k. This approach, with appropriate modifications, extends to Proof. If s divides r, there exists an outcome consisting of (strong) exchange stability and envy-freeness. pure coalitions only. If k divides r, there exists an outcome Theorem 15. The problem of determining whether an in- r where the fraction of each coalition is k . In either case, all stance of the roommate diversity problem admits a (strongly) agents of the same type are in coalitions of the same fraction, exchange stable outcome is fixed-parameter tractable with re- so no agent envies another agent of her type. spect to the room size. Nevertheless, it can be proven by a reduction from EXACT Theorem 16. The problem of determining whether an in- COVERBY 3-SETS that the general existence question for stance of the roommate diversity problem admits an envy-free envy-freeness is NP-complete. outcome is fixed-parameter tractable with respect to the room size. Theorem 12. It is NP-complete to decide whether a given in- stance of the roommate diversity problem admits an envy-free Theorems 14–16 highlight a fundamental difference be- outcome, even if no indifferences in the preference relations tween the classical stable roommate problem and the room- are allowed. This hardness result also holds if the agents’ mate problem with diversity preferences: for the former all preferences are dichotomous and every agent is allowed to studied existence problems are NP-complete for s = 3 or approve at most four fractions. even for s = 2, while for the latter many of these problems are polynomial-time solvable if the size of the rooms is fixed We were not able to extend Theorem 12 to same-type- or bounded. Thus, assuming diversity preferences fundamen- envy-freeness, but conjecture that the hardness result still tally changes the complexity of the roommate problem. We holds. However, if preferences are strict, there exists a sim- note, however, that we were unable to extend our ILP tech- ple algorithm that solves this problem in time linear in n and niques to questions concerning Pareto optimality; it remains single-exponential in s, i.e., this problem is in FPT with re- an open problem whether these questions are also in FPT with spect to s. respect to the room size s. Theorem 13. Given an instance of the roommate diversity problem with room size s and strict preferences, it is possi- 9 Conclusions And Future Directions s ble to check in time O(ns2 ) whether this instance admits a In this paper, we have proposed the roommate diversity prob- same-type-envy-free outcome and to find one if it exists. lem, which is an interesting special case of the multidimen- sional stable roommate problem. We have initiated the algo- 8 Parameterized Analysis rithmic study of this problem by considering various standard In Section 3, we saw that fixing the size of the rooms to s = 2 solution concepts and analyzing the existence of stable out- has a significant impact on the complexity of finding stable comes and the complexity of computing them (see Table 1). outcomes. Motivated by this result, as well as by Theorem 13, While we have answered many questions that arise in this in this section, we study the parameterized complexity of the context, the complexity of deciding whether a roommate di- roommate diversity problem with respect to parameter s. This versity problem admits an exchange stable outcome remains is a promising parameter, since in most of our hardness re- open. Moreover, it is unclear if every instance with dichoto- ductions we converted an anonymous hedonic game with n mous preferences admits an exchange stable outcome. By agents into an instance with room size n; it is also appeal- parameterizing our computational problems by the size of the ing because in practice the room size can be much smaller rooms, we showed that diversity preferences are a powerful than the number of agents. Indeed, most of the algorithmic restriction, as all studied existence problems lie in FPT with problems considered in this work turn out to be in FPT with respect to this parameter. However, it would be desirable to respect to s. We start by considering (strong) core stability. obtain parameterized that are combinatorial rather than ILP-based, since ILP-based algorithms tend to be slow Theorem 14. The problem of determining whether an in- in practice. stance of the roommate diversity problem admits a (strongly) core stable outcome is fixed-parameter tractable with respect Acknowledgements to the room size. This work was supported by a DFG project “MaMu”, NI Proof sketch. As every agent is fully characterized by her 369/19 (Boehmer) and by an ERC Starting Grant ACCORD preference relation and type, the number of distinct agents under Grant Agreement 639945 (Elkind).

101 Proceedings of the Twenty-Ninth International Joint Conference on Artificial Intelligence (IJCAI-20)

References [Chung, 2000] Kim-Sau Chung. On the existence of stable roommate matchings. Games Econ Behav, 33(2):206–230, [Abdulkadiroglu˘ and Sonmez,¨ 2003] Atila Abdulkadiroglu˘ 2000. and Tayfun Sonmez.¨ School choice: A approach. Am Econ Rev, 93(3):729–747, 2003. [Cseh and Juhos, 2019] Agnes´ Cseh and Attila Juhos. Pair- wise preferences in the . In [ ] Abraham et al., 2005 David J. Abraham, Peter´ Biro,´ and STACS’19, pages 21:1–21:16, 2019. David Manlove. “Almost stable” matchings in the room- mates problem. In WAOA’05, pages 1–14, 2005. [Cseh et al., 2019] Agnes´ Cseh, Tamas´ Fleiner, and Petra Harjan.´ Pareto optimal coalitions of fixed size, 2019. arXiv [ ] Abraham et al., 2007 David J Abraham, Ariel Levavi, 1901.06737. David F Manlove, and Gregg O’Malley. The stable room- mates problem with globally-ranked pairs. In WINE’07, [Elkind et al., 2016] Edith Elkind, Angelo Fanelli, and pages 431–444, 2007. Michele Flammini. Price of Pareto optimality in hedonic games. In AAAI’16, pages 475–481, 2016. [Alcalde, 1994] Jose´ Alcalde. Exchange-proofness or [ ] divorce-proofness? Stability in one-sided matching mar- Gale and Shapley, 1962 David Gale and Lloyd S Shapley. kets. Econ Des, 1(1):275–287, 1994. College admissions and the stability of marriage. Am Math Mon, 69(1):9–15, 1962. [Aziz and Klaus, 2019] Haris Aziz and Bettina Klaus. Ran- [Hofbauer, 2016] Johannes Hofbauer. d-dimensional stable dom matching under priorities: Stability and no envy con- matching with cyclic preferences. Math Soc Sci, 82:72– cepts. Soc Choice Welf, 53(2):213–259, 2019. 76, 2016. [Aziz et al., 2013] Haris Aziz, Felix Brandt, and Paul Har- [Huang, 2007] Chien-Chung Huang. Two’s company, three’s renstein. Pareto optimality in coalition formation. Games a crowd: Stable family and threesome roommates prob- Econ Behav, 82:562–581, 2013. lems. In ESA’07, pages 558–569, 2007. [Aziz et al., 2019] Haris Aziz, Florian Brandl, Felix Brandt, [Huang, 2010] Chien-Chung Huang. Classified stable Paul Harrenstein, Martin Olsen, and Dominik Peters. Frac- matching. In SODA’10, pages 1235–1253, 2010. tional hedonic games. ACM Trans Econ Comput, 7(2):6:1– [ ] 6:29, 2019. Irving, 1985 Robert W Irving. An efficient algorithm for the “stable roommates” problem. J Algorithms, 6(4):577– [Ballester, 2004] Coralio Ballester. NP-completeness in he- 595, 1985. donic games. Games Econ Behav, 49:1–30, 2004. [Iwama et al., 2007] Kazuo Iwama, Shuichi Miyazaki, and [Banerjee et al., 2001] Suryapratim Banerjee, Hideo Kon- Kazuya Okamoto. Stable roommates problem with triple ishi, and Tayfun Sonmez.¨ Core in a simple coalition for- rooms. In WAAC’07, pages 105–112, 2007. mation game. Soc Choice Welf, 18(1):135–153, 2001. [Kamada and Kojima, 2015] Yuichiro Kamada and Fuhito [Bartholdi III and Trick, 1986] John Bartholdi III and Kojima. Efficient matching under distributional con- Michael A Trick. Stable matching with preferences straints: Theory and applications. Am Econ Rev, derived from a psychological model. Oper Res Lett, 105(1):67–99, 2015. 5(4):165–169, 1986. [Lenstra Jr, 1983] Hendrik W. Lenstra Jr. Integer program- [Boehmer and Elkind, 2020a] Niclas Boehmer and Edith ming with a fixed number of variables. Math Oper Res, Elkind. Individual-based stability in hedonic diversity 8(4):538–548, 1983. games. In AAAI’20, 2020. [Morrill, 2010] Thayer Morrill. The roommates problem re- [Boehmer and Elkind, 2020b] Niclas Boehmer and Edith visited. J Econ Theory, 145(5):1739–1756, 2010. Elkind. Stable roommate problem with diversity prefer- [Ng and Hirschberg, 1991] Cheng Ng and Daniel S ences, 2020. arXiv 2004.14640. Hirschberg. Three-dimensional stable matching problems. SIAM J Discrete Math, 4(2):245–252, 1991. [Bogomolnaia and Jackson, 2002] Anna Bogomolnaia and Matthew O Jackson. The stability of hedonic coalition [Peters, 2016] Dominik Peters. Complexity of hedonic structures. Games Econ Behav, 38(2):201–230, 2002. games with dichotomous preferences. In AAAI’16, pages 579–585, 2016. [Bredereck et al., 2017] Robert Bredereck, Jiehua Chen, Ugo Paavo Finnendahl, and Rolf Niedermeier. Stable [Ronn, 1990] Eytan Ronn. NP-complete stable matching roommate with narcissistic, single-peaked, and single- problems. J Algorithms, 11(2):285–304, 1990. crossing preferences. In ADT’17, pages 315–330, 2017. [Salovey and Rodin, 1984] Peter Salovey and Judith Rodin. [Bredereck et al., 2019] Robert Bredereck, Edith Elkind, Some antecedents and consequences of social-comparison and Ayumi Igarashi. Hedonic diversity games. In AA- jealousy. J Pers Soc Psychol, 47(4):780, 1984. MAS’19, pages 565–573, 2019. [Sotomayor, 2011] Marilda Sotomayor. The Pareto-stability concept is a natural solution concept for discrete match- [Cechlarov´ a´ and Manlove, 2005] Katar´ına Cechlarov´ a´ and ing markets with indifferences. Int J , David F Manlove. The exchange-stable marriage problem. 40(3):631–644, 2011. Discrete Appl Math, 152(1-3):109–122, 2005.

102