Theory of Computing Systems

, Volume 63, Issue 1, pp 128–149

# The Stable Roommates Problem with Short Lists

• Ágnes Cseh
• Robert W. Irving
• David F. Manlove
Open Access
Article
Part of the following topical collections:
1. Special Issue on Algorithmic Game Theory (SAGT 2016)

## Abstract

We consider two variants of the classical Stable Roommates problem with Incomplete (but strictly ordered) preference lists (sri) that are degree constrained, i.e., preference lists are of bounded length. The first variant, egald-sri, involves finding an egalitarian stable matching in solvable instances of sri with preference lists of length at most d. We show that this problem is NP-hard even if d = 3. On the positive side we give a $$\frac {2d+3}{7}$$-approximation algorithm for d ∈{3,4,5} which improves on the known bound of 2 for the unbounded preference list case. In the second variant of sri, called d-srti, preference lists can include ties and are of length at most d. We show that the problem of deciding whether an instance of d-srti admits a stable matching is NP-complete even if d = 3. We also consider the “most stable” version of this problem and prove a strong inapproximability bound for the d = 3 case. However for d = 2 we show that the latter problem can be solved in polynomial time.

## Keywords

Stable matching Bounded length preference lists Complexity Approximation algorithm

## 1 Introduction

In the Stable Roommates problem with Incomplete lists (sri), a graph G = (A,E) and a set of preference lists $$\mathcal O$$ are given, where the vertices A = {a1,…,an} correspond to agents, and $$\mathcal O=\{\prec _{1},\dots ,\prec _{n}\}$$, where ≺i is a linear order on the vertices adjacent to ai in G (1 ≤ in). We refer to ≺i as ai’s preference list. The agents that are adjacent to ai in G are said to be acceptable to ai. If aj and ak are two acceptable agents for ai where ajiak then we say that aiprefersaj to ak.

Let M be a matching in G. If aiajM then we let M(ai) denote aj. An edge aiajM blocks M, or forms a blocking edge of M, if ai is unmatched or prefers aj to M(ai), and similarly aj is unmatched or prefers ai to M(aj). A matching is called stable if no edge blocks it. Denote by sr the special case of sri in which G = Kn. Gale and Shapley [9] observed that an instance of sr need not admit a stable matching. Irving [15] gave a linear-time algorithm to find a stable matching or report that none exists, given an instance of sr. The straightforward modification of this algorithm to the sri case is described in [12]. We call an sri instance solvable if it admits a stable matching.

In practice agents may find it difficult to rank a large number of alternatives in strict order of preference. One natural assumption, therefore, is that preference lists are short, which corresponds to the graph being of bounded degree. Given an integer d ≥ 1, we define d-sri to be the restriction of sri in which G is of bounded degree d. This special case of sri problem has potential applications in organising tournaments. As already pointed out in a paper of Kujansuu et al. [18], sri can model a pairing process similar to the Swiss system, which is used in large-scale chess competitions. The assumption on short lists is reasonable, because according to the Swiss system, players can be matched only to other players with approximately the same score.

A second variant of sri, which can be motivated in a similar fashion, arises if we allow ties in the preference lists, i.e., ≺i (1 ≤ in) is now a strict weak ordering. That is, ≺i is a strict partial order in which incomparability is transitive. We refer to this problem as the Stable Roommates problem with Ties and Incomplete lists (srti) [17]. As in the sri case, define d-srti to be the restriction of srti in which G is of bounded degree d. Denote by srt the special case of srti in which G = Kn. In the context of the motivating application of chess tournament construction as mentioned in the previous paragraph, d-srti is naturally obtained if a chess player has several potential partners of the same score and match history in the tournament.

In the srti context, ties correspond to indifference in the preference lists. In particular, if aiajE and aiakE where ajiak and akiaj then ai is said to be indifferent betweenaj and ak. Thus preference in the sri context corresponds to strict preference in the case of srti. Relative to the strict weak orders in $$\mathcal O$$, we can define stability in srti instances in exactly the same way as for sri. This means, for example, that if aiajM for some matching M, and ai is indifferent between aj and some agent ak, then aiak cannot block M. The term solvable can be defined in the srti context in an analogous fashion to sri. Using a highly technical reduction from a restriction of 3-sat, Ronn [23] proved that the problem of deciding whether a given srt instance is solvable is NP-complete. A simpler reduction was given by Irving and Manlove [17].

For solvable instances of sri there can be many stable matchings. Often it is beneficial to work with a stable matching that is fair to all agents in a precise sense [11, 16]. One such fairness concept can be defined as follows. Given two agents ai, aj in an instance $$\mathcal {I}$$ of sri, where aiajE, let rank(ai,aj) denote the rank of aj in ai’s preference list (that is, 1 plus the number of agents that ai prefers to aj). Let AM denote the set of agents who are matched in a given stable matching M. (Note that this set depends only on $$\mathcal I$$ and is independent of M by [12, Theorem 4.5.2].) Define $$c(M)={\sum }_{a_{i}\in A_{M}} \text {rank}(a_{i},M(a_{i}))$$ to be the cost of M. An egalitarian stable matching is a stable matching M that minimises c(M) over the set of stable matchings in $$\mathcal {I}$$. Finding an egalitarian stable matching in sr was shown to be NP-hard by Feder [7]. Feder [7, 8] also gave a 2-approximation algorithm for this problem in the sri setting. He also showed that an egalitarian stable matching in sr can be approximated within a factor of α of the optimum if and only if Minimum Vertex Cover can be approximated within the same factor α. It was proved later that, assuming the Unique Games Conjecture, Minimum Vertex Cover cannot be approximated within 2 − ε for any ε > 0 [19].

Given an unsolvable instance $$\mathcal I$$ of sri or srti, a natural approximation to a stable matching is a most-stable matching [1]. Relative to a matching M in $$\mathcal I$$, define bp(M) to be the set of blocking edges of M and let $$bp(\mathcal I)$$ denote the minimum value of |bp(M)|, taken over all matchings M in $$\mathcal I$$. Then M is a most-stable matching in $$\mathcal I$$ if $$|bp(M)|=bp(\mathcal I)$$. The problem of finding a most-stable matching was shown to be NP-hard and not approximable within nkε, for any ε > 0, unless P = NP, where $$k=\frac {1}{2}$$ if $$\mathcal I$$ is an instance of sr and k = 1 if $$\mathcal I$$ is an instance of srt [1].

To the best of our knowledge, there has not been any previous work published on either the problem of finding an egalitarian stable matching in a solvable instance of sri with bounded-length preference lists or the solvability of srti with bounded-length preference lists. This paper provides contributions in both of these directions, focusing on instances of d-sri and d-srti for d ≥ 2, with the aim of drawing the line between polynomial-time solvability and NP-hardness for the associated problems in terms of d.

### Our Contribution

In Section 2 we study the problem of finding an egalitarian stable matching in an instance of d-sri. We show that this problem is NP-hard if d = 3, whilst there is a straightforward algorithm for the case that d = 2. We then consider the approximability of this problem for the case that d ≥ 3. We give an approximation algorithm with a performance guarantee of $$\frac {9}{7}$$ for the case that d = 3, $$\frac {11}{7}$$ if d = 4 and $$\frac {13}{7}$$ if d = 5. These performance guarantees improve on Feder’s 2-approximation algorithm for the general sri case [7, 8]. In Section 3 we turn to d-srti and prove that the problem of deciding whether an instance of 3-srti is solvable is NP-complete. We then show that the problem of finding a most-stable matching in an instance of d-srti is solvable in polynomial time if d = 2, whilst for d = 3 we show that this problem is NP-hard and not approximable within n1−ε, for any ε > 0, unless P = NP. Due to various complications, as explained in Section 4, we do not attempt to define and study egalitarian stable matchings in instances of srti. Some open problems are presented in Section 5. A structured overview of previous results and our results (marked by ∗) for d-sri and d-srti is contained in Table 1.
Table 1

