Abstract
The classical Stable Roommates problem is to decide whether there exists a matching of an even number of agents such that no two agents which are not matched to each other would prefer to be with each other rather than with their respectively assigned partners. We investigate Stable Roommates with complete (i.e., every agent can be matched with any other agent) or incomplete preferences, with ties (i.e., two agents are considered of equal value to some agent) or without ties. It is known that in general allowing ties makes the problem NPcomplete. We provide algorithms for Stable Roommates that are, compared to those in the literature, more efficient when the input preferences are complete and have some structural property, such as being narcissistic, singlepeaked, and singlecrossing. However, when the preferences are incomplete and have ties, we show that being singlepeaked and singlecrossing does not reduce the computational complexity—Stable Roommates remains NPcomplete.
Similar content being viewed by others
Explore related subjects
Discover the latest articles, news and stories from top researchers in related subjects.Avoid common mistakes on your manuscript.
1 Introduction
Given 2n agents, each having preferences with regard to how suitable the other agents are as potential partners, the Stable Roommates problem is to decide whether there exists a matching, i.e., a set of disjoint pairs of the agents, without inducing a blocking pair. A blocking pair consists of two agents that are not matched to each other but prefer to be with each other rather than with their assigned partners. A matching without blocking pairs is called a stable matching.
Stable Roommates was introduced by Gale and Shapley [26] in the 1960’s and has been studied extensively since then [32,33,34,35, 48, 49]. While it is quite straightforward to see that stable matchings may not always exist, it is not trivial to see whether an existing stable matching can be found in polynomial time, even when the input preference orders are complete and do not contain ties (i.e., each agent can be a potential partner to each other agent, and no two agents are considered to be equally suitable as a partner). For the case without ties, Irving [32] and Gusfield and Irving [30] provided \(O(n^2)\)time algorithms to decide the existence of a stable matching and to find one if it exists—for complete preferences and for incomplete preferences, respectively. Deciding whether a given instance admits a stable matching is NPcomplete [48] when the given preferences are complete but may contain ties.
Solving Stable Roommates has many applications, such as matching students with each other to accomplish a homework project or users in a P2P file sharing network, assigning coworkers to twoperson offices, partitioning players in twoplayer games, or finding receiverdonor pairs for organ transplants [36, 38, 39, 50, 51]. In such situations, the students, the people, or the players, who we jointly refer to as agents, typically have certain structurally restricted preferences concerning which other agents might be their best partners. For instance, when assigning roommates, each agent may have an ideal room temperature and may prefer to be with another agent with the same penchant. Such preferences are called narcissistic. Moreover, if we order the agents according to their ideal room temperatures, then it is natural to assume that each agent z prefers to be with an agent x rather than with another agent y if z’s ideal temperature is closer to x’s than to y’s. These kind of preferences are called singlepeaked [5, 17, 31]. Singlepeakedness is used to model agents’ preferences where there is a criterion, e.g., room temperature, that can be used to obtain a linear order of the agents such that each agent’s preferences over all agents along this order are strictly increasing until they reach the peak—their ideal partner—and then strictly decreasing. Singlepeakedness is a popular concept with prominent applications in voting contexts. If the input preferences are complete and contain no ties, then testing whether they are singlepeaked can be done in linear time [2, 4, 18, 22].
Another possible restriction on the preferences is the singlecrossing property, which was originally proposed to model individuals’ preferences on income taxation [43, 47]. To illustrate this, assume that the agents are increasingly ordered from left to right according to their income level. Then, one may observe that the agents’ roommates preferences towards two arbitrary agents, say x and y, are such that the agents on the left prefer x to y while the agents on the right prefer y to x. This kind of preferences is not necessarily singlepeaked as people do not always prefer to have a roommate of similar income level. If the input preferences are complete and contain no ties, then testing whether they are singlecrossing can be done in polynomial time [8, 18, 19]. We refer to Bredereck et al. [9] and Elkind et al. [21] for numerous references on singlepeakedness and singlecrossingness.
Related work. Bartholdi III and Trick [4] studied Stable Roommates with narcissistic and singlepeaked preferences. They showed that for the case with linear orders (i.e., complete and without ties) a Stable Roommates instance with 2n agents always admits a unique stable matching, and they claimed an O(n)time algorithm to find this matching [4, Section 3]. However, we will show in Example 4 that there are instances for which their algorithm runs in \(O(n^2)\) time. In terms of preference structures in the stable matching setting, using a connection to narcissistic singlecrossing preference profiles (see Sect. 2.3 for the corresponding definition) and semistandard Young tableaux [55], Chen and Finnendahl [13] counted the number of narcissistic preference profiles that are also either singlepeaked or singlecrossing.
Paper structure and our contributions. We study the computational complexity of Stable Roommates for structured preferences when incompleteness and ties are allowed. In particular, we explore how the specific preference structures help in guaranteeing the existence of stable matchings and in designing efficient algorithms for finding a stable matching, even when the input preferences may be incomplete or contain ties.
In Sect. 2, we discuss natural generalizations of the wellknown singlepeaked and singlecrossing preferences (that were originally introduced for linear orders) for incomplete preferences with ties. In Sect. 3, we show that for complete preference orders, structurally restricted preferences such as being narcissistic and singlecrossing or being narcissistic and singlepeaked guarantee the existence of stable matchings. Moreover, we demonstrate that the known algorithm of Bartholdi III and Trick [4] can be extended to always find a stable matching in two new cases: The algorithm works

(1)
when the preferences are complete, narcissistic, singlecrossing, and may contain ties as well as

(2)
when the preferences are complete, narcissistic, singlepeaked, and may contain ties.
In Sect. 4 we study the case where the preferences are incomplete and may contain ties, and prove that Stable Roommates becomes NPcomplete, even when the preferences are narcissistic, singlepeaked, and (tiesensitive) singlecrossing. Our results, together with those from related work, are surveyed in Table 1. We conclude in Sect. 5 with some open questions.
2 Fundamental concepts and basic observations
In this section, we introduce fundamental concepts and notions, arising from stable matchings and structured preferences, and we make some crucial observations regarding relations between the different structured preferences.
2.1 Preferences, acceptable sets, and acceptability graphs
Let \(V=\{1,2,\ldots , 2n\}\) be a set of 2n agents. A (preference) profile \(\mathcal {P}=(\succ _i)_{i\in V}\) is a collection of the preference orders of the agents from V. Here, the preference order \(\succeq _i\) of each agent \(i\in V\) is a weak order on a subset \(V(\succeq _i)\subseteq V\) of agents that i finds acceptable as a partner. The set \(V(\succeq _i)\) is called the acceptable set of i. Recall that a weak order \(\succeq \) on a set X is a transitive (i.e., \(x\succeq y\) and \(y\succeq z\) imply \(x\succeq z\)) and complete (i.e., \(x\succeq y\) or \(y\succeq x\) for all \(x,y\in X\)) binary relation on X (see [6, Chapter 4] or [7, Chapter 1.2.2]). For instance, the following binary relation \(\succeq \) with
is a weak order on \(\{1,2,3\}\). Note that the completeness of weak orders implies reflexivity. For each agent i and each two acceptable agents \(x,y\in V(\succeq _i)\) of i, the expression “\(x \succeq _i y\)” means that agent i weakly prefers x over y (i.e., i finds that x is at least as good as y). We use \(\succ _i\) to denote the asymmetric part of \(\succeq _i\) (i.e., \(x\succeq _i y\) and \(\lnot (y\succeq _i x)\), meaning that i strictly prefers x to y) and \(\sim _i\) to denote the symmetric part of \(\succ _i\) (i.e., \(x\succeq _i y\) and \(y \succeq _i x\), meaning that i values x and y equally).
Since a preference order \(\succeq \) can be decomposed into an asymmetric part \(\succ \) and a symmetric part \(\sim \), in the following when we illustrate a preference order, we only describe the \(\succ \) part and the “relevant” \(\sim \) part. For instance, the preference order \(\succeq \) as described in (1) will be depicted as follows:
Observe that we omitted the relations \(1\sim 1\), \(2\sim 2\), and \(3\sim 3\) for the sake of readability.
We assume that the acceptability relation between each two agents is symmetric, i.e., for each two distinct agents i and j it holds that “i finds j acceptable if and only if j finds i acceptable”, as otherwise i and j will never be partners of each other. Formally, this means that \(i\in V(\succeq _j)\) if and only if \(j \in V(\succeq _i)\). Moreover, since an agent that is not acceptable to any other agent will never obtain a partner, we also assume that for each agent i there is at least another agent \(j\ne i\) with \(i\in V(\succeq _j)\).
We note that although in Stable Roommates an agent cannot be matched to itself, it may still make sense to include an agent x in its own acceptable set, i.e., \(x \in V(\succeq _x)\), for instance when the preferences of x are based on how close or similar agents are to the ideal partner of x and a partner which is “identical” to x itself is an ideal partner of x. This has no implication at this point, because no agent can be matched to itself and “identical clones” do not exist. Allowing this, however, drastically simplifies definitions of restricted preferences in Sect. 2.3, in particular when narcissistic preferences are involved. We call an agent x a most acceptable agent of another agent y if for all \(z \in V(\succeq _y)\setminus \{x,y\}\) it holds that \(x \succeq _y z\), where \(\succeq _y\) denotes the preference order of y. Note that an agent can have more than one most acceptable agent.
Let \(X \subseteq V\) and \(Y \subseteq V\) be two disjoint sets of agents and \(\succeq \) be a binary relation over \(V\times V\). To simplify notation, by \(X\succeq Y\), we mean that for each two agents x and y with \(x\in X\) and \(y \in Y\) it holds that \(x\succeq y\). Analogously, by \(X \succ Y\) and \(X \sim Y\) we mean that for each two agents x and y with \(x\in X\) and \(y \in Y\) it holds that \(x\succ y\) and \(x \sim y\), respectively. For each binary relation symbol \(\star \in \{\succeq , \succ , \sim \}\), we use \(X \star y\) and \(y\star X\) as shortcut for \(X \star \{y\}\) and \(\{y\} \star X\), respectively.
To visualize which agent is considered as acceptable by an agent we introduce the notion of acceptability graphs. An acceptability graph G for a set V of agents is an undirected graph without loops, where an edge signifies that two distinct agents find each other acceptable. We use V to also denote the vertex set of G. Formally, for each agent \(i\in V\), there is a vertex i corresponding to agent i. There is an edge \(\{i,j\}\) in G if \(i \in V(\succeq _j) \setminus \{j\}\) and \(j \in V(\succeq _i)\setminus \{i\}\). As already discussed, we assume without loss of generality that G does not contain isolated vertices as otherwise the corresponding agents will never be able to obtain a partner. We illustrate two prominent special cases of acceptability graphs in Fig. 1.
2.2 Blocking pairs and stable matchings
Given a preference profile \(\mathcal {P}\) for a set V of agents, a matching \(M\subseteq E(G)\) is a subset of disjoint pairs \(\{x,y\}\) of agents with \(x\ne y\) (or edges in E(G)), where E(G) is the set of edges in the corresponding acceptability graph G. Slightly abusing notation, given an agent \(x\in V\), if there exists an agent \(y\in V\) with \(\{x,y\}\in M\), then we let M(x) \(\,{:}{=}\,y\) and say that x and y are partners of each other (under M); otherwise we let \(M(x)\,{:}{=}\,\bot \). We say that a pair \(\{x,y\}\) is unmatched (under M) if \(\{x,y\}\notin M\). A matching M is perfect if every agent is assigned a partner by M. An unmatched pair \(\{x,y\}\in E(G)\setminus M\) is blocking M if the pair “prefers” to be matched with each other rather than staying in their current state, i.e., it holds that
A matching M is stable if no unmatched pair is blocking M. When the preferences may contain ties, our stability concept is sometimes referred to as weak stability in the literature to distinguish from two other stability concepts, called strong stability and super stability [30]. When the preferences do not contain ties, all these three stability concepts are equivalent. In this work, we only focus on weak stability. For the sake of brevity, we thus simply use stability to refer to weak stability.
Example 1
Consider the following profile:
It admits exactly two stable matchings: \(M_1=\{\{1,2\}, \{3,4\}\}\), and \(M_2=\{\{1,4\}\), \(\{2,3\}\}\); both are perfect. However, if agent 3 changes its preference order to \(3\succ 1 \succ 2 \succ 4\), then the resulting profile does not admit any stable matching: One can check that for each matching, any agent i, \(1\le i \le 3\), that is matched to agent 4 will form a blocking pair together with the agent that is at the third position of the preference order of i.
We investigate the computational complexity of the following stable matching problem.
Stable Roommates
Input: A preference profile \(\mathcal {P}\) for a set \(V=\{1,2,\ldots , 2n\}\) of 2n agents.
Question: Does \(\mathcal {P}\) admit a stable matching?
2.3 Properties of a preference profiles
A preference profile \(\mathcal {P}\) may have one ore more of the following three simple properties:
Definition 1
(Completeness preferences with ties) A profile \(\mathcal {P}\) is complete if for each agent \(i\in V\) it holds that \(V(\succeq _i) \cup \{i\} = V\); otherwise it is incomplete. Profile \(\mathcal {P}\) is said to have a tie if there is an agent \(i \in V\) and there are two distinct agents \(x,y \in V(\succeq _i)\) with \(x \sim _i y\).
Note that complete preferences without ties are exactly linear orders on V.
Definition 2
(Narcissism) A profile \(\mathcal {P}\) is narcissistic if each agent i strictly prefers itself to every other acceptable agent, i.e., for each \(j\in V(\succeq _i)\setminus \{i\}\) it holds that \(i \succ _i j\).
The profile given in Example 1 is complete and narcissistic, and contains one tie.
We note that having complete preferences means that any two distinct agents can be matched with each other. Thus, a stable matching must be perfect. As for the narcissistic property alone, there is no restriction on or guarantee for the existence of a stable matching. We will, however, see that requiring some restricted preferences, such as singlepeaked or singlecrossing preferences as formally defined below, to be also narcissistic makes a difference (see for instance Example 2).
As already discussed in Sect. 1, the singlepeaked and the singlecrossing properties were originally introduced and studied mainly for linear preference orders (i.e., preferences without ties). For preferences with ties, a natural generalization is to think of a possible linear extension of the preferences for which the singlepeaked or singlecrossing property holds. We consider this variant in our paper.
Definition 3
(Singlepeakedness) Let \(\rhd \) be a linear order on the agent set V. An agent i with preference order \(\succeq _i\) is singlepeaked with respect to \(\rhd \) if for each three distinct agents x, y, z it holds that
Accordingly, profile \(\mathcal {P}\) is singlepeaked if there exists a linear order \(\rhd \) on V such that each agent from \(\mathcal {P}\) is singlepeaked with respect to \(\rhd \). We refer to \(\rhd \) as a singlepeaked order of the profile.
Example 2
The profile given in Example 1 is narcissistic and singlepeaked with respect to the linear order \(1\rhd 2 \rhd 3 \rhd 4\). See Fig. 2a for an illustration. In fact, as we will see in Sect. 3, a narcissistic and singlepeaked preference profile always admits a stable matching.
Recall that if agent 3 changes its preference order to \(3\succ 1 \succ 2 \succ 4\), then the resulting profile does not admit any stable matching and, indeed, it is also not singlepeaked anymore.
Just as for the singlepeakedness property, the singlecrossingness property also requires a natural linear order of the agents, the socalled singlecrossing order. However, unlike the singlepeakedness property which assumes that the preferences of an agent i over two agents are compared by their “distance” to the peak along the singlepeaked order, the singlecrossingness property assumes that the agents’ preferences over each two distinct agents change (cross) at most once.
In fact, for preferences with ties, two natural singlecrossing notions are of interest. To describe them, we introduce two notions that can be used to partition a subset of agents according to their preferences over two distinct agents. Given a preference profile \(\mathcal {P}=(\succ _i)_{i \in V}\), for each two distinct agents x and y, let
denote the subset of agents i that strictly prefer x to y (i.e., x is better than y), and let
denote the subset of agents i that find x and y to be of equal value (i.e., x and y are tied with each). Here, symbol B means “better than” while symbol T means “tied with”.
Definition 4
(Singlecrossingness) Let \(\rhd \) be a linear order on the agent set V. A preference profile \(\mathcal {P}=(\succeq _i)_{i\in V}\) is singlecrossing with respect to the linear order \(\rhd \) if there exists a preference profile \(\mathcal {P}'=(\succeq '_i)_{i\in V}\) without ties such that the following two conditions hold.