Summary of results for d-sri and d-srti

Finding a stable matching

finding an egalitarian stable matching

d-sri

in P [12, 15]

in P for d = 2 (∗)

NP-hard even for d = 3 (∗)

$$\frac {2d+3}{7}$$-approximation for d ∈{3, 4, 5} (∗)

2-approximation for d ≥ 6 [7, 8]

d-srti

in P for d = 2 (∗)

NP-hard even for d = 3 (∗)

not well-defined (see Section 4)

### Related Work

Degree-bounded graphs, most-stable matchings and egalitarian stable matchings are widely studied concepts in the literature on matching under preferences [21]. As already mentioned, the problem of finding a most-stable matching has been studied previously in the context of sri [1]. In addition to the results surveyed already, the authors of [1] gave an O(mk+1) algorithm to find a matching M with |bp(M)|≤ k or report that no such matching exists, where m = |E| and k ≥ 1 is any integer. Most-stable matchings have also been considered in the context of d-sri [4]. The authors showed that, if d = 3, there is some constant c > 1 such that the problem of finding a most-stable matching is not approximable within c unless P = NP. On the other hand, they proved that the problem is solvable in polynomial time for d ≤ 2. The authors also gave a (2d − 3)-approximation algorithm for the problem for fixed d ≥ 3. This bound was improved to 2d − 4 if the given instance satisfies an additional condition (namely the absence of a structure called an elitist odd party). Most-stable matchings have also been studied in the bipartite restriction of sri called the Stable Marriage problem with Incomplete lists (smi) [5, 14]. Since every instance of smi admits a stable matching M (and hence bp(M) = ), the focus in [5, 14] was on finding maximum cardinality matchings with the minimum number of blocking edges.

Regarding the problem of finding an egalitarian stable matching in an instance of sri, as already mentioned Feder [7, 8] showed that this problem is NP-hard, though approximable within a factor of 2. A 2-approximation algorithm for this problem was also given independently by Gusfield and Pitt [13], and by Teo and Sethuraman [26]. These approximation algorithms can also be extended to the more general setting where we are given a weight function on the edges, and we seek a stable matching of minimum weight. Feder’s 2-approximation algorithm requires monotone, non-negative and integral edge weights, whereas with the help of LP techniques [25, 26], the integrality constraint can be dropped, while the monotonicity constraint can be partially relaxed. Chen et al. [6] study the fixed-parameter tractability of computing egalitarian stable matchings in the setting of srti.

## 2 The Egalitarian Stable Roommates Problem

In this section we consider the complexity and approximability of the problem of computing an egalitarian stable matching in instances of d-sri. We begin by defining the following problems.

### Problem 1

egal d -sri
Input:

A solvable instance $$\mathcal {I} = \langle G,\mathcal O\rangle$$ of d- sri , where G is a graph and $$\mathcal O$$ is a set of preference lists, each of length at most d.

Output:

An egalitarian stable matching M in$$\mathcal I$$.

The decision version of egald-sri is defined as follows:

### Problem 2

egald-sri dec
Input:

$$\mathcal {I} = \langle G,\mathcal O,K^{\prime }\rangle$$, where$$\langle G,\mathcal O\rangle$$is a solvable instance$$\mathcal I^{\prime }$$of d-sriandKis an integer.

Question:

Does$$\mathcal I^{\prime }$$admit a stable matching M with c(M) ≤ K?

In the following we give a reduction from the NP-complete decision version of Minimum Vertex Cover in cubic graphs to egal 3-sri dec, deriving the hardness of the latter problem.

### Theorem 1

egal 3-sri decisNP-complete.

### Proof

Clearly egal 3-sri dec belongs to NP. To show NP-hardness, we begin by defining the NP-complete problem that we will reduce to egal 3-sri dec. □

### Problem 3

3-vc
Input:

$$\mathcal {I} = \langle G, K \rangle$$ ,where G is a cubic graph and K is an integer.

Question:

Does G contain a vertex cover of size at most K?

3-vc is NP-complete [10, 20].

### Construction of the egal 3-sri dec Instance

Let 〈G,K〉 be an instance of 3-vc, where G = (V,E), E = {e1,…,em} and V = {v1,…,vn}. For each i (1 ≤ in), suppose that vi is incident to edges $$e_{j_{1}}$$, $$e_{j_{2}}$$ and $$e_{j_{3}}$$ in G, where without loss of generality j1 < j2 < j3. Define $$e_{i,s}=e_{j_{s}}$$ (1 ≤ s ≤ 3). Similarly for each j (1 ≤ jm), suppose that $$e_{j}=v_{i_{1}} v_{i_{2}}$$, where without loss of generality i1 < i2. Define $$v_{j,r}=v_{i_{r}}$$ (1 ≤ r ≤ 2). The use of this notation is illustrated in Fig. 1.
We now construct an instance $$\mathcal {I}$$ of 3-sri as follows. We define the following sets of vertices.
$$\begin{array}{lllllll} V^{\prime}&=&\{v_i^r &:& 1\leq i\leq n &\wedge& 1\leq r\leq 4\}\\ E^{\prime}&=&\{e_j^s &:& 1\leq j\leq &\wedge& 1\leq s\leq 2\}\\ W&=&\{w_i^r &:& 1\leq i\leq n &\wedge& 1\leq r\leq 4\}\\ Z&=&\{z_i^r &:& 1\leq i\leq n &\wedge& 1\leq r\leq 4\} \end{array}$$
Intuitively, $${v_{i}^{r}}\in V^{\prime }$$ corresponds to vertex vi and its incident edge ei,r, whilst $${e_{j}^{s}}\in E^{\prime }$$ corresponds to edge ej and its incident vertex vj,s. The set VEWZ constitutes the set of agents in $$\mathcal {I}$$, and the preference lists of the agents are as shown in Fig. 2. In the preference list of an agent $${v_{i}^{r}}$$ (1 ≤ in and 1 ≤ r ≤ 3), the symbol $$e({v_{i}^{r}})$$ denotes the agent $${e_{j}^{s}}\in E^{\prime }$$ such that ej = ei,r and vi = vj,s (that is, ej is the rth edge incident to vi and vi is the sth end-vertex of ej). Similarly in the preference list of an agent $${e_{j}^{s}}$$ (1 ≤ im and 1 ≤ s ≤ 2), the symbol $$v({e_{j}^{s}})$$ denotes the agent $${v_{i}^{r}}\in V^{\prime }$$ such that vi = vj,s and ej = ei,r (that is, vi is the s th end-vertex of ej and ej is the rth edge incident to vi).
Finally we define some further notation in $$\mathcal {I}$$. Let K = 7m + 19n + K. The following edge sets play a particular role in our proof. Addition is taken modulo 4 here.
$$\begin{array}{lllll} V_i^c&=&\{v_i^r w_i^r &:& 1\leq i\leq n\wedge 1\leq r\leq 4\}\\ V_i^u&=&\{v_i^r w_i^{r+1} &:& 1\leq i\leq n\wedge 1\leq r\leq 4\}\\ E_j^1&=&\{e_j^1 e_j^2, e_j^3 e_j^4 &:& 1\leq j\leq m\}\\ E_j^2&=&\{e_j^1 e_j^4, e_j^2 e_j^3 &:& 1\leq j\leq m\}\\ M_Z&=&\{z_i^1 z_i^2, z_i^3 z_i^4 &:& 1\leq i\leq n\} \end{array}$$

This finishes the construction of the egal 3-sri dec instance $$\mathcal {I}$$. In the remainder of the proof we show that G has a vertex cover C where |C|≤ K if and only if $$\mathcal {I}$$ has a stable matching M where c(M) ≤ K.

### Claim 2

IfGhas a vertex cover Csuch that |C| = kK, then there is a stable matchingMin$$\mathcal {I}$$such thatc(M) ≤ K.

### Proof

Suppose that G has a vertex cover C such that |C| = kK. We construct a matching M in $$\mathcal {I}$$ as follows. For each i (1 ≤ in), if viC, add $${V_{i}^{c}}$$ to M, otherwise add $${V_{i}^{u}}$$ to M. For each j (1 ≤ jm), if vj,1C, add $${E_{j}^{2}}$$ to M, otherwise add $${E_{j}^{1}}$$ to M. Finally add the pairs in MZ to M.

We now argue that M is stable. Suppose that $${e_{j}^{1}} {e_{j}^{4}}\in M$$ for some j (1 ≤ jm). Then $${E_{j}^{2}}\subseteq M$$, so vj,1C. Let vi = vj,1. Then by construction, $${V_{i}^{c}}\subseteq M$$, and hence $${v_{i}^{r}}$$ has his first choice for each r (1 ≤ r ≤ 4). Thus $${e_{j}^{1}}$$ does not form a blocking edge of M with $$v({e_{j}^{1}})$$. The argument is similar if $${e_{j}^{1}} {e_{j}^{2}}\in M$$ for some j (1 ≤ jm). Then $${E_{j}^{1}}\subseteq M$$, so vj,2C. Let vi = vj,2. Then by construction, VicM, and hence $${v_{i}^{r}}$$ has his first choice for each r (1 ≤ r ≤ 4). Thus $${e_{j}^{2}}$$ does not form a blocking edge of M with $$v({e_{j}^{1}})$$. Now suppose that $${v_{i}^{r}} w_{i}^{r+1}\in M$$ for some i (1 ≤ in) and r (1 ≤ r ≤ 3). Then $${V_{i}^{u}}\subseteq M$$, so viC. Let $${e_{j}^{s}}=e({v_{i}^{r}})$$. If s = 1 then vi = vj,1. Hence by construction of M, $${E_{j}^{1}}\subseteq M$$. Then $${e_{j}^{1}}$$ has his first-choice partner, so $${v_{i}^{r}}$$ does not block M with $$e({v_{i}^{r}})$$. If s = 2 then vi = vj,2. As vj,2C, it follows that vj,1C as C is a vertex cover. Hence by construction of M, $${E_{j}^{2}}\subseteq M$$. Then $${e_{j}^{2}}$$ has its first-choice partner, so $${v_{i}^{r}}$$ does not block M with $$e({v_{i}^{r}})$$. It is straightforward to verify that M cannot admit any other type of blocking edge, and thus M is stable in $$\mathcal {I}$$.

Clearly every agent in $$\mathcal {I}$$ is matched in M. We note that Theorem 4.5.2 of [12] implies that every stable matching in $$\mathcal {I}$$ matches every agent in $$\mathcal {I}$$ – we will use this fact in the next claim. We finally note that c(M) = 4k+12k+9(nk)+2(nk)+4(nk)+7m+4n = 7m+19n + kK, considering the contributions from the agents matched in $${V_{i}^{c}}$$, $${V_{i}^{u}}$$ (1 ≤ in), $${E_{j}^{1}}$$, $${E_{j}^{2}}$$ (1 ≤ jm) and MZ respectively. □

### Claim 3

If there is a stable matchingMin$$\mathcal {I}$$such thatc(M) ≤ KthenGhas a vertex coverCsuch that |C| = kK.

### Proof

Suppose that M is a stable matching in $$\mathcal {I}$$ such that c(M) ≤ K. We construct a set of vertices C in G as follows. As M matches every agent in $$\mathcal {I}$$, then for each i (1 ≤ in), either $${V_{i}^{c}}\subseteq M$$ or $${V_{i}^{u}}\subseteq M$$. In the former case add vi to C. Also, for each j (1 ≤ jm), as M matches every agent in $$\mathcal {I}$$, either $${E_{j}^{1}}\subseteq M$$ or $${E_{j}^{2}}\subseteq M$$. Finally, it follows that MZM.

We now argue that C is a vertex cover. Let j (1 ≤ jm) be given and suppose that vj,1C and vj,2C. Suppose firstly that $${E_{j}^{1}}\subseteq M$$. Let vi = vj,2. Then $${V_{i}^{u}}\subseteq M$$ by construction of C, so that $${e_{j}^{2}}$$ blocks M with $$v({e_{j}^{2}})$$, a contradiction. Now suppose that $${E_{j}^{2}}\subseteq M$$. Let vi = vj,1. Then $${V_{i}^{u}}\subseteq M$$ by construction of C, so that $${e_{j}^{1}}$$ blocks M with $$v({e_{j}^{1}})$$, a contradiction. Hence C is a vertex cover in G.

Moreover if k = |C| then given the composition of M, as noted in the previous claim, c(M) = 7m + 19n + k, and since c(M) ≤ K it follows that kK. □

Theorem 1 immediately implies the following result.

### Corollary 4

egal 3-sriisNP-hard.

We remark that egal 2-sri is trivially solvable in polynomial time: the components of the graph are paths and cycles in this case, and the cost of a stable matching selected in one component is not affected by the matching edges chosen in another component. Therefore we can deal with each path and cycle separately, minimising the cost of a stable matching in each. Paths and odd cycles admit exactly one stable matching (recall that (i) the instance is assumed to be solvable, and (ii) the set of matched agents is the same in all stable matchings [12, Theorem 4.5.2]), whilst even cycles admit at most two stable matchings (to find them, test each of the two perfect matchings for stability) – we can just pick the stable matching with lower cost in such a case. The following result is therefore immediate.

### Proposition 5

egal 2-sri admits a linear-time algorithm.

Corollary 4 naturally leads to the question of the approximabilty of egald-sri. As mentioned in the Introduction, Feder [7, 8] provided a 2-approximation algorithm for the problem of finding an egalitarian stable matching in an instance of sri. As Theorems 6, 8 and 10 show, this bound can be improved for instances with bounded-length preference lists.

### Theorem 6

egal 3-sriis approximable within 9/7.

### Proof

Let $$\mathcal I$$ be an instance of 3-sri and let Megal denote an egalitarian stable matching in $$\mathcal I$$. First we show that any stable matching in $$\mathcal I$$ is a 4/3-approximation to Megal. We then focus on the worst-case scenario when this ratio 4/3 is in fact realised. Then we design a weight function on the edges of the graph and apply Teo and Sethuraman’s 2-approximation algorithm [25, 26] to find an approximate solution M to a minimum weight stable matching Mopt for this weight function. This weight function helps M to avoid the worst case for the 4/3-approximation for a significant amount of the matching edges. We will ultimately show that M is in fact a 9/7-approximation to Megal. □

### Claim 7

In an instance ofegal 3-sri, any stable matching approximatesc(Megal) within a factor of 4/3.

### Proof

Let M be an arbitrary stable matching in $$\mathcal I$$. Call an edge uv an (i, j)-pair (ij) if v is u’s ith choice and u is v’s jth choice. By Theorem 4.5.2 of [12], the set of agents matched in Megal is identical to the set of agents matched in M. We will now study the worst approximation ratios in all cases of (i, j)-pairs, given that 1 ≤ ij ≤ 3 in 3-sri.
• If uvMegal is a (1,1)-pair then u and v contribute 2 to c(Megal) and also 2 to c(M) since they must be also be matched in M (and in every stable matching).

• If uvMegal is a (1,2)-pair then u and v contribute 3 to c(Megal) and at most 4 to c(M). Since, if uvM, then v must be matched to his 1st choice and u to his 2nd or 3rd, because one of u and v must be better off and the other must be worse off in M than in Megal.