(i)
For each agent \(i\in V\), the order \(\succeq '_i\) is a linear extension of \(\succeq _i\), i.e., the order \(\succeq '_i\) is a linear order on the acceptable set \(V(\succeq _i)\) with \(\succ _i \subseteq \succ '_i\).

(ii)
For each two distinct agents \(x,y\in V\) it holds that \(T_{\mathcal {P}'}(x,y)=\emptyset \) such that either \(B_{\mathcal {P}'}(x,y)\rhd B_{\mathcal {P}'}(y,x)\) or \(B_{\mathcal {P}'}(y,x)\rhd B_{\mathcal {P}'}(x,y)\).
Accordingly, profile \(\mathcal {P}\) is singlecrossing if there exists a linear order \(\rhd \) on the agent set V such that \(\mathcal {P}\) is singlecrossing with respect to \(\rhd \).
Example 3
The profile from Example 1 is singlecrossing with respect to the linear order \(1 \rhd 2 \rhd 3 \rhd 4\). See Fig. 2b for an illustration.
We also consider a more restricted concept of singlecrossingness which requires that the agents that have ties towards a pair are “ordered in the middle”.
Definition 5
(Tiesensitive singlecrossingness) Again, let \(\rhd \) be a linear order on the agent set V. A profile \(\mathcal {P}\) on V is tiesensitive singlecrossing with respect to the order \(\rhd \) if for each two distinct agents x and y it holds that
See Fig. 3 for an illustration of the different types of restricted preferences for the case where the input preference orders are complete and contain no ties.
2.4 Basic observations for the structural properties of preferences
Incomplete preferences with ties, i.e., weak orders, as used in this work are incomparable to partial orders because partial orders are antisymmetric. However, the asymmetric part of a weak order is indeed a partial order. There are many slightly different concepts of singlepeakedness and singlecrossingness for partial orders [20, 25, 37]. It is known that detecting singlepeakedness or singlecrossingness is NPhard for partial orders under most of the concepts studied in the literature [2, 4, 8, 18, 19, 22]. For partial orders, our two singlecrossing concepts are incomparable. In particular, there are incomplete preferences with ties which are singlecrossing but not tiesensitive singlecrossing, and the converse also holds. For complete preferences with ties which is a restricted case of partial orders, Elkind et al. [20] showed that tiesensitive singlecrossing preference profiles are a strict subset of singlecrossing preference profiles. In the following, we extend these results by considering the case when the preferences can be incomplete.
Proposition 1

(1)
For preferences without ties, tiesensitive singlecrossing ness is equivalent to singlecrossingness.

(2)
For preferences with ties, singlecrossingness does not always imply tiesensitive singlecrossing ness.

(3)
For preferences with ties, tiesensitive singlecrossing ness implies singlecrossingness.
Proof
Statement (1) follows from the observation that when a profile does not have any ties, the definitions of singlecrossingness (Definition 4) and tiesensitive singlecrossingness Definition 5 coincide. The preference profile given in Fig. 3b is singlecrossing but not tiesensitive singlecrossing , which shows Statement (2).
It remains to show Statement (3). Let \(\mathcal {P}=(\succeq _i)_{i\in V}\) be a profile which is tiesensitive singlecrossing with respect to some linear order \(\rhd \) on V. We resolve the ties in the preferences given in \(\mathcal {P}\) according to an arbitrary but fixed order on V and show that this extended profile fulfills the conditions given in the definition for tiesensitive singlecrossingness (see Definition 5). To this end, let \(\blacktriangleright \) be an arbitrary but fixed linear order on V and let \(\mathcal {P}'=(\succeq '_i)_{i\in V}\) be a copy of the profile \(\mathcal {P}\) with \(\succeq '_i=\succeq _i\), \(i\in V\). For each agent \(i\in V\) and for each pair \(\{x,y\}\subseteq V(\succeq _i)\) of agents acceptable to i such that \(x\sim _i y\), let \(x \succ '_i y\) (i.e., delete (x, y) from \(\succeq '_i\)) if and only if \(x \blacktriangleright y\). In this way, for each agent i and for each two distinct agents \(x,y \in V(\succeq _i)\) acceptable to i, we have that
since the preference order \(\succeq _i\) is a weak order on \(V(\succeq _i)\).
First of all, we claim that \(\mathcal {P}'\) fulfills the first condition given in Definition 4. For the sake of contradiction, suppose that there is an agent i such that \(\succeq '_i\) is not a linear extension of \(\succeq _i\). Observe that by our construction, \(\succeq '_i\) is a complete binary relation on \(V(\succeq _i)\). Moreover, for each two acceptable agents \(x, y \in V(\succeq _i)\) it holds that \(x\succ _i y\) implies that \(x \succ '_i y\). Hence, the assumption that \(\succeq '_i\) is not a linear extension of \(\succeq _i\) means that \(\succ '_i\) is not transitive, i.e., there are three acceptable agents \(x,y,z\in V(\succeq _i)\) with
By Property (2), we infer that \(x\succeq _i y\), \(y \succeq _i z\), and \(z \succeq _i x\). By the transitivity of \(\succeq _i\), these three relations imply that \(x\sim _i y\), \(y \sim _i z\), and \(z \sim _i x\).
This means that the pairwise relative orders of x, y, z in \(\succeq '_i\) are resolved according to the order \(\blacktriangleright \), i.e., \(x\blacktriangleright y\), \(y\blacktriangleright z\), and \(z\blacktriangleright x\)—a contradiction to \(\blacktriangleright \) being transitive.
It remains to show that \(\mathcal {P}'=(\succeq '_i)_{i\in V}\) is singlecrossing with respect to \(\rhd \). Suppose towards a contradiction that \(\mathcal {P}'\) is not singlecrossing with respect to \(\rhd \), and suppose that there are three agents i, j, k in the order \(i\rhd j \rhd k\) and there are two acceptable agents \(x,y\in V(\succeq '_i)\cap V(\succeq '_j) \cap V(\succeq '_k)\) such that
By Property (2), we infer that
We distinguish between two cases for \(x \succeq _j y\), in each case aiming at reaching a contradiction.
If \(x\sim _j y\), then by (4) it follows that \(y \blacktriangleright x\) and that \(\lnot (y\sim _i x)\) and \(\lnot (y \sim _k x)\). Thus, by (5), it follows that \(x \succ _i y\) and \(x\succ _k y\)—a contradiction to \(\rhd \) being a tiesensitive singlecrossing order for \(\mathcal {P}\).
If \(y \succ _j x\), then since \(\rhd \) is a tiesensitive singlecrossing order for \(\mathcal {P}\), by (5) it follows that \(\lnot (x\succ _i y)\) or \(\lnot (x \succ _k y)\). This implies that \(x\sim _i y\) or \(x \sim _k y\). If \(x \sim _i y\), then \(y \succ _k x\)—a contradiction to (5). If \(x \sim _k y\), then \(y \succ _i x\)—again a contradiction to (5).\(\square \)
For incomplete preferences with ties, Lackner [37] showed that detecting singlepeakedness is NPcomplete. For complete preferences with ties, while Elkind et al. [20] showed that detecting singlecrossingness is NPcomplete, Fitzsimmons [24] and Elkind et al. [20] provided polynomialtime algorithms for detecting singlepeakedness and tiessensitive singlecrossingness, respectively. All these known hardness results seem to hold only when the preferences have ties. However, we observe that the hardness reduction for Corollary 6 of Elkind et al. [20] indeed can be adapted to show NPhardness for deciding whether an incomplete preference profile without ties is singlepeaked (resp. singlecrossing). The crucial differences are that they allow ties and that the agents and the alternatives are different while we do not allow ties and our agent set is the same as the set of alternatives. For the sake of completeness, we show this adapted reduction.
Proposition 2
Deciding whether a preference profile with incomplete preferences and without ties is singlecrossing (or equivalently tiesensitive singlecrossing) or singlepeaked is NPcomplete.
Proof
The three decision problems are clearly contained in NP as given a linear order \(\rhd \) on the agent set one can verify in polynomialtime whether the given preference profile is singlecrossing, tiesensitive singlecrossing, or singlepeaked with respect to the order \(\rhd \); note that the preferences do not contain ties.
To show NPhardness, as Elkind et al. [20], we reduce from the NPhard Betweenness problem [46]:
Betweenness
Input: Given a universe \(U= \{u_1,\ldots ,u_n\}\) and a set \(T=\{t_1,\ldots ,t_m\}\) of ordered triples over U.
Question: Is there a betweenness order \(\blacktriangleright \), that is, a total linear order over U such that for each triple (x, y, z) from T it holds that either \(x \blacktriangleright y \blacktriangleright z\) or \(z \blacktriangleright y \blacktriangleright x\)?
The reduction for the singlepeaked case is quite simple while the reduction for the singlecrossing case is similar to the one used by Elkind et al. [20, Corollary 6].
The singlepeakedness case. Given an instance \(I=(U,T)\) of Betweenness, where \(U=\{u_1,\ldots ,u_n\}\) and \(T=\{t_1,\ldots ,t_m\}\), we construct a preference profile \(\mathcal {P}=(\succ _x)_{x\in V}\) for an agent set V, whose preferences contain no ties but may be incomplete; without loss of generality we assume that the elements in each ordered triple \((x,y,z)\in T\) are pairwise distinct.
The agent set V has two types of agents, which sum up to \(n+2m\) agents. First, for each element \(u_i\) add to V an element agent with the same name. Second, for each triple \(t_j=(x,y,z)\) from T (with \(x,y,z \in U\)) add to V two agents \(a_j\) and \(a'_j\). We will construct the preference orders of \(a_j\) and \(a'_j\) to ensure that the second element y in triple \(t_j\) is ordered between the other two elements x and y in a betweeness order.
The preference orders of the agents are constructed as follows:

Each element agent \(u_i \in U\) only finds those agents acceptable that “contain” \(u_i\), and has a linear order on these acceptable agents that are consistent with the following order
$$\begin{aligned} L\,{:}{=}\,a_1 \succ \cdots \succ a_m \succ a'_1 \succ \cdots \succ a'_m. \end{aligned}$$Formally, the preference order of agent \(u_i\) is
$$\begin{aligned} \succ _{u_i}:[A(u_i)] \succ [A'(u_i)], \end{aligned}$$where \(A(u_i)=\{a_j\mid u_i \in t_j\}\) (resp. \(A'(u_i)=\{a'_j\mid u_i \in t_j\}\)) and \([A(u_i)] \succ [A'(u_i)]\) is a linear order on \(A(u_i) \cup A'(u_i)\) that respects L.

For each triple \(t_j=(x,y,z) \in T\), the preference orders of \(a_j\) and \(a'_j\) are
$$\begin{aligned} \succ _{a_j}:y \succ x \succ z \text { and } \succ _{a'_j}:y \succ z \succ x. \end{aligned}$$
We show that \(\mathcal {P}\) is singlepeaked if and only if the given instance is a yesinstance. On the one hand, every betweenness order \(\blacktriangleright \) for \(I=(U,T)\) can be extended to a singlepeaked order for \(\mathcal {P}\) by appending to \(\blacktriangleright \) the order L. On the other hand, note that the preference orders of the agents of the second type require a singlepeaked order to place element y in between x and z. Thus, a singlepeaked order \(\rhd \) for \(\mathcal {P}\) restricted to U is also a betweenness order for (U, T).
The singlecrossingness and tiesensitive singlecrossingness case. Since for preferences without ties, singlecrossingness is equivalent to tiesensitive singlecrossingness (see Proposition 1(1)) we only focus on the singlecrossingness case. Given an instance \(I=(U,T)\) of Betweenness, where \(U=\{u_1,\ldots ,u_n\}\) and \(T=\{t_1,\ldots ,t_m\}\), we construct a preference profile \(\mathcal {P}=(\succ _x)_{x\in V}\) for an agent set V, whose preferences contain no ties but may be incomplete; without loss of generality we assume that the elements in each ordered triple \((x,y,z)\in T\) are pairwise distinct.
The agent set V has two types of agents, which sum up to \(n+3m\) agents. First, for each element \(u_i\) add to V an element agent with the same name. Second, for each triple \(t_j=(x,y,z)\) from T (with \(x,y,z \in U\)) add to V three agents \(a_j,b_j, c_j\). Again, we will construct the preference orders of \(a_j, b_j\), and \(c_j\) to ensure that the second element y is ordered between the other two elements x and z. Before we describe how to construct the preference orders, let us describe the acceptable set of each agent: For each triple \(t_j=(x,y,z)\) from T (with \(x,y,z \in U\)) let
Symmetrically, for each element agent \(u\in U\), let \(V(u) \,{:}{=}\,\{a_j,b_j,c_j \mid u \in t_j\}\). For ease of notation, for each triple \(t_j\in T\), let \(T_j \,{:}{=}\,\{a_j,b_j,c_j\}\).
The preference orders of the agents are constructed as follows:

For each triple \(t_j =(x,y,z)\) from T, the preference orders of agents \(a_j\), \(b_j\), and \(c_j\) are the same linear order on \(\{x,y,z\}\), which is ascending on the indices of x, y, z in U.

For each element agent \(u\in U\), construct the preference order \(\succ _u\) of u such that for each two triples \(t_j\) and \(t_{j'}\) with \(j < j'\) that contain the element u it holds that
$$\begin{aligned} \succ _u:T_j \succ T_{j'}. \end{aligned}$$The specific order on the triple agents in \(T_j\) (resp. \(T_{j'}\)) depends on the position of u in the triple \(t_j\). To this end, let
$$\begin{aligned} L_j^x&\,{:}{=}\,a_j \succ b_j \succ c_j,\\ L_j^y&\,{:}{=}\,b_j \succ a_j \succ c_j,\\ L_j^z&\,{:}{=}\,c_j \succ b_j \succ a_j. \end{aligned}$$To make the preference order of u a linear order, for each triple \(t_j\in T\) with \(t_j=(x,y,z)\) that contains the element u, let \(\succ _u\) obey the order \(L_j^{k}\) if and only if \(u=k\).
We show that \(\mathcal {P}\) is singlecrossing if and only if the given instance is a yesinstance. On the one hand, a singlecrossing order \(\rhd \) for the constructed profile restricted to U is a betweenness order for (U, T): For every triple \(t_j=(x,y,z)\) from T the preference orders of x, y, and z restricted to \(T_j\) imply that either \(x \rhd y \rhd z\) or \(z \rhd y \rhd x\). On the other hand, a betweenness order \(\blacktriangleright \) for (U, S) can be extended to a singlecrossing order for the constructed profile by appending the order \(\blacktriangleright a_1 \blacktriangleright b_1 \blacktriangleright c_1 \blacktriangleright \cdots \blacktriangleright a_m \blacktriangleright b_m \blacktriangleright c_m\) to its end. \(\square \)
Saporiti and Tohmé [52] showed that for complete preferences without ties, narcissistic and singlecrossing preferences are also singlepeaked. We strengthen this result by showing that the relation also holds when ties are allowed. Further, we note that although Barberà and Moreno [3] also considered complete preferences with ties, their singlecrossingness for the case with ties only resembles our tiesensitive singlecrossing definition, which is a strict subset of the singlecrossingness defined in Definition 4 (also see Proposition 1(2)–(3)).
Proposition 3
If a complete, even with ties, and narcissistic preference profile \(\mathcal {P}\) admits a singlecrossing order \(\rhd \), then this order \(\rhd \) is also a singlepeaked order.
Proof
Suppose for the sake of contradiction that \(\rhd \) with \(a_1\rhd a_2 \rhd \dots \rhd a_{2n}\) is not singlepeaked. This means that there exists an agent \(a_i\) that is not singlepeaked with respect to \(\rhd \), and there are three agents \(a_j,a_k,a_\ell \) with \(a_j \rhd a_k \rhd a_{\ell }\) such that \(a_j\succ _{a_i} a_k\) and \(a_\ell \succ _{a_i} a_k\). Together with the property of being narcissistic, the following holds:
On the one hand, the agents’ preferences over the pair \(\{a_j, a_k\}\) implies that \(i < k\). On the other hand, the pair \(\{a_k, a_\ell \}\) implies that \(i > k\)—a contradiction. \(\square \)
The profile shown in Fig. 2 is narcissistic and singlecrossing with respect to the order \(1\rhd 2 \rhd 3 \rhd 4\) and it is also singlepeaked with respect to the same order \(\rhd \).
There is no direct relation between singlepeakedness and singlecrossingness, even if the profile is complete and do not contain ties [9].
Proposition 4
Even for complete preference profiles without ties, singlepeakedness does not imply singlecrossingness. Neither does singlecrossingness imply singlepeakedness.
Proof
The statements are indicated in [9, Figure 1]. For the sake of completeness, however, we show the statements through the following two concrete profiles.
Consider the following profile with four agents 1, 2, 3, 4:
One can verify that profile \(\mathcal {P}_1\) has complete preferences without ties, and is singlepeaked with respect to the linear order \(3 \rhd 1 \rhd 2 \rhd 4\). However, it is not singlecrossing because agents 1, 2, 3, and 4 form a forbidden configuration of singlecrossingness [8].
Consider the following profile with four agents 1, 2, 3, 4:
Since there are only two different preference orders, profile \(\mathcal {P}_2\) is obviously singlecrossing, for instance, with respect to the linear order \(1\rhd 2\rhd 3\rhd 4\). However, it is not singlepeaked since agent 1 and agent 3 form a forbidden configuration of singlepeakedness [2]. \(\square \)
3 Complete preferences
In this section, we analyze the computational complexity of Stable Roommates for the case when the input preference profiles have complete and structured preferences. In particular, we show that the NPhard Stable Roommates problem with ties allowed becomes polynomialtime solvable when the preferences are narcissistic and either singlecrossing or singlepeaked.
For the case of complete, narcissistic, and singlepeaked preferences without ties, Bartholdi III and Trick [4] showed that there is always a unique stable matching and provided an algorithm to find it. Their algorithm is based on the following two facts (referred to as Propositions 5 and 6) that are related to the concept of most acceptable agents. We show that the facts transfer to the case with ties.
Proposition 5
If the given preference profile \(\mathcal {P}\) is complete (even with ties), narcissistic, and singlepeaked, then there are two distinct agents i, j that are each other’s most acceptable agents.
Proof
The statement for complete, narcissistic, and singlepeaked preferences without ties was shown by Bartholdi III and Trick [4]. It turns out that this also holds for the case when ties are allowed. Let V be the set of all 2n agents and consider a singlepeaked order \(\rhd \) of the agents V with \(x_1\rhd x_2\rhd \dots \rhd x_n\). For each agent \(x\in V\), let \(M_x\) be the set of all most acceptable agents of x. Towards a contradiction, suppose that each two distinct agents x and y have \(x\notin M_y\) or \(y\notin M_x\). By the narcissistic property and singlepeakedness, each \(M_x\cup \{x\}\) forms an interval in \(\rhd \). This implies that the first agent \(x_1\) and the last agent \(x_n\) in the order \(\rhd \) have \(x_2\in M_{x_1}\) and \(x_{n1} \in M_{x_n}\). By our assumption (\(x\notin M_y\) or \(y\notin M_x\)), however, \(x_2 \in M_{x_1}\) implies that for each \(i\in \{2,\dots , n\}\) the following holds: \(x_{i1}\notin M_{x}\)—a contradiction to \(x_{n1}\in M_{x_n}\). \(\square \)
By the stability definition, we obtain the following for complete preferences.
Proposition 6
Let \(\mathcal {P}\) be a preference profile with complete preferences and let M be a stable matching for \(\mathcal {P}\). Let \(\mathcal {P}'\) be a preference profile resulting from \(\mathcal {P}\) by adding two agents x, y who consider each other as most acceptable (and their preferences over other agents and the preferences of other agents over x, y are arbitrary but fixed, respectively). Then, matching \(M\cup \{\{x, y\}\}\) is stable for \(\mathcal {P}'\).
Proof
Suppose for the sake of contradiction that \(M\cup \{\{x, y\}\}\) is not stable for \(\mathcal {P}'\). This means that \(\mathcal {P}'\) has a blocking pair \(\{u,w\}\notin M\). Obviously, \(\{u,w\}\cap \{x,y\} = 1\) as otherwise \(\{u,w\}\) would also be a blocking pair for \(\mathcal {P}\). Assume without loss of generality that \(u = x\). Then, by the definition of blocking pairs, it must hold that \(w \succ _x y\)—a contradiction to y being one of the most acceptable agents of x. \(\square \)
Utilizing restricted versions of Propositions 5 and 6, Bartholdi III and Trick [4] derived a greedy algorithm to construct a unique stable matching when the preferences are linear orders (i.e., complete and without ties) and are narcissistic and singlepeaked (see Algorithm 1). For 2n agents they claimed that their algorithm runs in O(n) time by observing that, after adding a pair to the solution matching, at most two other agents need to update their most acceptable agent. However, since updating the most acceptable agent may take O(n) time, it is not clear how to implement their algorithm to achieve O(n) running time. Indeed, by generalizing their example Bartholdi III and Trick [4, Section 3] to the case with 2n agents, we show the following: Assuming, as input, an integer vector for each agent is given, which lists the agents in order of its preferences, their algorithm may take \(O(n^2)\) time, even if the singlepeaked order is known.
Example 4
We consider a complete, narcissistic, singlepeaked, and singlecrossing preference profile \(\mathcal {P}_n\) without ties, for 2n agents. The preference orders will be pasted together from the following “preference pieces” \(X_i\) and \(Y_i\) with \(i \in [n]\):
Note that for every \(i\in [n]\), the piece \(X_i\) covers contiguous interval of \(2n2i\) alternatives. Together with the pieces \(Y_1\), \(Y_2\), \(\ldots \), \(Y_{i1}\), all but two alternatives are covered: i and \(2n+1i\) are the only alternatives that are not covered.
Now, let us define the preference orders of the agents in the profile. For each \(i\in [n]\) the two agents i and \(2n+1i\) have “almost” opposite preferences:
where \(\overleftarrow{X_i}\) and \(\overleftarrow{Y_j}\) (\(j\in [i1]\)) denote the reverse preference orders of \({X_i}\) and \({Y_j}\), respectively.
Observe that, for \(i = 1\), the preference pieces \(Y_{i1}\succ Y_{i2} \succ \ldots \succ Y_1\) and \(\overleftarrow{Y_{i1}}\succ \overleftarrow{Y_{i2}} \succ \ldots \succ \overleftarrow{Y_1}\) are empty. Thus, the first agent and the last agent have reverse preference orders \(1\succ 2 \succ \cdots \succ 2n\) and \(2n\succ 2n1 \succ \cdots \succ 1\), respectively.
For \(n=3\), the corresponding preference profile \(\mathcal {P}_3\) looks as follows:
Singlepeakedness and singlecrossingness. Profile \(\mathcal {P}_n\) is singlepeaked and singlecrossing with respect to the canonical order \(1\rhd 2 \rhd \ldots \rhd 2n\). To see why it is singlecrossing with respect to this order, we observe the following, which covers all possible pairs of agents:

For each agent \(i \in [n1]\) and each agent \(j \in [2ni]\setminus [i]\), all agents from [i] prefer i to j while all agents from \([2n]\setminus [i]\) prefer j to i.

For each agent \(k \in [2n]\setminus [n+1]\) and each agent \(j\in [k1]\setminus [2n+1k]\), all agents from \([k1]\) prefer j to k while all agents from \([2n]\setminus [k1]\) prefer k to j.

For each agent \(z \in [n]\), all agents from [n] prefer z to \(2n+1z\) while all agents from \([2n]\setminus [n]\) prefer \(2n+1z\) to z.
This profile contains a unique stable matching M with
Running time of Bartholdi III and Tricks’ algorithm (see Algorithm 1). First, observe that due to the preference orders of agents 1 and 2n, the canonical order \(\rhd \) as described above is the unique singlepeaked order (up to reversal). Hence, let us assume that the preference orders of \(\mathcal {P}_n\) and the order \(\rhd \) are given as input. Applying the algorithm of Bartholdi III and Trick [4] (see Algorithm 1), in the first round, each agent \(i\in [n]\) regards its “successor agent” \(i+1\) (along \(\rhd \)) as the most acceptable agent while each agent \(k\in [2n]\setminus [n]\) regards its “predecessor agent” \(k1\) (along \(\rhd \)) as the most acceptable agent. Thus, in this round, agents n and \(n+1\) are the only agents that regard each other as most acceptable. We find them in O(n) time and add \(\{n,n+1\}\) to M.
In the second round, agents \(i\,{:}{=}\,n1\) and \(j\,{:}{=}\,n+2\) have to update their most acceptable agents since their currently most acceptable ones are matched with each other. But the updating time of each agent depends on the number of pairs that are already in the solution M no matter what \(\rhd \) looks like since in general the “successor” or “predecessor” of i or j might already have been matched in some previous round. For agents \(n1\) and \(n+2\), we need to traverse to the third agent in their preference orders to find one which are unmatched. In this case, \(n1\) and \(n+2\) find each other most acceptable after \(\{n,n+1\}\) is added to M.
For our profile, in round z, starting from \(z=2\), we need to update the most acceptable agents of agents \(nz+1\) and \(n+z\) since the pair \(\{nz+2, n+z1\}\) is added to M in round \(z1\). To update, we need to go through the preference orders of \(nz+1\) and \(n+z\) until we find a next most acceptable and notyetmatched agent. This takes O(z) time because both agents \(nz+1\) and \(n+z\) have not updated their most acceptable agents but prefer all matched agents to their next most acceptable and notyetmatched one. Summarizing, we need \(O(n+2+4+\ldots +2n)=O(n^2)\) time to construct a unique stable matching, if we assume that the input contains the preference orders of all agents (implemented as integer vectors) and a singlepeaked order of the agents.
For the case with ties, we will show that Algorithm 1 also works for narcissistic, singlepeaked profiles. In particular, there is always a stable matching, albeit perhaps not unique.
Proposition 7
A complete, narcissistic, singlepeaked, and (tiesensitive) singlecrossing preference profile with ties may admit more than one stable matching.
Proof
To show the statement, let us consider the following profile:
Since each agent regards every other agent as equally good, any perfect matching is a stable matching. Since the profile is complete and has four agents, there are \(\left( {\begin{array}{c}4\\ 2\end{array}}\right) /2=3\) perfect matchings which are all stable. It is also straightforward to verify that the profile is narcissistic, singlepeaked, and (tiesensitive) singlecrossing with respect to the order \(1\rhd 2 \rhd 3 \rhd 4\). \(\square \)
Next, we show that the idea behind Bartholdi III and Trick’s algorithm (see Algorithm 1) also works for the case with ties.
Theorem 1
If a preference profile with 2n agents is complete, possibly with ties, narcissistic and singlepeaked, then it always admits a stable matching, which can be found in \(O(n^2)\) time.
Proof
To show that such a profile \(\mathcal {P}\) always admits a stable matching, we show that on input \(\mathcal {P}\) Algorithm 1 always returns a matching of \(\mathcal {P}\) which is stable. Indeed, the latter follows directly from Propositions 5 and 6 and the narcissistic and singlepeaked property is preserved after deleting any agent.
As for the running time, there are n rounds to build up M, and in each round we find two distinct agents x and y whose most acceptable agent sets \(M_x\) and \(M_y\) (in the updated profile) include x respectively y:
Note that Proposition 5 implies that two such agents exist. One way to search for two such agents is to go through all pairs \(\{x,y\}\) and check whether Condition (6) holds. This leads to an algorithm with running time \(O(n^3)\). To obtain an \(O(n^2)\)time algorithm, however, we observe that we only need to check an agent pair \(\{x,y\}\) upon Condition (6) when the most acceptable agents of one of x and y, say x, are all matched (in previous rounds) such that y is the next less preferred agent by x. This guarantees that we have to check each pair of agents at most twice, once for x and once for y. In total, we can find a stable matching in \(O(n^2)\) time.
We describe this idea in Algorithm 2 (see ComputeStableMatching()), which uses only simple data structures such as integer matrices and vectors.
As input, we assume that for each agent x there is an integer vector \(L_x\) that lists the agents in order of the preferences of x, with ties resolved in an arbitrary way. Moreover, we assume to have an \(n \times n\) integer rank matrix R where R[x, y] contains the rank of agent x in the preference list of agent y. Herein, the rank of agent y in agent x’s preference list is defined as the number of agents that are strictly preferred to y by x. For example, if the preference list of agent 1 is \(1 \succ 2 \succ 3 \sim 4 \succ 5 \sim 6 \succ 7\), then we may have \(L_1=[1,2,3,4,5,6,7]\) and have \(R[1,1] = 0\), \(R[1,2]=1\), \(R[1,3]=2\), \(R[1,4]=2\), \(R[1,5]=4\), \(R[1,6]=4\), and \(R[1,7]=6\).
Before we show the correctness of Algorithm 2, we first claim the following. Each call of InsertMostPreferred(z)

(a)
assumes \(D[z]=0\),

(b)
finds all unmatched agents \(y'\) which are tied with agent \(L_z[p_z]\) and sets \(A[z,y']=1\) (Lines (17)–(23)), and

(c)
pushes a possible matching event \(\{z,y'\}\) to Q if, additionally, \(y'\) also finds z most acceptable (Lines (20)–(21)).
For the first calls of InsertMostPreferred(z) in Line (5), the above invariant is straightforward to verify: The matrix A and the vector D are initialized with allzero entries, and \(p[z]\) points to a position in the preference list \(L_z\) of z such that InsertMostPreferred(z) goes through the preference list \(L_z\) of z, using pointer \(p[z]\), and finds all most acceptable agents of z, updating the row A[z], until \(p[z]\) points to a position which contains an agent that is strictly less preferred.
For each following execution of InsertMostPreferred(z), observe that the procedure is only called when \(D[z]=0\) and when \(B[z]=0\). Since B[z] is increased whenever some entry A[z, x] is set from zero to one and decreased whenever some entry A[z, x] is set from one to zero, this implies that \(A[z,x]=0\) holds for each agent \(x\in V\) when the procedure is called. Moreover, at the beginning of the execution of InsertMostPreferred(z) (except the first call), integer \(p_z\) points to the position of the first agent in the list \(L_z\) that is strictly less preferred than all agents that were previously inserted into A. Now, whenever called, InsertMostPreferred(z) uses \(p[z]\) to continue iterating through the preference list \(L_z\). Only unmatched agents \(L_z[p[z]]\) (see Line (17)) that are mostpreferred by z are inserted into the matrix A by setting \(A[z,y']=1\) until either the end of the the preference list \(L_z\) is reached (i.e., \(p[z]=n+1\)), or at least one agent was inserted (i.e., \(B[z]>0\)) such that \(p_z\) points to the position of an agent that is strictly less preferred to the just inserted agent (stored as \(y'\)).
Now, to show the correctness of Algorithm 2, we need to show

(i)
whenever Algorithm 2 adds a pair \(\{x,y\}\) to M, then x and y indeed are each other’s most acceptable agents (under the profile where all pairs previously added to M are deleted), and

(ii)
there is always a possible pair in the queue Q where both agents are still unmatched.
To verify (i), clearly, the first pair that is added to M satisfies (i). Assume that \(\{x_i,y_i\}\) is the \(i^{\text {th}}\) pair added to M such that all \(i1\) previous pairs \(q_1,\ldots , q_{i1}\) added to M satisfy (i). Suppose, for the sake of contradiction, that \(y_i\) is not one of the most acceptable agents of \(x_i\), after all agents in the pairs \(q_1,\ldots ,q_{i1}\) are deleted from the profile. Let y be a notyetmatched agent that is strictly preferred to \(y_i\) by \(x_i\). Now, consider the call InsertMostPreferred when \(\{x_i,y_i\}\) is pushed to Q. By (b) and since \(p_z\) is nonedecreasing, it follows that \(\{x_i,y\}\) is added to Q in a previous round. This means that \(\{x_i,y\}\) must be considered before \(\{x_i,y_i\}\) in the queue Q and will thus be added to M, a contradiction.
As for (ii), observe that whenever the algorithm pops a pair from Q, the queue Q contains every pair of agents that currently consider each other most acceptable (see (b) and (c)). The queue Q may contain further pairs of agents where one or both agents are already deleted; these pairs, however, will be detected (Line (8)) and ignored by the algorithm. Thus, the existence follows analogously to the one for Algorithm 1. Finally, we analyze the running time. First of all, every agent x is deleted (by calling SmartDelete(x)) at most once. Each call of SmartDelete(x) takes O(n) steps (some constant number of operations, adjusting one row and one column in A, each of size n), plus some calls of InsertMostPreferred. Second, InsertMostPreferred takes amortized O(n) running time for each agent z since it iterates through the preference list of z only once. Third, after the initialization, every entry A[x, y] is set from zero to one at most once (see Line (19)), which happens only when A[x, y] was zero. It is reset to zero at most once, which happens only when SmartDelete(x) or SmartDelete(y) is called and when A[x, y] was one (see Lines (27) and (29)). Since \(\{x,y\}\) is only pushed to Q in InsertMostPreferred(x) or InsertMostPreferred(y) when \(A[x,y]=A[y,x]=1\) and \(D[x]=D[y]=0\) (see (a) in the above reasoning and Lines (17), (19), and (20)), it follows that \(\{x,y\}\) can be pushed to the queues Q at most once. Since there are \(O(n^2)\) pairs that can be added to Q and since SmartDelete is only called whenever a pair is added to M, ComputeStableMatching indeed takes \(O(n^2)\) time. \(\square \)
Now, we move on to (tiesensitive) singlecrossingness.
Proposition 8
If a preference profile with 2n agents is complete, with ties, narcissistic and singlecrossing, then it always admits a stable matching, which can be found in \(O(n^2)\) time.
Proof
By Theorem 3 and Proposition 1(1), the stated profiles are singlepeaked. By Theorem 1, we obtain the desired statement. \(\square \)
4 Incomplete preferences
In this section, we consider the case when the input may contain incomplete preferences, meaning that the underlying acceptability graph may not be a complete graph. One reason for the occurrence of incomplete preferences could be that two agents may consider each other unacceptable and do not want to be matched together, or they are not “allowed” to be matched to each other. If in this case no two agents are considered of equal value by any agent (i.e., the preferences do not have ties), then Stable Roommates still remains polynomialtime solvable [30]. However, once ties are involved, Stable Roommates becomes NPcomplete [48] even for complete preferences.
First of all, we observe that once ties are allowed, neither singlepeakedness nor singlecrossingness, combined with narcissism, can guarantee that there are always two agents that are each other’s most acceptable agent (see Proposition 9(3)). However, having two such agents is crucial for the existence of a stable matching so that it can be found by the algorithm by Bartholdi III and Trick [4] (see Algorithm 1). Moreover, for incomplete preferences, even without ties, narcissistic and singlecrossing preferences do not imply singlepeakedness anymore.
Proposition 9
For incomplete preferences without ties, the following holds.

(1)
Narcissistic and singlecrossing preferences are not necessarily singlepeaked.

(2)
Narcissistic and singlepeaked (resp. singlecrossing) preferences do not guarantee the uniqueness of stable matchings.

(3)
Narcissistic and singlepeaked (resp. singlecrossing) preferences do not guarantee the existence of stable matchings.
Proof
Statement (1): Consider the following profile with six agents \(1,2,\ldots , 6\):
One can check that the profile is narcissistic, and it is singlecrossing with respect to the order \(5 \rhd 6 \rhd 2 \rhd 3 \rhd 4 \rhd 1\). But it is not singlepeaked with respect to \(\rhd \) because agent 1’s preference order on \(\{1,3,4\}\) is not singlepeaked with respect to \(\rhd \). In fact, the profile is not singlepeaked at all since the preference orders of agents 1, 2, and 3 restricted to the alternatives \(\{1,5,6\}\) form a forbidden subprofile (the socalled worstconfiguration) for the singlepeaked property [2]: In a singlepeaked order, regarding the preference orders of agents 1 and 2, agent 5 must be ordered between 1 and 6, which is not possible because of the preference order of agent 3. The profile does not admit a perfect stable matching, i.e., a stable matching of size three. But it admits two stable matchings of size two each: \(\{\{1,3\},\{2,4\}\}\) and \(\{\{1,4\}, \{2,3\}\}\).
Statement (2): Consider the following profile with four agents 1, 2, 3, 4.
Once can check that the profile is narcissistic and singlepeaked with respect to the order \(1\rhd 2 \rhd 3 \rhd 4\), and singlecrossing with respect to the order \(1\rhd ' 3 \rhd ' 2 \rhd ' 4\). It admits two different stable matchings \(\{\{1, 2\}, \{3, 4\}\}\) and \(\{\{1, 3\}, \{2, 4\}\}\).
Statement (3): Consider the following profile with six agents \(1,2,\ldots , 6\).
It is narcissistic, and singlepeaked and singlecrossing with respect to the order \(3 \rhd 2 \rhd 1 \rhd 4 \rhd 5 \rhd 6\). One can check that the profile is singlepeaked with respect to the order \(\rhd \). For singlecrossingness, observe that each pair of agents is ranked by at most two different agents so that the profile is (tiesensitive) singlecrossing with respect to any ordering.
However, no matching M is stable for this profile. To see this, notice that the preferences of agents from \(A^*\,{:}{=}\,\{1,2,3,4,5\}\) form a certain cyclic structure: For each agent \(i\in A^*\) it holds that agent i is the most preferred agent of agent \((i\bmod 5)+1\). Now, consider an arbitrary matching M. Since \(A^*\) is odd, there is at least one agent \(i\in A^*\) with \(M(i)\notin A^*\). It is straightforward to see that agent i and agent \((i\bmod 5)+1\) will form a blocking pair for M. \(\square \)
For the case when ties in the preferences are allowed, Ronn [48] showed that Stable Roommates becomes NPhard even if the preferences are complete. The constructed instances in his hardness proof, however, are not always singlepeaked or singlecrossing. It is even not clear whether the problem remains NPhard for this restricted case. If the preferences need not be complete, however, then we can show NPhardness, by a completely different reduction, obtaining our main intractability result.
Before we state the corresponding theorem, we prove the following two lemmas which are used heavily in our preference profile construction to force two agents of specific types to be matched together. The first lemma summarizes an observation on a profile that is similar to profile \(\mathcal {P}_3\) presented in the proof of Proposition 9.
Lemma 1
Let \(A=\{a^1,a^2,a^3, a^4, a^{5}\}\) be a set of five distinct agents and let X be a nonempty set of agents disjoint from A. The preference orders of the agents in A satisfy the following, where (X) means that the agents in set X are tied with each other:
Then, the following holds.

(1)
Every stable matching M for A satisfies \(M(a^{5})\in X\), \(M(a^1)=a^2\), and \(M(a^3)=a^4\).

(2)
The preferences from A are narcissistic and singlepeaked with respect to the linear order \(a^{3}\rhd a^{2} \rhd a^1 \rhd a^4 \rhd a^{5} \rhd [X]\), where [X] denotes some fixed linear order of the agents in X.

(3)
The preferences from A are tiesensitive singlecrossing with respect to any ordering of the agents in A.
Proof
Towards a contradiction to Statement (1), suppose that there is a stable matching M with \(M(a^5)\notin X\). Then, by the preferences of \({\sim } a^5\), there remain three possibilities (i)–(iii) for the partner of \(a^5\). We claim to obtain a blocking pair for M for each of these possibilities.
 Case (i)::

\(M(a^{5})\notin \{a^1, a^{4}\}\). This implies that agent \(a^{5}\) does not have a partner. Then, by construction, \(\{a^{5},a^1\}\) will be blocking M.
 Case (ii)::

\(M(a^{5}) = a^{4}\). Since \(a^4\) prefers \(a^3\) to \(a^5\), it follows that \(a^3\) must obtain a partner that it prefers to \(a^4\) as, otherwise, \(\{a^3,a^4\}\) will form a blocking pair for M. Since \(a^2\) is the only (acceptable) agent that \(a^3\) prefers to \(a^4\), it follows that \(\{a^{3}, a^{2}\}\in M\). Consequently, \(a^1\) will not be assigned a partner by M. However, \(\{a^1, a^2\}\) will form a blocking pair for M.
 Case (iii)::

\(M(a^{5}) = a^{1}\). Analogously to Case (ii), if \(M(a^{5})=a^1\), then we deduce that \(M(a^{4})=a^3\). This implies that \(a^2\) remains unmatched by M. However, \(\{a^2,a^3\}\) will form a blocking pair for M.
We have just shown that \(M(a^5)\in X\). By the preferences of \(a^2\) it follows that \(M(a^2)=a^1\) as otherwise \(a^1\) is unmatched and will form a blocking pair with \(a^2\). Similarly, we can infer that \(M(a^4)=a^3\).
Statement (2) is straightforward. As for Statement (3), which concerns tiesensitive singlecrossingness , we observe that it holds with respect to every order of the agents: Each pair of agents is ranked by at most two different agents and ties only occur in the preferences of \(a^5\). \(\square \)
Whereas Lemma 1 enforces that a specific agent (i.e., \(a^5\)) must be matched with some agent from a specific group of agents (i.e., X), the forthcoming lemma enforces some specific combination of matchings inside this specific group X. This seems crucial to ensure the narcissistic, singlepeaked, and tiesensitive singlecrossing property.
Lemma 2
Let \(X\,{:}{=}\,\{x^1, x^2, \ldots , x^{10}\}\), be two disjoint sets of agents, and let A and B be two disjoint sets of agents such that X, R, A, and B are pairwise disjoint. Furthermore, assume that the preferences of the agents from X satisfy the following, where the symbols [A] and [B] denote some fixed linear orders of the agents in A and B, respectively:
The following holds for the preferences of X.

(1)
If M is a stable matching with \(M(x^{10})\in B\), then for each \(i\in \{4,3,2,1\}\) we have that \(\{x^{2i+1},x^{2i}\}\in M\).

(2)
The above preferences are narcissistic, singlepeaked, and tiesensitive singlecrossing with respect to the following order, where \(\overleftarrow{[A]}\) and \(\overleftarrow{[B]}\) denote the reverse of the fixed orders [A] and [B], respectively:
Proof
By our assumption that \(M(x^{10})\in B\) and by the preference order of \(x^{10}\), it follows that \(M(x^9)=x^8\) as otherwise \(\{x^9,x^{10}\}\) will form a blocking pair for M. By an analogous reasoning for \(x^7\), \(x^5\), and \(x^3\), we deduce that \(M(x^7)=x^6\), \(M(x^5)=x^4\), and \(M(x^3)=x^2\), showing Statement (1).
As for Statement (2), clearly, the preferences of the agents in X, are narcissistic. One can check that the preferences are indeed singlepeaked with respect to the order \(\rhd \). Since no two agents are ranked by more than two different agents, it is clear that the preferences are tiesensitive singlecrossing, implying singlecrossingness due to Proposition 1(1). \(\square \)
Figure 4 illustrates the crucial part of the acceptability graphs of the profiles discussed in Lemma 1 and Lemma 2. Observe that, these graphs display a certain cyclic structure if we make the edges directed: If we construct an arc (u, w) for each agent u and its most acceptable agent w, then we obtain a directed cycle. Moreover, we have already seen from profile \(P_3\) in the proof of Proposition 9 that odd cycles imply nonexistence of stable matchings. Using this observation, we can show our main result now.
Theorem 2
Stable Roommates for incomplete preferences with ties remains NPcomplete, even if the preferences are narcissistic, singlepeaked, and (tiesensitive) singlecrossing.
Proof
First, the problem is in NP since one can nondeterministically guess a matching and check stability in polynomial time. To show NPhardness, we reduce from the NPcomplete Independent Set problem [28]:
Independent Set
Input: an undirected graph \(G=(U,E)\) and a nonnegative integer k.
Question: Is there a sizek independent set, i.e., a subset \(U'\subseteq U\) of k pairwise nonadjacent vertices?
We assume that each vertex has degree at most three since Independent Set remains NPhard for this case [27]. Let \((G=(U,E),k)\) be an Independent Set instance with U being the vertex set and E being the edge set. Let \(U\,{:}{=}\,\{u_1, u_2,\dots , u_n\}\). We will construct a Stable Roommates instance \(\mathcal {P}\) with agent set V which is narcissistic, singlepeaked, and tiesensitive singlecrossing, and show that G admits a sizek independent set if and only if \(\mathcal {P}\) admits a stable matching.
Main idea and the constructed agents. For each vertex \(u_i \in U\), we introduce ten vertex agents \(u^j_i\), \(1\le j \le 10\), denoted as \(U_i=\{u_i^j\mid 1\le j \le 10\}\). The idea is to obtain an acceptability graph that has a cycle of length ten (see our discussion just prior to the theorem) for each vertex of the input graph, including eight for the neighbors of this vertex. This is used to ensure narcissistic, singlepeaked, and singlecrossing property simultaneously. Additionally, we introduce two groups of selector agents, each with k sets:
 Group (1)::

\(A_j=\{a^i_j\mid 1\le i \le 5\}\), \(1\le j \le k\), and
 Group (2)::

\(B_j=\{b^i_j\mid 1\le i \le 5\}\), \(1\le j \le k\).
We will construct preferences for these selector agents to enforce that each two selectors \(a_j^5\) and \(b^5_j\), \(1\le j \le k\), are matched to two vertex agents. Together with the preferences of the vertex agents, we make sure that the vertex agents that are matched to \(a_j^5\) and \(b^5_j\), respectively, correspond to the same vertex.
The agent set V is defined as \(V=\left( \bigcup _{1\le i \le n}U_i\right) \cup \left( \bigcup _{1\le j\le k}(A_j \cup B_j)\right) \). In total, we have constructed \(10n+10k\) agents.
To encode an Independent Set instance, we aim to construct preferences for the vertex agents such that no two vertex agents that are matched to some selector agents correspond to two adjacent vertices. This property will be formally captured later by Claim 1.
Selector agents. The preferences of the selector agents are of the form as described in Lemma 1. To this end, let \(U^1=\{u^1_i\mid 1\le i \le n\}\) and \(U^{10}=\{u^{10}_i\mid 1\le i \le n\}\). We use \((U^1)\) and \((U^{10})\) to express that the agents in the respective subsets are tied.
Vertex agents. The preferences of the vertex agents for each vertex \(u_i\) are of the form described in Lemma 2.
Herein, \(A^5\) represents the following set \(A^5\,{:}{=}\,\{a^5_j\mid 1\le j \le k\}\) and \([A^5]\) denotes the following fixed order of the selector agents in \(A^5\): \([A^5]\,{:}{=}\,a^5_1 \succ a^5_2\succ \cdots \succ a^5_k\). The symbols \(B^5\) and \([B^5]\) are defined in an analogous way: \(B^5\,{:}{=}\,\{b^5_j\mid 1\le j \le k\}\) and \([B^5]\) denotes the following fixed order of the selector agents in \(B^5\): \([B^5]\,{:}{=}\,b^5_1 \succ b^5_2\succ \cdots \succ b^5_k\).
It remains to specify the agents \(r_i^2\), \(r_i^4\), \(r_i^6\), and \(r_i^8\). Recall that the maximum vertex degree of our input graph G is three. By Vizing’s Theorem [56], graph G is 4edgecolorable, that is, the edge set of G can be partitioned into four subsets \(E_1\), \(E_2\), \(E_3\), and \(E_4\) which are each a matching. Moreover, this partition can be computed in polynomial time [44]. Thus, we first compute the sets \(E_c\), \(1\le c \le 4\). Next, for each \(1\le c \le 4\), if \(E_c\) contains an edge \(e=\{u_i,u_j\}\), then we define \(r^{2c}_i:=u^{2c}_j\) (resp. \(r^{2c}_j\,{:}{=}\,u^{2c}_i\)). If some vertex \(u_i\) is not incident to an edge of color c, then \(r^{2c}_i\) is omitted, that is, the preference order of agent \(u^{2c}_i\) is just \(u_i^{2c} \succ u_i^{2c 1} \succ u_i^{2 c +1}\).
For an illustration, assume that \(e_1\in E_1\) and \(e_4\in E_2\) with \(e_1=\{u_1, u_2\}\) and \(e_4=\{u_1,u_3\}\). Then, \(r_1^2,r_2^2,r_1^4,r_3^4\) are \(r_1^2=u_2^2\), \(r_2^2=u_1^2\), \(r_1^4=u^4_3\), \(r_3^4=u_1^4\).
This completes the construction, which can clearly be performed in polynomial time. Next, we show that our constructed profile is narcissistic, singlepeaked, singlecrossing, and tiesensitive singlecrossing.
Singlepeakedness. The constructed profile is singlepeaked with respect to the following linear order \(\rhd \):
We specify the notations used in the above order.

For each \(j \in \{1,2,\dots , k\}\) and for each \((Q,q)\in \{(A,a),(B,b)\}\), the let \([Q_j]\) denote the order \(q_j^3\rhd q_j^2 \rhd q_j^1 \rhd q_j^4 \rhd q_j^5\) (cf. Lemma 1).

The symbol \([U^{10,9}]\) denotes the order \(u^{10}_1\rhd u^{10}_2 \rhd \cdots \rhd u^{10}_n \rhd u^{9}_1\rhd u^{9}_2 \rhd \cdots \rhd u^{9}_n\).

For each \(c\in \{1,2,3,4\}\) the symbol \(U^{2 c1, 2 c}\) denotes the subset \(\{u_i^{2c1}, u_i^{2c}\mid 1\le i \le n\}\). Intuitively, the symbol \([U^{2 c1, 2 c}]\) denotes an order of the agents in \(U^{2 c1, 2 c}\), which makes sure that the preferences of the vertex agents that are “incident” to the edges in \(E_c\) are singlepeaked with respect to this order. To define \([U^{2 c1,2 c}]\), we need the following additional notion: For each edge \(e\in E_c\) let \(u_i\) and \(u_j\) be the respective endpoints with \(i<j\). Then, let [e] denote the order \(u^{2 c 1}_i \rhd u^{2 c}_i \rhd u_j^{2 c1} \rhd u_j^{2 c}\).
The order \([U^{2 c 1, 2 c}]\) is defined as follows:
$$\begin{aligned} {[}U^{2 c1,2 c}] \,{:}{=}\,[e_{c,1}] \rhd [e_{c,2}] \rhd \cdots \rhd [e_{c,\ell }] \rhd [R], \end{aligned}$$where \(e_{c,1}, e_{c,2}, \dots , e_{c,\ell }\) is an arbitrary but fixed order of the edges in \(E_c\), and [R] denotes a fixed order of the vertex agents \(u_i\) of the form \(u_i^{2 c1}\succ u_i^{2 c}\) that are not “incident” to any edge in \(E_c\).
For an illustration, assume that \(E_1=\{e_1,e_2\}\) with \(e_1=\{u_1, u_2\}\) and \(e_2=\{u_5,u_6\}\). Then, \([U^{1,2}]\) may be defined as \([U^{1,2}]\,{:}{=}\,u_1^{1}\rhd u_1^2 \rhd u_2^1 \rhd u^2_2 \rhd u^{1}_5 \rhd u^2_5 \rhd u^1_6 \rhd u^2_6 \rhd u^1_3 \rhd u^2_3 \rhd u_4^1 \rhd u^2_4\).
Tiesinglecrossingness and singlecrossingness. To show that the constructed preference profile is also tiesensitive singlecrossing we consider each pair p of agents and let \(\mathsf {Ac}{(}p)\) denote the agents which consider both agents in p as acceptable partners. We show that either all agents in \(\mathsf {Ac}{(}p)\) have the same order on p or if two agents exist that order p differently, then \(\mathsf {Ac}{(}p)=2\). It is straightforward to verify that if we can show the above statement, then the profile is tiesensitive singlecrossing, and it is singlecrossing by breaking ties in an arbitrary but fixed way.
To this end, let \(A^5=\{a_j^5\mid 1\le j \le k\}\), \(B^5=\{b_j^5\mid 1\le j \le k\}\), \(U^1=\{u_i^1\mid 1\le i \le n\}\), and \(U^{10}=\{u_i^{10} \mid 1\le i \le n\}\).
 Case 1: \(\varvec{p=\{a_j^{z},a_{j}^{z'}\}\subseteq A_j}\) (resp. \(\varvec{p=\{b_j^{z}, b_{j}^{z'}\}\subseteq B_j}\)):

for some value \(j\in \{1,2,\dots , k\}\) and some values \(z,z'\in \{1,2,3,4,5\}\). This implies that \(\mathsf {Ac}{(}p)\subseteq A_j\) (resp. \(A(p)\subseteq B_j\)). Moreover, no agent in \(\mathsf {Ac}{(}p)\) considers the agents in p to be tied with each other. If there are two agents in \(\mathsf {Ac}{(}p)\) that order this pair differently, then these agents must be those from p. It is straightforward to verify that in this case, it holds that \(p=\mathsf {Ac}{(}p)\), implying that \(\mathsf {Ac}{(}p)=2\). For instance, if \(p=\{a^1_i,a_i^5\}\), then \(\mathsf {Ac}{(}p)=p\). Otherwise, \(A(p)=1\) (For instance, for \(p=\{a^2_i, a^5_i\}\), one can check that \(\mathsf {Ac}{(}p)=\{a^1_i\}\)).
 Case 2: \(\varvec{p=\{a_j^{z},a_{j'}^{z'}\}}\) (resp. \(\varvec{p=\{b_j^{z},b_{j'}^{z'}\}}\)):

for two distinct values \(j,j'\in \{1,2,\cdots , k\}\) with \(j\ne j'\) and for some values \(z,z'\in \{1,2,3,4,5\}\). If \(z = z' = 5\), then \(\mathsf {Ac}{(}p)=U^1\) (resp. \(\mathsf {Ac}{(}p)=U^{10}\)); otherwise \(\mathsf {Ac}{(}p)=\emptyset \). For the first case, all agents in \(\mathsf {Ac}{(}p)\) have the same order on p.
 Case 3: \(\varvec{p=\{u_i^{j}, u_i^{j'}\} \subseteq U_i}\):

for some value \(i\in \{1,2,\dots , n\}\) and some distinct values \(j,j'\in \{1,2,\dots , 10\}\). This implies that \(\mathsf {Ac}{(}p)\subseteq U_i\), and no agent in \(\mathsf {Ac}{(}p)\) considers the agents in p to be tied with each other. Analogously, we deduce that if there are two agents in \(\mathsf {Ac}{(}p)\) that order this pair differently, then they must be the agents in p themselves. It is straightforward to verify that in this case we have \(p=\mathsf {Ac}{(}p)\). Otherwise, \(\mathsf {Ac}{(}p)=1\).
 Case 4: \(\varvec{p=\{u_{i}^{j}, u_{i'}^{j'}\}}\):

for two distinct values \(i,i'\in \{1,2,\dots , n\}\) with \(i\ne i'\) and some two (possibly identical) values \(j, j'\in \{1,2,\ldots , 10\}\). If \(j=j'\in \{1,10\}\), then either \(\mathsf {Ac}{(}p)=A^5\) or \(\mathsf {Ac}{(}p)=B^5\). In both cases, all agents in \(\mathsf {Ac}{(}p)\) consider the agents in p to be tied with each other. Otherwise, if the corresponding two vertices \(v_i\) and \(v_{i'}\) are adjacent with \(\{v_i,v_{i'}\}\in E_c\) for some color \(c\in \{1,2,3,4\}\) such that \(j=j'=2c\), then \(\mathsf {Ac}{(}p)=p\). In the remaining cases for j and \(j'\), no agent considers \(u_i^{j}\) and \(u^{j'}_{i'}\) both acceptable as partners and thus, we deduce that \(\mathsf {Ac}{(}p)=\emptyset \).
 Case 5: \(\varvec{p=\{u_i^z, a_{j}^{z'}\}}\) (resp. \(\varvec{p=\{u_i^z, b_{j}^{z'}\}}\)):

for some values \(i,j,z,z'\) with \(i \in \{1,2,\dots , n\}\), \(j\in \{1,2,\dots , k\}\), \(z \in \{1,2,\ldots , 10\}\), and \(z'\in \{1,2,\ldots , 5\}\). If \(z=1\) (resp. \(z=10\)) and \(z'=5\), then by the constructed preferences we deduce that \(\mathsf {Ac}{(}p)=p\). If \(z=1\) (resp. \(z=10\)) and \(z'\in \{1,4\}\), then by the constructed preferences we deduce that \(\mathsf {Ac}{(}p)=\{a^5_j\}\) (resp. \(\mathsf {Ac}{(}p)=\{b^5_j\}\)). If \(z\in \{2,10\}\) (resp. \(z \in \{1,9\}\)) and \(z'=5\), then we deduce that \(\mathsf {Ac}{(}p)=\{u^1_i\}\) (resp. \(\mathsf {Ac}{(}p)=\{u^{10}_i\}\)). Otherwise, by construction, we have that \(\mathsf {Ac}{(}p)=\emptyset \).
Correctness of the construction. We show that G has a sizek independent set if and only if \(\mathcal {P}\) admits a stable matching.
For the “only if” part, assume that \(U'\subseteq U\) is a sizek independent set where \(U'=\{u_{q_1},u_{q_2},\ldots , u_{q_k}\}\) with \(q_{i1}< q_{i}\) for all \(i\in \{2,3,\dots , k\}\). One can verify that the following matching M is stable.

For each \(u_{q_j} \in U'\) set \(M(a^5_j) = u^1_{q_j}\), \(M(b^5_j) = u^{10}_{q_j}\), \(M(a^{1}_j)=a^{2}_j\), \(M(a^{3}_j)=a^4_j\), \(M(b^{1}_j)=b^{2}_j\), and \(M(b^{3}_j)=b^4_j\). Note that this in particular defines matchings for all selector agents.

For each \(u_i\in U'\) and for each \(c\in \{1,2,3,4\}\), set \(M(u_i^{2c+1})=u_i^{2c}\).

For each \(u_i \notin U'\) and for each \(c\in \{1,2,3,4,5\}\) set \(M(u^{2c1}_i) = u^{2c}_i\).
Before we go on with the “if” part, we observe some properties that each stable matching of our constructed profile must satisfy.
Claim 1
Every stable matching M for our constructed profile satisfies the following two properties.

(1)
For each \(j\in \{1,2,\ldots , k\}\) the selector agent \(b^5_j\) is matched with some vertex agent of the form \(u^{10}_i\) for some \(i\in \{1,2,\ldots , n\}\).

(2)
No two vertex agents \(u^{10}_i\) and \(u^{10}_{i'}\) which are both matched to some selector agents correspond to two adjacent vertices.
Proof
(Proof of Claim 1) Let M be a stable matching for our profile. For the first statement, Lemma 1(1) immediately implies that for every selector agent \(b^5_j\), \(1\le j \le k\), it holds that \(M(a^5_j) \in \{u^{10}_i \mid 1\le i \le n\}\).
For the second statement, suppose, towards a contradiction, that there are two vertex agents \(u^{10}_i, u^{10}_{i'}\) (for some distinct \(i,i'\in \{1,2,\ldots ,n\}\)) which are matched to some selector agents such that the corresponding vertices \(u_i\) and \(u_{i'}\) are adjacent, i.e., \(\{u_i,u_{i'}\}\in E_c\) for some \(c\in \{1,2,3,4\}\). This means that \(\{M(u^{10}_i),M(u^{10}_{i'})\}\subseteq \{b^5_j\mid 1\le j \le k\}\). Consequently, by Lemma 2(1), it follows that \(M(u_i^{2c})=u_i^{2c+1}\) and \(M(u_{i'}^{2c})=u_{i'}^{2c+1}\). However, by construction, both \(u^{2c}_{i}\) and \(u^{2c}_{i'}\) prefer each other to their respective partner, forming a blocking pair for M—a contradiction. \(\lozenge \)
To show the “if” part, let M be a stable matching. Then, Claim 1 immediately implies that the subset \(U'=\{u_i \mid M(u^{10}_i)=b^{5}_j \text { for some } j \in \{1,2,\cdots , k\}\}\) is an independent set of size k. \(\square \)
5 Conclusion
We investigated Stable Roommates for preferences with popular structural properties, such as being narcissistic, singlepeaked, and singlecrossing. We showed that for complete preferences with ties, assuming narcissism and singlepeakedness (or narcissism and singlecrossingness) guarantees the existence of stable matchings, which can be found in linear time; by comparison, Stable Roommates with complete preferences and ties is NPcomplete [48]. For incomplete preferences with ties, however, narcissistic and singlepeakedness even combined with singlecrossingness do not help to lower the computational complexity—Stable Roommates remains NPcomplete.
We conclude with some challenges for future research. First, to better understand the NPcompleteness result, one may study the parameterized complexity with respect to the “degree” of incompleteness of the input preferences, such as the number of ties or the number of agents that are in the same equivalence class of the tierelation. We refer to some recent papers on the parameterized complexity of preferencebased stable matching problems [1, 11, 12, 14,15,16, 29, 40,41,42, 45] for this line of research.
Second, we were not able to settle the computational complexity for complete preferences that are also singlepeaked and singlecrossing.
Third, for incomplete preferences, we extended the concepts of singlepeaked and singlecrossing preferences. There are, however, further relevant extensions in the literature [20, 25, 37], which deserve attention in the study of stable matching problems. Do our results transfer to preferences with these extensions?
Fourth, the algorithm of Bartholdi III and Trick [4] strongly relies on the following condition:
At each step, there are always two agents that consider each other most acceptable.
To explore the boundary between tractable and intractable cases it is important to understand which structural properties imply this condition. For instance, the socalled worstrestricted property (i.e., no three agents exist such that each of them is least preferred by some agent) [53, 54] is a generalization of the singlepeaked property. In fact, we can show that for preferences without ties, the narcissistic and worstrestricted properties are enough to guarantee that there are always two agents which consider each other most acceptable [23]. For profiles with ties, however, it seems unclear how to define a worstrestricted property so that the question of “how far one can generalize structured preferences so that the above condition still holds” remains open.
Finally, we found an issue with Bartholdi III and Trick’s algorithm regarding their claimed O(n) running time (see Example 4). This brings up the question as to whether finding a stable matching can be done faster than in linear time, i.e., faster than \(O(n^2)\) time for complete, narcissistic, and singlepeaked preference profiles without ties.
References
Adil, D., Gupta, S., Roy, S., Saurabh, S., & Zehavi, M. (2018). Parameterized algorithms for stable matching with ties and incomplete lists. Theoretical Computer Science, 723, 1–10.
Ballester, M. Á., & Haeringer, G. (2011). A characterization of the singlepeaked domain. Social Choice and Welfare, 36(2), 305–322.
Barberà, S., & Moreno, B. (2011). Top monotonicity: A common root for single peakedness, single crossing and the median voter result. Games and Economic Behavior, 73(2), 345–359.
Bartholdi, J. J, III, & Trick, M. (1986). Stable matching with preferences derived from a psychological model. Operation Research Letters, 5(4), 165–169.
Black, D. (1958). The theory of committees and elections. Cambridge: Cambridge University Press.
Brams, S. J., & Fishburn, P. C. (2002). Voting procedures. In K. J. Arrow, A. K. Sen, & K. Suzumura (eds.) Handbook of social choice and welfare (Vol. 1, pp. 173–236). Amsterdam: NorthHolland .
Brandt, F., Conitzer, V., Endriss, U., Lang, J., & Procaccia, A. (Eds.). (2016). Handbook of computational social choice. Cambridge: Cambridge University Press.
Bredereck, R., Chen, J., & Woeginger, G. J. (2013). A characterization of the singlecrossing domain. Social Choice and Welfare, 41(4), 989–998.
Bredereck, R., Chen, J., & Woeginger, G. J. (2016). Are there any nicely structured preference profiles nearby? Mathematical Social Sciences, 79, 61–73.
Bredereck, R., Chen, J., Finnendahl, U. P., & Niedermeier, R. (2017). Stable roommate with narcissistic, singlepeaked, and singlecrossing preferences. In Proceedings of the 5th international conference on algorithmic decision theory (ADT ’17), LNCS (Vol. 10576, pp. 315–330). Berlin: Springer.
Bredereck, R., Heeger, K., Knop, D., & Niedermeier, R. (2019). Parameterized complexity of stable roommates with ties and incomplete lists through the lens of graph parameters. In Proceedings of the 30th international symposium on algorithms and computation (ISAAC ’19), LIPIcs (Vol. 149, pp. 44:1–44:14). Schloss Dagstuhl  LeibnizZentrum für Informatik,.
Bredereck, R., Chen, J., Knop, D., Luo, J., & Niedermeier, R. (2020). Adapting stable matchings to evolving preferences. In Proceedings of the 34th AAAI conference on artificial intelligence (AAAI ’20) (pp. 1830–1837).
Chen, J., & Finnendahl, U. P. (2018). On the number of singlepeaked narcissistic or singlecrossing narcissistic preferences. Discrete Mathematics, 341(5), 1225–1236.
Chen, J., Hermelin, D., Sorge, M., & Yedidsion, H. (2018a). How hard is it to satisfy (almost) all roommates? In Proceedings of the 45th international colloquium on automata, languages, and programming (ICALP ’18), LIPIcs, (Vol. 107, pp. 35:1–35:15). Schloss Dagstuhl  LeibnizZentrum für Informatik.
Chen, J., Niedermeier, R., & Skowron, P. (2018b). Stable marriage with multimodal preferences. In Proceedings of the 19th ACM conference on economics and computation (ACM EC ’18) (pp. 269–286).
Chen, J., Skowron, P., & Sorge, M. (2019). Matchings under preferences: Strength of stability and tradeoffs. In Proceedings of the 20th ACM conference on economics and computation (ACM EC ’19) (pp. 41–59).
Coombs, C. H. (1964). A theory of data. New York: Wiley.
Doignon, J., & Falmagne, J. (1994). A polynomial time algorithm for unidimensional unfolding representations. Journal of Algorithms, 16(2), 218–233.
Elkind, E., Faliszewski, P., & Slinko, A. (2012). Clone structures in voters’ preferences. In Proceedings of the 13th ACM conference on electronic commerce (ACM EC ’12) (pp. 496–513).
Elkind, E., Faliszewski, P., Lackner, M., & Obraztsova, S. (2015). The complexity of recognizing incomplete singlecrossing preferences. In Proceedings of the 29th AAAI conference on artificial intelligence (AAAI ’15) (pp. 865–871). A full version as manuscript is available on M. Lackner’s homepage.
Elkind, E., Lackner, M., & Peters, D. (2017). Structured preferences. In U. Endriss (ed.), Trends in computational social choice (chapter 10, pp. 187–207). AI Access.
Escoffier, B., Lang, J., & Öztürk, M. (2008). Singlepeaked consistency and its complexity. In Proceedings of the 18th European conference on artificial intelligence (ECAI ’08) (pp. 366–370).
Finnendahl, U.P. (2016). Das Stable RoommateProblem unter Einschränkungen der Präferenzstruktur. Bachelor’s thesis, TU Berlin, April 2016. English translation: The Stable Roommates Problem Under Domain Restrictions.
Fitzsimmons, Z. (2015). Singlepeaked consistency for weak orders is easy. In Proceedings the 15th conference on theoretical aspects of rationality and knowledge (TARK ’15) (pp. 127–140).
Fitzsimmons, Z., & Hemaspaandra, E. (2016). Modeling singlepeakedness for votes with ties. In Proceedings of the 8th European starting AI researcher symposium (STAIRS ’16), frontiers in artificial intelligence and applications (Vol. 284, pp. 63–74).
Gale, D., & Shapley, L. S. (2013). College admissions and the stability of marriage. The American Mathematical Monthly, 120(5), 386–391.
Garey, M., Johnson, D., & Stockmeyer, L. (1976). Some simplified NPcomplete graph problems. Theoretical Computer Science, 1(3), 237–267.
Garey, M. R., & Johnson, D. S. (1979). Computers and intractability–a guide to the theory of NPcompleteness. New York: W. H. Freeman and Company.
Gupta, S., Roy, S., Saurabh, S., & Zehavi, M. (2017). Balanced stable marriage: How close is close enough? Technical report. arXiv:1707.09545 [cs.DS].
Gusfield, D., & Irving, R. W. (1989). The stable marriage problemstructure and algorithms. Foundations of computing series. Cambridge: MIT Press.
Hotelling, H. (1929). Stability in competition. Economic Journal, 39(153), 41–57.
Irving, R. W. (1985). An efficient algorithm for the “stable roommates” problem. Journal of Algorithms, 6(4), 577–595.
Irving, R. W., & Manlove, D. (2002). The stable roommates problem with ties. Journal of Algorithms, 43(1), 85–105.
Iwama, K., & Miyazaki, S. (2008). A survey of the stable marriage problem and its variants. In International conference on infomatics education and research for knowledgecirculating society (pp. 131–136).
Knuth, D. E. (1997). Stable marriage and its relation to other combinatorial problems, CRM proceedings & lecture notes (Vol. 10 ). AMS.
Kujansuu, E., Lindberg, T., & Mäkinen, E. (1999). The stable roommates problem and chess tournament pairings. Divulgaciones Matemáticas, 7, 19–28.
Lackner, M. (2014). Incomplete preferences in singlepeaked electorates. In Proceedings of the 28th AAAI conference on artificial intelligence (AAAI ’14) (pp. 742–748).
Lebedev, D., Mathieu, F., Viennot, L., Gai, A., Reynier, J., de Montgolfier, F. (2006). On using matching theory to understand P2P network design. Technical report. arXiv:cs/0612108v1 [cs.NI] .
Manlove, D. F., & O’Malley, G. (2014). Paired and altruistic kidney donation in the UK: algorithms and experimentation. ACM Journal of Experimental Algorithmics, 19(1), 271–282.
Marx, D., & Schlotter, I. (2010). Parameterized complexity and local search approaches for the stable marriage problem with ties. Algorithmica, 58(1), 170–187.
Marx, D., & Schlotter, I. (2011). Stable assignment with couples: Parameterized complexity and local search. Discrete Optimization, 8(1), 25–40.
Meeks, K., & Rastegari. B. (2018) Stable marriage with groups of similar agents. In Proceedings of the 14th international conference on web and internet economics (WINE ’18), LNCS (Vol. 11316, pp. 312–326). Berlin: Springer.
Mirrlees, J. A. (1971). An exploration in the theory of optimal income taxation. Review of Economic Studies, 38, 175–208.
Misra, J., & Gries, D. (1992). A constructive proof of Vizing’s theorem. Information Processing Letters, 41(3), 131–133.
Mnich, M., & Schlotter, I. (2020). Stable matchings with covering constraints: A complete computational trichotomy. Algorithmica, 82(5), 1136–1188.
Opatrný, J. (1979). Total ordering problem. SIAM Journal on Computing, 8(1), 111–114.
Roberts, K. W. (1977). Voting over income tax schedules. Journal of Public Economics, 8(3), 329–340.
Ronn, E. (1990). NPcomplete stable matching problems. Journal of Algorithms, 11(2), 285–304.
Roth, A. E., & Sotomayor, M. (1990). Twosided matching: A study in gametheoretic modeling and analysis. Cambridge: Cambridge University Press.
Roth, A. E., Sönmez, T., & Ünver, M. U. (2005). Pairwise kidney exchange. Journal of Economic Theory, 125(2), 151–188.
Roth, A. E., Sönmez, T., & Ünver, M. U. (2007). Efficient kidney exchange: Coincidence of wants in markets with compatibilitybased preferences. American Economic Review, 97(3), 828–851.
Saporiti, A., & Tohmé, F. (2006). Singlecrossing, strategic voting and the median choice rule. Social Choice and Welfare, 26(2), 363–383.
Sen, A., & Pattanaik, P. K. (1969). Necessary and sufficient conditions for rational choice under majority decision. Journal of Economic Theory, 1(2), 178–202.
Sen, A. K. (1966). A possibility theorem on majority decisions. Econometrica, 34(2), 491–499.
Stanley, R. P. (1999). Enumerative combinatorics (Vol. 2). Cambridge: Cambridge University Press.
Vizing, V. G. (1964). On an estimate of the chromatic class of a \(p\)graph. Diskretnyi Analiz, 3, 25–30. In Russian.
Acknowledgements
We thank anonymous reviewers of the 5th International Conference on Algorithmic Decision Theory (ADT ’17) and of the journal Autonomous Agents and MultiAgent Systems (JAAMAS) for their constructive feedback. In particular, we thank an anonymous reviewer of JAAMAS for pointing us to an issue in the algorithm of Bartholdi III and Trick that also applied to our algorithms. Jiehua Chen was partially supported by the People Programme (Marie Curie Actions) of the European Union’s Seventh Framework Programme (FP7/20072013) under REA Grant Agreement Number 631163.11, by the Israel Science Foundation (Grant No. 551145/14), by European Research Council (ERC) under the European Union’s Horizon 2020 research and innovation programme under Grant Agreement Numbers 677651, and by the WWTF research Grant (VRG18012).
Funding
Open access funding provided by TU Wien (TUW).
Author information
Authors and Affiliations
Corresponding author
Additional information
Publisher's Note
Springer Nature remains neutral with regard to jurisdictional claims in published maps and institutional affiliations.
A preliminary version of this work appeared in the Proceedings of the 5th International Conference on Algorithmic Decision Theory (ADT ’17) [10], volume 10576 of LNCS, pages 315–330, Springer, 2017. This full version contains (more) proof details for Propositions 1, 2, Theorems 1, 2, and Proposition 8. Furthermore, the reduction used for our main result (Theorem 2) was replaced by a completely new reduction showing NPhardness for the case of narcissistic, singlepeaked, and singlecrossing preferences (the preferences in the previous reduction were not narcissistic).
Most of the work was done while all authors were with TU Berlin, with some additional work done while Jiehua Chen was with BenGurion University, Israel, and with University of Warsaw, Poland.
Rights and permissions
Open Access This article is licensed under a Creative Commons Attribution 4.0 International License, which permits use, sharing, adaptation, distribution and reproduction in any medium or format, as long as you give appropriate credit to the original author(s) and the source, provide a link to the Creative Commons licence, and indicate if changes were made. The images or other third party material in this article are included in the article’s Creative Commons licence, unless indicated otherwise in a credit line to the material. If material is not included in the article’s Creative Commons licence and your intended use is not permitted by statutory regulation or exceeds the permitted use, you will need to obtain permission directly from the copyright holder. To view a copy of this licence, visit http://creativecommons.org/licenses/by/4.0/.
About this article
Cite this article
Bredereck, R., Chen, J., Finnendahl, U.P. et al. Stable roommates with narcissistic, singlepeaked, and singlecrossing preferences. Auton Agent MultiAgent Syst 34, 53 (2020). https://doi.org/10.1007/s1045802009470x
Published:
DOI: https://doi.org/10.1007/s1045802009470x