• If uvMegal is a (1,3)-pair then u and v contribute 4 to c(Megal) and at most 5 to c(M). Since, if uvM, then v must be matched to his 1st or 2nd choice and u to his 2nd or 3rd.

• If uvMegal is a (2,2)-pair then u and v contribute 4 to c(Megal) and at most 4 to c(M). Since, if uvM, then one must be matched to his 1st choice and the other to his 3rd.

• If uvMegal is a (2,3)-pair then u and v contribute 5 to c(Megal) and at most 5 to c(M). Since, if uvM, then v must be matched to his 1st or 2nd choice and u to his 3rd.

• If uvMegal is a (3,3)-pair then u and v contribute 6 to c(Megal) and also 6 to c(M) since they must be also be matched in M (and in every stable matching – this follows by [12, Lemma 4.3.9]).

It follows that, for every pair uvMegal,
$$\begin{array}{@{}rcl@{}} \frac{\text{rank}(u,M(u))+\text{rank}(v,M(v))}{\text{rank}(u,M_{\text{egal}}(u))+\text{rank}(v,M_{\text{egal}}(v))} & = & \frac{\text{rank}(u,M(u))+\text{rank}(v,M(v))}{\text{rank}(u,v)+\text{rank}(v,u)}\\ & \leq & 4/3. \end{array}$$

Hence c(M)/c(Megal) ≤ 4/3 and Claim 7 is proved.

As shown in Claim 7, the only case when the approximation ratio 4/3 is reached is where Megal consists of (1,2)-pairs exclusively, while the stable matching output by the approximation algorithm contains (1,3)-pairs only. We will now present an algorithm that either delivers a stable solution M containing at least a significant amount of the (1,2)-pairs in Megal or a certificate that Megal contains only a few (1,2)-pairs and thus any stable solution is a good approximation.

To simplify our proof, we execute some basic pre-processing of the input graph. If there are any (1,1)-pairs in G, then these can be fixed, because they occur in every stable matching and thus can only lower the approximation ratio. Similarly, if an arbitrary stable matching contains a (3,3)-pair, then this edge appears in all stable matchings and thus we can fix it. Those (3,3)-pairs that do not belong to the set of stable edges can be deleted from the graph. From this point on, we assume that no edge is ranked first or last by both of its end vertices in G and prove the approximation ratio for such graphs.

Take the following weight function on all uvE:
$$w(uv) = \left\{\begin{array}{lllll} 0 &\quad\text{if } uv\text{ is a (1,2)-pair},\\ 1 &\quad\text{otherwise.} \end{array}\right.$$

We designed w(uv) to fit the necessary U-shaped condition of Teo and Sethuraman’s 2-approximation algorithm [25, 26]. This condition on the weight function is as follows. We are given a function fp on the neighbouring edges of a vertex p. Function fp is U-shaped if it is non-negative and there is a neighbour q of p so that fp is monotone decreasing on neighbours in order of p’s preference until q, and fp is monotone increasing on neighbours in order of p’s preference after q. The approximation guarantee of Teo and Sethuraman’s algorithm holds for an edge weight function w(uv) if for every edge uvE, w(uv) can be written as w(uv) = fu(uv) + fv(uv), where fu and fv are U-shaped functions.

Our w(uv) function is clearly U-shaped, because at each vertex the sequence of edges in order of preference is either monotone increasing or it is (1,0,1). Since w itself is U-shaped, it is easy to decompose it into a sum of U-shaped fv functions, for example by setting $$f_{v}(uv) = f_{u}(uv) = \frac {w(uv)}{2}$$ for every edge uv.

Let M denote an arbitrary stable matching, let M(1,2) be the set of (1,2)-pairs in M, and let Mopt be a minimum weight stable matching with respect to the weight function w(uv). Since Mopt is by definition the stable matching with the largest number of (1,2)-pairs, |M opt(1,2)|≥|M egal(1,2)|. We also know that w(M) = |M|−|M(1,2)| for every stable matching M.

Due to Teo and Sethuraman’s approximation algorithm [25, 26], it is possible to find a stable matching M whose weight approximates w(Mopt) within a factor of 2. Formally,
$$|M| - |M^{\prime (1,2)}| = w(M^{\prime}) \leq 2w(M_{\text{opt}}) = 2|M| - 2|M_{\text{opt}}^{(1,2)}|.$$
This gives us a lower bound on |M′(1,2)|.
$$|M^{\prime (1,2)}| \geq 2|M_{\text{opt}}^{(1,2)}| - |M| \geq 2|M_{\text{egal}}^{(1,2)}| - |M|$$
(1)
We distinguish two cases from here on, depending on the sign of the term on the right. In both cases, we establish a lower bound on c(Megal) and an upper bound on c(M). These will give the desired upper bound of 9/7 on $$\frac {c(M^{\prime })}{c(M_{\text {egal}})}$$.
1. 1)

2|M egal(1,2)|−|M|≤ 0

The derived lower bound for |M′(1,2)| is negative or zero in this case. Yet we know that at most half of the edges in Megal are (1,2)-pairs, and c(e) ≥ 4 for the rest of the edges in Megal. Let us denote |M|− 2|M egal(1,2)|≥ 0 by x. Thus, $$|M_{\text {egal}}^{(1,2)}|=\frac {|M|-x}{2}$$.
$$c(M_{\text{egal}}) \geq \frac{|M|-x}{2} \cdot 3 + \frac{|M|+x}{2} \cdot 4 = 3.5 |M| +0.5x$$
(2)
We use our arguments in the proof of Claim 7 to derive that an arbitrary stable matching approximates c(Megal) on the $$\frac {|M|-x}{2}$$ (1,2)-edges within a ratio of $$\frac {4}{3}$$, while its cost on the remaining $$\frac {|M|+x}{2}$$ edges is at most 5. These imply the following inequalities for an arbitrary stable matching M.
$$c(M) \leq \frac{|M|-x}{2} \cdot 3 \cdot \frac{4}{3} + \frac{|M|+x}{2} \cdot 5 = 4.5 |M| + 0.5x$$
(3)
We now combine (2) and (3). The last inequality holds for all x ≥ 0.
$$\begin{array}{llllllll} \frac{c(M)}{c(M_{\text{egal}})} &\leq \frac{4.5|M| +0.5x}{3.5|M| +0.5x} \leq \frac{9}{7}\ \end{array}$$

2. 2)

2|M egal(1,2)|−|M| > 0

Let us denote 2|M egal(1,2)|−|M| by $$\hat {x}$$. Notice that $$|M_{\text {egal}}^{(1,2)}| = \frac {\hat {x} + |M|}{2}$$. We can now express the number of edges with cost 3, and at least 4 in Megal.
$$\begin{array}{@{}rcl@{}} c(M_{\text{egal}}) & \geq & 3 \cdot \frac{\hat{x} + |M|}{2} + 4 \cdot \left( |M| - \frac{\hat{x} + |M|}{2}\right) \\ & = & 3.5|M| -0.5\hat{x} \end{array}$$
(4)
Let |M′(1,2)| = z1. Then exactly z1 edges in M have cost 3. It follows from (1) that $$z_{1}\geq \hat {x}$$. Suppose that z2z1 edges in M′(1,2) correspond to edges in M egal(1,2). Recall that $$|M_{\text {egal}}^{(1,2)}|=\frac {\hat {x}+|M|}{2}$$. The remaining $$\frac {|M|+\hat {x}}{2}-z_{2}$$ edges in M egal(1,2) have cost at most 4 in M. This leaves $$|M|-|M_{\text {egal}}^{(1,2)}|-(z_{1}-z_{2})=\frac {|M|-\hat {x}}{2}-z_{1}+z_{2}$$ edges in Megal that are as yet unaccounted for; these have cost at most 5 in both Megal and M. We thus obtain:
$$\begin{array}{@{}rcl@{}} c(M^{\prime}) & \leq & 3z_{1} + 4 \left( \frac{|M| + \hat{x}}{2}-z_{2}\right) + 5 \left( \frac{|M| - \hat{x}}{2}-z_{1}+z_{2}\right) \\ &=& 4.5|M| - 0.5\hat{x} -2 z_{1} + z_{2} \\ &\leq& 4.5|M| -1.5\hat{x} \end{array}$$
(5)
Combining (4) and (5) delivers the following bound.
$$\begin{array}{llllllll} \frac{c(M^{\prime})}{c(M_{\text{egal}})} &\leq \frac{4.5|M| -1.5\hat{x}}{3.5|M| -0.5\hat{x}} < \frac{9}{7}\ \end{array}$$
The last inequality holds for every $$\hat {x} > 0$$.

We derived that M, the 2-approximate solution with respect to the weight function w(uv) delivers a $$\frac {9}{7}$$-approximation in both cases. □

Using analogous techniques we can establish similar approximation bounds for egal 4-sri and egal 5-sri, as follows.

### Theorem 8

egal 4-sriis approximable within 11/7.

### Claim 9

In an instance ofegal 4-sri, any stable matching approximatesc(Megal) within a factor of 5/3.

### Proof

As earlier, we can fix all (1,1)-pairs and eliminate all (4,4)-pairs from the instance. Table 2 contains all cases for uv edges in Megal and the corresponding costs in an arbitrary stable matching.
Table 2

uv edges and the corresponding costs in egal 4-sri

uv

Worst case cost at u

Worst case cost at v

Cost ratio

(1,2)

4

1

5/3

(1,3)

4

2

6/4

(1,4)

4

3

7/5

(2,2)

4

1

5/4

(2,3)

4

2

6/5

(2,4)

4

3

7/6

(3,3)

4

2

6/6

(3,4)

4

3

7/7

We define the same weight function w(uv) as in the proof of Theorem 6. We remark here that w(uv) remains U-shaped for preference lists of length 4, because at each vertex the sequence of edges in order of preference is either monotone increasing or it is (1,0,1,1). Since we derived Inequality (1) without using the bounded degree property, it holds for egal 4-sri as well. We distinguish two cases based on the sign of 2|M egal(1,2)|−|M|.
1. 1)

2|M egal(1,2)|−|M|≤ 0

Let us denote |M|− 2|M egal(1,2)|≥ 0 by x. Thus, $$|M_{\text {egal}}^{(1,2)}|=\frac {|M|-x}{2}$$. Furthermore, let y denote the number of edges with cost at least 5 in Megal.
$$\begin{array}{@{}rcl@{}} c(M_{\text{egal}}) & \geq & \frac{|M|-x}{2} \cdot 3 + \left( \frac{|M|+x}{2} -y \right)\cdot 4 +5y\\ & = & 3.5 |M| +0.5x +y \end{array}$$
$$c(M) \leq \frac{|M|-x}{2} \cdot 3 \cdot \frac{5}{3} + \left( \frac{|M|+x}{2} -y \right) \cdot 6 + 7y= 5.5 |M| + 0.5x +y$$
$$\begin{array}{llllllll} \frac{c(M)}{c(M_{\text{egal}})} &\leq \frac{5.5|M| +0.5x+y}{3.5|M| +0.5x+y} \leq \frac{11}{7}\ \end{array}$$

2. 2)

2|M egal(1,2)|−|M| > 0

Let $$\hat {x}$$ denote 2|M egal(1,2)|−|M| and y the number of edges with cost at least 5 in Megal. Due to Inequality (1), we know that at least $$\hat {x}$$ (1,2)-pairs in Megal correspond to edges of cost 3 in M. The remaining $$\frac {|M|-\hat {x}}{2}$$ (1,2)-pairs in Megal correspond to edges of cost at most 5 in M.
$$c(M_{\text{egal}}) \geq \frac{\hat{x}+|M|}{2} \cdot 3 +4 \cdot(\frac{|M|-\hat{x}}{2}-y) +5y = 3.5 |M| -0.5 \hat{x} +y$$
$$c(M^{\prime}) \leq 3\hat{x} + 5\cdot \frac{|M|-\hat{x}}{2} +6\cdot (\frac{|M|-\hat{x}}{2} -y) + 7y = 5.5|M|-2.5\hat{x} +y$$

$$\begin{array}{llllllll} \frac{c(M^{\prime})}{c(M_{\text{egal}})} &\leq \frac{5.5|M| -2.5\hat{x} +y}{3.5|M| -0.5\hat{x} +y} < \frac{11}{7}\ \end{array}$$

### Theorem 10

egal 5-sriis approximable within 13/7.

### Claim 11

In an instance ofegal 5-sri, any stable matching approximatesc(Megal) within a factor of 2.

### Proof

As earlier, we can fix all (1,1)-pairs and eliminate all (5,5)-pairs from the instance. Table 3 contains all cases for uv edges in Megal and the corresponding costs in an arbitrary stable matching.
Table 3

uv edges and the corresponding costs in egal 5-sri

uv

Worst case cost at u

Worst case cost at v

Cost ratio

(1,2)

5

1

6/3

(1,3)

5

2

7/4

(1,4)

5

3

8/5

(1,5)

5

4

9/6

(2,2)

5

1

6/4

(2,3)

5

2

7/5

(2,4)

5

3

8/6

(2,5)

5

4

9/7

(3,3)

5

2

7/6

(3,4)

5

3

8/7

(3,5)

5

4

9/8

(4,4)

5

3

8/8

(4,5)

5

4

9/9

We remark that w(uv) remains U-shaped for preference lists of length 5, because at each vertex the sequence of edges in order of preference is either monotone increasing or it is (1,0,1,1,1). We observe that Inequality (1) holds for egal 5-sri as well. Thus we distinguish two cases based on the sign of 2|M egal(1,2)|−|M|.
1. 1)

2|M egal(1,2)|−|M|≤ 0

Let us denote |M|− 2|M egal(1,2)|≥ 0 by x. Thus, $$|M_{\text {egal}}^{(1,2)}|=\frac {|M|-x}{2}$$. Furthermore, let y be the number of edges with cost 5 and z the number of edges with cost at least 6 in Megal.
$$\begin{array}{@{}rcl@{}} c(M_{\text{egal}}) & \geq & \frac{|M|-x}{2} \cdot 3 + \left( \frac{|M|+x}{2} -y -z \right)\cdot 4 +5y + 6z \\ & = & 3.5 |M| +0.5x +y + 2z \end{array}$$
$$\begin{array}{@{}rcl@{}} c(M) & \leq & \frac{|M|-x}{2} \cdot 3 \cdot \frac{6}{3} + \left( \frac{|M|+x}{2} -y -z \right) \cdot 7 + 8y +9z \\ & = & 6.5 |M| + 0.5x +y + 2z \end{array}$$
$$\begin{array}{llllllll} \frac{c(M)}{c(M_{\text{egal}})} &\leq \frac{6.5 |M| + 0.5x +y + 2z}{3.5 |M| +0.5x +y + 2z} \leq \frac{13}{7}\ \end{array}$$

2. 2)

2|M egal(1,2)|−|M| > 0

Let $$\hat {x}$$ denote 2|M egal(1,2)|−|M|, y the number of edges with cost 5 and z the number of edges with cost at least 6 in Megal.
$$c(M_{\text{egal}}) \geq \frac{\hat{x}+|M|}{2} \cdot 3 +4 \cdot(\frac{|M|-\hat{x}}{2}-y-z) +5y +6z= 3.5 |M| -0.5 \hat{x} +y +2z$$
$$c(M^{\prime}) \leq 3\hat{x} + 6\cdot \frac{|M|-\hat{x}}{2} +7\cdot (\frac{|M|-\hat{x}}{2} -y-z) + 8y +9z = 6.5|M|-3.5\hat{x} +y +2z$$

$$\begin{array}{llllllll} \frac{c(M^{\prime})}{c(M_{\text{egal}})} &\leq \frac{6.5|M| -3.5\hat{x} +y +2z}{3.5|M| -0.5\hat{x} +y +2z} < \frac{13}{7}\ \end{array}$$

Using a similar reasoning for each d ≥ 6, our approach gives a cd-approximation algorithm for egald-sri where cd > 2. In these cases the 2-approximation algorithm of Feder [7, 8] should be used instead.

## 3 Solvability and Most-stable Matchings in d-srti

In this section we study the complexity and approximability of the problem of deciding whether an instance of d-srti admits a stable matching, and the problem of finding a most-stable matching given an instance of d-srti.

We begin by defining two problems that we will be studying in this section from the point of view of complexity and approximability.

### Problem 4

solvabled-srti
Input:

$$\mathcal {I} = \langle G, \mathcal O\rangle$$,whereGis a graph and$$\mathcal O$$is a set of preference lists, each of length at most d, possibly involving ties.

Question:

Is $$\mathcal {I}$$ solvable?

### Problem 5

min bpd-srti
Input:

An instance$$\mathcal I$$of d-srti.s

Output:

A matchingMin$$\mathcal {I}$$such that$$|bp(M)|=bp(\mathcal I)$$.

We will show that solvable 3-srti is NP-complete and min bp 3-srti is hard to approximate. In both cases we will use a reduction from the following satisfiability problem:

### Problem 6

(2,2)-e3-sat
Input:

$$\mathcal {I} = B$$ ,where B is a Boolean formula in CNF, in which each clause comprisesexactly 3 literals and each variable appears exactly twice in unnegated andexactly twice in negated form.

Question:

Is there a truth assignment satisfying B?

(2,2)-e3-sat is NP-complete, as shown by Berman et al. [2]. We begin with the hardness of solvable 3-srti.

### Theorem 12

solvable 3-srtiisNP-complete.

### Proof

Clearly solvable 3-srti belongs to NP. To show NP-hardness, we reduce from (2,2)-e3-sat as defined in Problem 6. Let B be a given instance of (2,2)-e3-sat, where X = {x1,x2,…,xn} is the set of variables and C = {c1,c2,…,cm} is the set of clauses. We form an instance $$\mathcal {I} = (G, \mathcal O)$$ of 3-srti as follows. Graph G consists of a variable gadget for each xi (1 ≤ in), a clause gadget for each cj (1 ≤ jm) and a set of interconnecting edges between them; these different parts of the construction, together with the preference orderings that constitute $$\mathcal O$$, are shown in Fig. 3 and will be described in more detail below.

When constructing G, we will keep track of the order of the three literals in each clause of B and the order of the two unnegated and two negated occurrences of each variable in B. Each of these four occurrences of each variable is represented by an interconnecting edge.

A variable gadget for a variable xi (1 ≤ in) of B comprises the 4-cycle 〈$${v_{i}^{1}}$$, $${v_{i}^{2}}$$, $${v_{i}^{3}}$$, $${v_{i}^{4}}$$〉 with cyclic preferences. Each of these four vertices is incident to an interconnecting edge. These edges end at specific vertices of clause gadgets. The clause gadget for a clause cj (1 ≤ jm) contains 20 vertices, three of which correspond to the literals in cj; these vertices are also incident to an interconnecting edge.

Due to the properties of (2,2)-e3-sat, xi occurs twice in unnegated form, say in clauses cj and ck of B. Its first appearance, as the r th literal of cj (1 ≤ r ≤ 3), is represented by the interconnecting edge between vertex $${v_{i}^{1}}$$ in the variable gadget corresponding to xi and vertex $${a_{j}^{r}}$$ in the clause gadget corresponding to cj. Similarly the second occurrence of xi, say as the s th literal of ck (1 ≤ s ≤ 3) is represented by the interconnecting edge between $${v_{i}^{3}}$$ and $${a_{k}^{s}}$$. The same variable xi also appears twice in negated form. Appropriate a-vertices in the gadgets representing those clauses are connected to $${v_{i}^{2}}$$ and $${v_{i}^{4}}$$. We remark that this construction involves a gadget similar to one presented by Biró et al. [4] in their proof of the NP-hardness of min bp 3-sri.

Now we prove that there is a truth assignment satisfying B if and only if there is a stable matching M in $$\mathcal I$$. □

### Claim 13

For any truth assignment satisfying B,a stable matchingMcan be constructedin$$\mathcal I$$.

### Proof

In Fig. 4, we define two matchings, $${M_{i}^{T}}$$ and $${M_{i}^{F}}$$, on the variable gadgets and three matchings, $${M_{j}^{1}}, {M_{j}^{2}}$$ and $${M_{j}^{3}}$$, on the clause gadgets.

If a variable xi (1 ≤ in) is assigned to be true, $${M_{i}^{T}}$$ is added to M, otherwise $${M_{i}^{F}}$$ is added. Similarly, since at least one literal in cj (1 ≤ jm) is true, let r (1 ≤ r ≤ 3) be the minimum integer such that the literal at position r of cj is true; add $${M_{j}^{r}}$$ to M. The intuition behind this choice is that if a literal is true, then the vertex representing it in the variable gadget is matched to its best choice. On the other hand, if some literals in a clause are true, then the vertex representing the appearance of one of them in that clause is matched to its last-choice vertex.

We claim that no edge blocks M. Checking the edges in the clause and variable gadgets is easy. The five special matchings were designed in such a way that no edge within the gadgets blocks them. More explanation is needed regarding the interconnecting edges. Suppose one of them, $${a_{j}^{r}} {v_{i}^{s}}$$, (r ∈ {1,2,3}, s ∈ {1,2,3,4}) blocks M. Since M is a perfect matching, $${a_{j}^{r}}$$ needs to be matched to its last choice, a q-vertex. Similarly, $${v_{i}^{s}}$$ has to be matched to its worst partner. While the partner of $${a_{j}^{r}}$$ indicates that the literal represented by $${v_{i}^{s}}$$ (xi or $$\bar {x}_{i}$$) is true in the clause, the partner of $${v_{i}^{s}}$$ means that the literal is false. □

### Claim 14

For any stable matching M in $$\mathcal I$$ , there is a truth assignment satisfying B.

### Proof

In the next three paragraphs we show that the restriction of M to any variable or clause gadget is one of the above listed special matchings, and no interconnecting edge is in M.

First of all, if a vertex u is the only first choice of another vertex, then u certainly needs to be matched in M. This property is fulfilled for all vertices of all clause gadgets except for $${y_{j}^{3}}$$ and $${z_{j}^{3}}$$ for each cj (1 ≤ jm). Let us first study clause gadget cj. If $${y_{j}^{4}}$$ is matched to $${y_{j}^{2}}$$, then $${y_{j}^{2}}{y_{j}^{3}}$$ blocks M. Thus, $${y_{j}^{3}} {y_{j}^{4}}$$, and similarly, $${z_{j}^{3}}{z_{j}^{4}}$$ are part of M for all clause gadgets.

Our proof for clause gadgets from this point involves considering matchings covering all twelve remaining vertices. We differentiate two possible cases, depending on the partner of $${p_{j}^{3}}$$. In the first case, $${p_{j}^{3}}$$$${b_{j}^{3}}$$M. Therefore, $${p_{j}^{2}}$$$${p_{j}^{1}}$$M too, because $${p_{j}^{2}}$$ has to be matched. For similar reasons, $$\{ {b_{j}^{1}}{a_{j}^{1}}, {b_{j}^{2}}{a_{j}^{2}}, {q_{j}^{1}}{q_{j}^{2}}, {q_{j}^{3}}{a_{j}^{3}}\}$$M. This gives us matching $${M_{j}^{3}}$$. In the second case, if $${p_{j}^{3}}$$ is matched to $${p_{j}^{2}}$$, then $$\{ {b_{j}^{3}}{a_{j}^{3}}, {q_{j}^{3}}{q_{j}^{2}} \} \subseteq M$$. There are two possible matchings on the remaining six vertices: $$\{{p_{j}^{1}}{b_{j}^{1}}, {a_{j}^{1}}{q_{j}^{1}}, {b_{j}^{2}}{a_{j}^{2}}\}$$ and $$\{{p_{j}^{1}}{b_{j}^{2}}, {q_{j}^{1}} {a_{j}^{2}},{b_{j}^{1}}{a_{j}^{1}}\}$$. These two matchings together with the lower part of the gadget form $${M_{j}^{1}}$$ and $${M_{j}^{2}}$$.

Since all a-vertices have a partner within their clause gadgets, no interconnecting edge can be a part of M. For the variable gadgets, it is straightforward to see that $${M_{i}^{T}}$$ and $${M_{i}^{F}}$$ are the only matchings covering all vertices of the 4-cycles.

The truth assignment to B is then defined in the following way. Each variable whose gadget has the edges of $${M_{i}^{T}}$$ in M is assigned to be true, while all other variables with $${M_{i}^{F}}$$ on their gadgets are false.

All that remains is to show that this is indeed a truth assignment. Suppose that there is an unsatisfied clause cj in B. Since all three of cj’s literals are false, every vertex $${v_{i}^{r}}$$ (1 ≤ in) such that $${v_{i}^{r}} {a_{j}^{s}}$$ is an interconnecting edge prefers $${a_{j}^{s}}$$ to its partner in M (1 ≤ s ≤ 3). Hence a blocking edge can only be avoided if $${a_{j}^{1}}{b_{j}^{1}}$$, $${a_{j}^{2}}{b_{j}^{2}}$$ and $${a_{j}^{3}}{b_{j}^{3}}$$ are all in M, which never occurs in any stable matching as shown above.

This finishes the proof of Theorem 12. □

Our construction shows that the complexity result holds even if the preference lists are either strictly ordered or consist of a single tie of length two. Moreover, Theorem 12 also immediately implies the following result.

### Corollary 15

min bp 3-srtiisNP-hard.

The following result strengthens Corollary 15.

### Theorem 16

min bp 3-srtiis not approximable within n1−ε, for anyε > 0, unless P = NP, where n is the number of agents.

### Proof

The core idea of the proof is to gather several copies of the 3-srti instance created in the proof of Theorem 12, together with a small unsolvable 3-srti instance. By doing so, we create a min bp 3-srti instance $$\mathcal {I}$$ in which $$bp(\mathcal {I})$$ is large if the Boolean formula B (originally given as an instance of (2,2)-e3-sat) is not satisfiable, and $$bp(\mathcal {I}) = 1$$ otherwise. Therefore, finding a good approximation for $$\mathcal I$$ will imply a polynomial-time algorithm to decide the satisfiability of B. Our proof is similar to that of an analogous inapproximabilty result for the problem of finding a most-stable matching in an instance of the Hospitals / Residents problem with Couples [3].

The smallest unsolvable instance of 3-srti is a 3-cycle with cyclic strict preferences. Aside from this, we add k disjoint copies of 3-srti instance created in the proof of Theorem 12 (from the same Boolean formula B), for large enough k. In particular we let c = ⌈2/ε⌉ and $$k = {n_{0}^{c}}$$, where n0 is the number of variables in B. We use m0 to denote the number of clauses in B. Let $$\mathcal I$$ be the instance of 3-srti that has been constructed. Due to the proof of Theorem 12 above, if B is satisfiable then $$bp(\mathcal I)=1$$, and if B is not satisfiable then $$bp(\mathcal I)\geq k+1$$. Hence a k-approximation algorithm for min bp 3-srti could be used to solve (2,2)-e3-sat in polynomial time.

In the remainder of the proof we show that n1−εk, where n is the number of agents in $$\mathcal I$$, which will imply the statement of the theorem. With Inequalities (6)–(9) we give an upper bound for n. This is used in Inequalities (11)–(14) as we establish k as an upper bound for n1−ε. Explanations for the steps are given as and when it is necessary after each set of inequalities.
$$\begin{array}{@{}rcl@{}} n &=& k(4n_{0}+20m_{0})+3 \end{array}$$
(6)
$$\begin{array}{@{}rcl@{}} &=& k(4n_{0}+20\frac{4n_{0}}{3})+3 \end{array}$$
(7)
$$\begin{array}{@{}rcl@{}} &\leq& 32kn_{0} \end{array}$$
(8)
$$\begin{array}{@{}rcl@{}} &=& 32 n_{0}^{c+1} \end{array}$$
(9)

In Equality (6) can be deduced by inspection of the 3-srti instance constructed in the proof of Theorem 12. In step (7) we substitute $$m_{0}=\frac {4n_{0}}{3}$$, which follows from the structure of B. We can assume without loss of generality that kn0 ≥ 3, which we use in Inequality (8). Finally, in Equality (9) we substitute $$k = {n_{0}^{c}}$$.

Since c = ⌈2/ε⌉, the following inequality also holds.
$$\frac{c-1}{c+1} = 1- \frac{2}{c+1} \geq 1-\varepsilon$$
(10)
We can now establish the desired upper bound for n1−ε.
$$\begin{array}{@{}rcl@{}} n^{1-\varepsilon} &\leq& n^{\frac{c-1}{c+1}} \end{array}$$
(11)
$$\begin{array}{@{}rcl@{}} & \leq& 32^{\frac{c-1}{c+1}} n_{0}^{c-1} \end{array}$$
(12)
$$\begin{array}{@{}rcl@{}} & \leq& {n_{0}^{c}} \end{array}$$
(13)
$$\begin{array}{@{}rcl@{}} & =&k \end{array}$$
(14)

Inequality (11) is obtained by raising n to the power of each side of Inequality (10). Inequality (12) follows from the bound for n established in Inequalities (6)–(9). Now in Inequality (13) we can assume without loss of generality that n0 ≥ 32 and use that $$\frac {c-1}{c+1} < 1$$. In the last step, we use the definition of k. □

To complete the study of cases of min bpd-srti, we establish a positive result for instances with degree at most 2.

### Theorem 17

min bp 2-srti is solvable in$$\mathcal {O}(|V|)$$time.

### Proof

For an instance $$\mathcal I$$ of min bp 2-srti, clearly every component of the underlying graph G is a path or cycle. We claim that $$bp(\mathcal {I})$$ equals the number of odd parties in G, where an odd party is a cycle C = 〈v1,v2,...,vk〉 of odd length, such that vi strictly prefers vi+1 to vi−1 (addition and subtraction are taken modulo k).

Since an odd party never admits a stable matching, $$bp(\mathcal {I})$$ is bounded below by the number of odd parties [24]. This bound is tight: by taking an arbitrary maximum matching in an odd party component, a most-stable matching is already reached. Now we show that a stable matching M can be constructed in all other components.

Each component that is not an odd cycle is therefore a bipartite subgraph (indeed either a path or an even cycle). Such a subgraph therefore gives rise to the restriction of srti called the Stable Marriage problem with Ties andIncomplete lists (smti). An instance of smti always admits a stable solution and it can be found in linear time [22]. Thus these components contribute no blocking edge.

Regarding odd-length cycles that are not odd parties, we will show that there is at least one vertex not strictly preferred by either of its adjacent vertices. Leaving this vertex uncovered and adding a perfect matching in the rest of the cycle results in a stable matching.

Assume that every vertex along a cycle Ck (where k is an odd number) is strictly preferred by at least one of its neighbours. Since each of the k vertices is strictly preferred by at least one vertex, and a vertex v can prefer at most one other vertex strictly, every vertex along Ck has a strictly ordered preference list. Now every vertex can point at its unique first-choice neighbour. To avoid an odd cycle, there must be a vertex pointed at by both of its neighbours. This implies that there is also a vertex v pointed at by no neighbour, and v is hence ranked second by both of its neighbours. □

## 4 Egalitarian Stable Matchings in srti

In this section we outline the difficulties one encounters when attempting to define and study the concept of an egalitarian stable matching in instances of srti.
• When considering the approximability of egald-sri, we restricted attention to the case of solvable instances, in the knowledge that solvability can be determined in linear time [15]. However in the case of srti, we can no longer assume this, since solvable 3-srti is NP-complete as Theorem 12 shows.

• In instances of egald-sri, not all agents are necessarily matched in all stable matchings, but due to Theorem 4.5.2 of [12], which states that the same agents are matched in all stable matchings, we can discard unmatched agents and consider only the remaining agents when reasoning about approximation algorithms. There is no analogue of Theorem 4.5.2 in the case of d-srti (indeed, stable matchings can be of different sizes in a given instance of srti [17]). This means that any approximation algorithm for the problem of finding an egalitarian stable matching in an instance of srti would need to consider the cost of an unmatched agent in a given stable matching, and the choice of value for such a case is not universally agreed upon in the literature. Chen et al. [6] study the fixed-parameter tractability of egal srti under different choices of cost value for an unmatched agent, namely 0, some positive constant and the length of its preference list.

• Similarly in the case of srti, the choice of value for the rank of an agent aj in a given agent ai’s preference list is again not universally agreed upon – for example if ai has a tie of length 2 at the head of his preference list, followed strictly by aj, then rank(ai,aj) could reasonably be defined to be either 2 or 3 depending on the definition adopted. In most competitions, everybody in the tie receives the rank that directly follows the number of agents ranked strictly higher than them, which would be 3 in the previous example. On the other hand, setting the rank to the number of ties (of any cardinality) in the list up to the current tie is the correct way of dealing with this issue in markets where agents rank their possible partners into well-separated tiers and the cardinalities of these do not matter as much as the tier they end up being matched to – this principle assigns 2 to rank(ai,aj) in the example above.

## 5 Open Questions

Theorems 6, 8 and 10 improve on the best known approximation factor for egald-sri for small d. It remains open to come up with an even better approximation or to establish an inapproximability bound matching our algorithm’s guarantee. A more general direction is to investigate whether the problem of finding a minimum weight stable matching can be approximated within a factor less than 2 for instances of d-sri for small d. Finally, the various alternatives regarding the definition of an egalitarian stable matching in instances of srti open the gate to a number of questions.

## Notes

### Acknowledgements

We thank the anonymous reviewers of this paper and an earlier version of it for their valuable comments, which helped to improve the presentation.

## References

1. 1.
Abraham, D J., Biró, P., Manlove, D.F.: “Almost stable” matchings in the roommates problem. In: Proceedings of WAOA ’05, vol. 3879 of Lecture Notes in Computer Science, pp 1–14. Springer, Berlin (2006)Google Scholar
2. 2.
Berman, P., Karpinski, M., Scott, A.D.: Approximation hardness of short symmetric instances of MAX-3SAT. ECCC report, no. 49 (2003)Google Scholar
3. 3.
Biró P., Manlove, D.F., McBride, I.: The Hospitals / Residents problem with couples: Complexity and integer programming models. In: Proceedings of SEA ’14, vol. 8504 of Lecture Notes in Computer Science, pp 10–21. Springer, Berlin (2014)Google Scholar
4. 4.
Biró, P., Manlove, D.F., McDermid, E.J: “Almost stable” matchings in the roommates problem with bounded preference lists. Theor. Comput. Sci. 432, 10–20 (2012)
5. 5.
Biró, P., Manlove, D.F., Mittal, S.: Size versus stability in the marriage problem. Theor. Comput. Sci. 411, 1828–1841 (2010)
6. 6.
Chen, J., Hermelin, D., Sorge, M., Yedidsion, H.: How hard is it to satisfy (almost) all roommates? arXiv:1707.04316 (2017)
7. 7.
Feder, T.: A new fixed point approach for stable networks and stable marriages. J. Comput. Syst. Sci. 45, 233–284 (1992)
8. 8.
Feder, T.: Network flow and 2-satisfiability. Algorithmica 11, 291–319 (1994)
9. 9.
Gale, D., Shapley, L.S.: College admissions and the stability of marriage. Amer. Math. Month. 69, 9–15 (1962)
10. 10.
Garey, M.R., Johnson, D.S., Stockmeyer, L.: Some simplified NP-complete graph problems. Theor. Comput. Sci. 1, 237–267 (1976)
11. 11.
Gusfield, D.: Three fast algorithms for four problems in stable marriage. SIAM J. Comput. 16(1), 111–128 (1987)
12. 12.
Gusfield, D., Irving, R.W.: The Stable Marriage Problem: Structure and Algorithms. MIT Press, Cambridge (1989)
13. 13.
Gusfield, D., Pitt, L.: A bounded approximation for the minimum cost 2-SAT problem. Algorithmica 8, 103–117 (1992)
14. 14.
Hamada, K., Iwama, K., Miyazaki, S.: An improved approximation lower bound for finding almost stable maximum matchings. Inf. Process. Lett. 109, 1036–1040 (2009)
15. 15.
Irving, R.W.: An efficient algorithm for the “stable roommates” problem. J. Algor. 6, 577–595 (1985)
16. 16.
Irving, R.W., Leather, P., Gusfield, D.: An efficient algorithm for the “optimal” stable marriage. J. ACM 34, 532–543 (1987)
17. 17.
Irving, R.W., Manlove, D.F.: The stable roommates problem with ties. J. Algor. 43, 85–105 (2002)
18. 18.
Kujansuu, E., Lindberg, T., Mäkinen, E.: The stable roommates problem and chess tournament pairings. Divulgaciones Matemáticas 7, 19–28 (1999)
19. 19.
Khot, S., Regev, O.: Vertex cover might be hard to approximate to within 2- ε. J. Comput. Syst. Sci. 74, 335–349 (2008)
20. 20.
Maier, D., Storer, J.: A note on the complexity of the superstring problem Technical Report 233, Princeton University, Department of Electrical Engineering and Computer Science, Princeton, NJ (1977)Google Scholar
21. 21.
Manlove, D.F.: Algorithmics of Matching Under Preferences. World Scientific, Singapore (2013)
22. 22.
Manlove, D.F., Irving, R.W., Iwama, K., Miyazaki, S., Morita, Y.: Hard variants of stable marriage. Theor. Comput. Sci. 276, 261–279 (2002)
23. 23.
Ronn, E.: NP-complete stable matching problems. J. Algor. 11, 285–304 (1990)
24. 24.
Tan, J.J.M.: A necessary and sufficient condition for the existence of a complete stable matching. J. Algor. 12, 154–178 (1991)
25. 25.
Teo, C-P, Sethuraman, J: LP based approach to optimal stable matchings. In: Proceedings of SODA ’97, pp 710–719. ACM-SIAM, New York (1997)Google Scholar
26. 26.
Teo, C.-P., Sethuraman, J.: The geometry of fractional stable matchings and its applications. Math. Oper. Res. 23, 874–891 (1998)

## Authors and Affiliations

• Ágnes Cseh
• 1
• 2
• Robert W. Irving
• 3
• David F. Manlove
• 3
1. 1.Institute of EconomicsHungarian Academy of SciencesBudapestHungary
2. 2.Department of Operations Research and Actuarial SciencesCorvinus University of BudapestBudapestHungary
3. 3.School of Computing ScienceUniversity of GlasgowGlasgowUK