Jointly stable matchings

In the stable marriage problem, we are given a set of men, a set of women, and each person’s preference list. Our task is to find a stable matching, that is, a matching admitting no unmatched (man, woman)-pair each of which improves the situation by being matched together. It is known that any instance admits at least one stable matching. In this paper, we consider a natural extension where k(≥2)\documentclass[12pt]{minimal} \usepackage{amsmath} \usepackage{wasysym} \usepackage{amsfonts} \usepackage{amssymb} \usepackage{amsbsy} \usepackage{mathrsfs} \usepackage{upgreek} \setlength{\oddsidemargin}{-69pt} \begin{document}$$k (\ge 2)$$\end{document} sets of preference lists Li\documentclass[12pt]{minimal} \usepackage{amsmath} \usepackage{wasysym} \usepackage{amsfonts} \usepackage{amssymb} \usepackage{amsbsy} \usepackage{mathrsfs} \usepackage{upgreek} \setlength{\oddsidemargin}{-69pt} \begin{document}$$L_{i}$$\end{document} (1≤i≤k\documentclass[12pt]{minimal} \usepackage{amsmath} \usepackage{wasysym} \usepackage{amsfonts} \usepackage{amssymb} \usepackage{amsbsy} \usepackage{mathrsfs} \usepackage{upgreek} \setlength{\oddsidemargin}{-69pt} \begin{document}$$1 \le i \le k$$\end{document}) over the same set of people are given, and the aim is to find a jointly stable matching, a matching that is stable with respect to all Li\documentclass[12pt]{minimal} \usepackage{amsmath} \usepackage{wasysym} \usepackage{amsfonts} \usepackage{amssymb} \usepackage{amsbsy} \usepackage{mathrsfs} \usepackage{upgreek} \setlength{\oddsidemargin}{-69pt} \begin{document}$$L_{i}$$\end{document}. We show that the decision problem is NP-complete for the following two restricted cases; (1) k=2\documentclass[12pt]{minimal} \usepackage{amsmath} \usepackage{wasysym} \usepackage{amsfonts} \usepackage{amssymb} \usepackage{amsbsy} \usepackage{mathrsfs} \usepackage{upgreek} \setlength{\oddsidemargin}{-69pt} \begin{document}$$k=2$$\end{document} and each person’s preference list is of length at most four, and (2) k=4\documentclass[12pt]{minimal} \usepackage{amsmath} \usepackage{wasysym} \usepackage{amsfonts} \usepackage{amssymb} \usepackage{amsbsy} \usepackage{mathrsfs} \usepackage{upgreek} \setlength{\oddsidemargin}{-69pt} \begin{document}$$k=4$$\end{document}, each man’s preference list is of length at most three, and each woman’s preference list is of length at most four. On the other hand, we show that it is solvable in linear time for any k if each man’s preference list is of length at most two (women’s lists can be of unbounded length). We also show that if each woman’s preference lists are same in all Li\documentclass[12pt]{minimal} \usepackage{amsmath} \usepackage{wasysym} \usepackage{amsfonts} \usepackage{amssymb} \usepackage{amsbsy} \usepackage{mathrsfs} \usepackage{upgreek} \setlength{\oddsidemargin}{-69pt} \begin{document}$$L_{i}$$\end{document}, then the problem can be solved in linear time.


Introduction
In this paper, we focus on the stable marriage problem (Gale and Shapley 1962) with incomplete preference lists (SMI). An instance I of SMI is a triple I = (U , W , L), where U and W are the sets of men and women, respectively, such that |U | = |W |(= n), and L is the set of 2n preference lists, one for each person. A person p's preference list in L is denoted by L( p). Each person's preference list strictly orders a subset of the members of the opposite gender. If a person p is included in L(q), we say that p is acceptable to q. If p is acceptable to q and vice versa, ( p, q) is called an acceptable pair.
A matching is a set of acceptable (man, woman)-pairs in which no person appears more than once. For a matching M, a man m, and a woman w, if (m, w) ∈ M then we write M(m) = w and M(w) = m. If there is no w (respectively, m) such that (m, w) ∈ M, we say that m (respectively, w) is single or unmatched in M. For a matching M, if (i) (m, w) is an acceptable pair, (ii) m is single in M or prefers w to M(m), and (iii) w is single in M or prefers m to M(w), then we say that (m, w) is a blocking pair for M in L, or (m, w) blocks M in L. If there is no blocking pair for M in L, then we say that M is stable in L. It is well-known that any SMI instance admits at least one stable matching (Gale and Shapley 1962).
In this paper, we consider an extension of SMI where two or more sets of preference lists are given. An instance I of the Stable Marriage problem with k Incomplete lists (SMk I ) is a (k + 2)-tuple I = (U , W , L 1 , L 2 , . . . , L k ), where U and W are the same as above, and each L i is a set of preference lists. It asks if there exists a matching M that is stable in every L i . We call such a matching M a jointly stable matching. Let a and b be positive integers. The restriction of SMkI where the lengths of preference lists of men are at most a and those of women are at most b is denoted by (a, b)-SMkI. If a (respectively, b) is ∞, it means that the lengths of men's (respectively, women's) preference lists are unbounded. By symmetry of men and women, we assume without loss of generality that a ≤ b. Note that, since the number of stable matchings grows exponentially in the size of the input (Irving and Leather 1986;Gusfield and Irving 1989;Thurber 2002;Karlin et al 2018), an algorithm of enumerating all the stable matchings for each L i and computing their intersection is not polynomial-time bounded.
Besides its theoretical interest, the problem has several applications: Consider a scenario of assigning medical residents to hospitals, where each resident needs to take training in three fixed clinical departments, e.g., surgery, pediatrics, and internal medicine, at an assigned hospital. A resident r ranks hospitals according to her preference, but her ranking of hospitals may differ depending on clinical departments. As a result, she has three (possibly different) preference lists over hospitals, L 1 (r ) for surgery, L 2 (r ) for pediatrics, and L 3 (r ) for internal medicine. On the other hand, each clinical department may have its own criteria for ranking residents, so each hospital h has three independent preference lists over residents, L 1 (h) from surgery, L 2 (h) from pediatrics, and L 3 (h) from internal medicine. Clearly a blocking pair in some L i may cause dissatisfaction to the corresponding resident and department, so we want to avoid such an assignment. Another example is a match making of Judo team competition. Suppose that there are five different weight classes, and one team consists of five players, one from each class. As a personal preference, a player p of team T who belongs to the weight class C is interested in only the players of the same class C, who are potential candidates for p's opponent. Therefore, each team has five preference lists corresponding to weight classes, and a matching avoiding blocking pairs in any class is desirable. Precisely speaking, the first and the second examples may be suitable to the Hospitals/Residents and the stable roommates, respectively, but we consider in this paper the stable marriage model as a first step.
We also show that SMkI (with unbounded-length preference lists) is solvable in polynomial time if L 1 (w) = L 2 (w) = · · · = L k (w) holds for every woman w. This can be thought of as a case where each woman has only one preference list, and one of its interpretations is a modification of the previous example of assigning residents to hospitals, where each resident has three preference lists as above, but each hospital has one preference list determined by e.g., a personnel director of the hospital, rather than three independent lists coming from each clinical department.

Related work
After publication of the conference version of this paper, we came to be aware of two closely related works. Aziz et al (2016) consider problems of finding a matching with the highest stability probability under uncertain circumstances. Among several problems they consider, the problem "ExistsCertainlyStableMatching", which asks to determine whether there is a matching with stability probability 1, under the joint probability model is equivalent to our SMkI. They focus on complete preference lists and show that SMkI is NP-complete for k ≥ 16. Their reduction implicitly bounds the length of preference lists to be at most four; hence they essentially show the NPcompleteness of (4, 4)-SMkI for k ≥ 16. Chen et al (2018) consider similar problems to ours, where multiple preference lists are given as an input. They introduce three stability notions and investigate their time complexities. One of their problems called the globally stable matching problem is equivalent to our SMkI, and they prove NPcompleteness of SMkI (with unbounded-length preference lists) for k ≥ 2. Weems (1999) has introduced the bistable matching problem; given an instance I of the stable marriage problem (where preference lists are complete), letÎ be the instance obtained by reversing the ordering of each preference list of I . A matching is bistable if it is stable in both I andÎ . This is a special case of SM2I where all the preference lists are complete and L 1 ( p) is a reversed order of L 2 ( p) for every person p. Weems showed an O(n 2 )-time algorithm to find a bistable matching or to report that none exists. Sethuraman and Teo (2001) showed that the bistable roommates problem can

NP-completeness
In this section, we show two hardness results.
Proof It is easy to see that (4, 4)-SMkI is in NP. In the following, we show that (4, 4)-SM2I is NP-hard. To show the NP-hardness for general k, one may simply set L 2 = L 3 = · · · = L k in the reduction.
We give a polynomial-time reduction from the well-known NP-complete problem 3CNF SAT. The definition of 3CNF SAT is as follows. Let x be a binary variable that takes 1(true) or 0(false). A literal is a variable x or its negation x. A clause is a disjunction of literals, and a Conjunctive Normal Form (CNF) formula is a conjunction of clauses. A 3CNF formula is a CNF formula in which each clause contains at most three literals. An instance of 3CNF SAT is a 3CNF formula f and it asks if there exists an assignment to variables that makes f true. We may assume without loss of generality that each clause contains exactly three literals. (If a clause contains less than three literals, then repeat the same literal.) Let f be an instance of 3CNF SAT, with variables x 1 , x 2 , . . . , x n and clauses C 1 , C 2 , . . . , C m . We construct an instance I of (4, 4)-SM2I. For each i (1 ≤ i ≤ n), let s i be the number of occurrences of the variable x i . For the jth literal of the variable x i (1 ≤ j ≤ s i ), we introduce two men a i, j and b i, j and two women c i, j and d i, j . We call them literal men and literal women. For each clause C , we introduce nine men u i (1 ≤ i ≤ 9) and nine women v i (1 ≤ i ≤ 9). We call them clause men and clause women. Note that there are 15m men and 15m women in total.
The preference lists of literal people and clause people are given in Figs. 1 and 2, respectively. (Here, for example, the notation "a : b c d" represents person a's preference list, where b, c, and d are the first, the second, and the third choices of a, respectively.) It might be helpful to see a high-level idea of the reduction before getting into the full construction of preference lists. For the four literal people corresponding to the jth literal of x i , we have two choices of matchings, namely M 1 to setting the jth occurrence of x i to 1 (0, respectively). For the 18 people corresponding to the clause C , we have three choices of matchings, depicted in Figs. 5, 6, and 7, respectively, in "Appendix". Choosing M 1 , M 2 , and M 3 , respectively, corresponds to satisfying C by its first, second, and third literal. Note then that main conditions for CNF SAT are (1) the jth occurrence of x i must have the same value for all j, and (2) each C is satisfied if and only if at least one of its literals is true. To simulate these conditions by (4, 4)-SM2I, we connect gadgets using some men and women in such a way that if some illegal choices of partial matchings are made, then there arises a blocking pair. The persons at the second position of L 2 in Fig. 1 exist for condition (1). They come from the literal gadgets corresponding to the ( j − 1)th and the ( j + 1)th occurrences of the same variable x i , and play a role of connecting literal gadgets like a chain, so that if M 1 i, j 1 and M 0 i, j 2 are chosen for some j 1 and j 2 , then there arises a blocking pair. Two persons V i, j and U i, j in L 1 of Fig. 1 and six persons D ,t and B ,t (t = 1, 2, 3) in L 1 of Fig. 2 exist for condition (2). They are placed in such a way that if (i) we attempt to satisfy C by its tth literal (i.e., M t is chosen), but (ii) the assignment to this literal is 0 by the choice in the literal gadget side, then there arises a blocking pair. Now we formally explain how to construct preference lists. In a i,1 and d i,1 's preference lists of L 2 in Fig. 1, c i, j−1 and b i, j−1 are null; hence their preference lists are of length two. Similarly, in b i,s i and c i,s i 's preference lists of L 2 , d i, j+1 and a i, j+1 are null. We then explain U i, j and V i, j in Fig. 1. Suppose that the jth occurrence of x i is the tth literal of the clause C . If this literal is positive, then U i, j is null and Fig. 2. Suppose that, for t = 1, 2, 3, the tth literal of the clause C is the jth occurrence of x i . If this literal is positive, then D ,t is null and B ,t = b i, j ; otherwise, B ,t is null and D ,t = d i, j . Now the reduction is completed. It is not hard to see that the reduction can be performed in polynomial time and each person's preference list is of length at most four.
We then proceed to the correctness proof. Suppose that f is satisfiable and let T be a satisfying assignment. We will construct a jointly stable matching M for I . For For each , suppose that the clause C is satisfied by its tth literal (if there are more than one true literal, choose one arbitrarily). Then we let M t ⊆ M. We next show that M is jointly stable.

Lemma 1 The matching M constructed as above is jointly stable.
Proof Consider literal people corresponding to then all the men are matched with their first choices in both L 1 and L 2 . Similarly, if T (x i ) = 0, then all the women are matched with their first choices. Therefore, no blocking pair arises within literal people corresponding to the same variable. Since literal people corresponding to different variables are unacceptable to each other, no blocking pair occurs between them.
As for the 18 people corresponding to the clause C , we can easily verify that, in any of M 1 , M 2 , and M 3 , no blocking pair arises among them by investigating Figs. 5, 6 and 7. Also, since clause people corresponding to different clauses are unacceptable to each other, no blocking pair occurs between them.
Finally, we consider a possibility of a blocking pair between a literal person and a clause person. Consider a clause C . First, suppose that M 1 is chosen as a part of M. By construction of M, this means that the clause C is satisfied by its first literal. Suppose that this literal is the jth occurrence of x i , and that it is a positive literal. Then by construction of preference lists, D ,1 is null and B ,1 = b i, j , so only the possible blocking pair is (b i, j , v ,4 ) in L 1 . However, since C is satisfied by the first literal, it must be the case that T (x i ) = 1. By construction of M, M 1 i, j ⊆ M and hence b i, j is matched with his first choice woman in L 1 , so he cannot form a blocking pair. Now suppose that the first literal of C is the jth occurrence of x i and it is a negative literal. Then B ,1 is null and D ,1 = d i, j , so only the possible blocking pair is (u ,1 , d i, j ) in L 1 . However, since C is satisfied by the first literal, we have that T (x i ) = 0 and hence d i, j is matched with her first choice man in L 1 , so d i, j cannot form a blocking pair. For the other two cases, that is, the case that M 2 is chosen and that M 3 is chosen, we can show that there is no blocking pair by a similar argument.
Conversely, suppose that I admits a jointly stable matching M. We construct a satisfying assignment T of f . First, we see basic properties of M.
Proof We first show that, for each i and j, either Suppose not. Since c i, j and d i, j are the only acceptable men to a i, j and b i, j in L 1 and L 2 in common, at least one of a i, j and b i, j , say m i, j , is single in M. For the same reason, at least one of c i, j and d i, Now suppose that the statement of the lemma is false. Then there are i and j Proof Suppose that there is a man m ∈ {u 1 , u 2 , u 3 } who is not matched with any of v 1 , v 2 , and v 3 in M. Note that D ,1 is a literal woman (if not null), who is not acceptable to u 1 in L 2 . Hence it must be the case that m is single in M. By a similar argument, there is a woman w ∈ {v 1 , v 2 , v 3 } who is single in M. Then (m , w ) blocks M in L 1 and L 2 , a contradiction. Therefore, u 1 , u 2 , and u 3 are matched with v 1 , v 2 , and v 3 in M. There are six possible ways, namely, It is easy to see that X 4 is blocked by (u 3 , v 1 ), X 5 is blocked by (u 2 , v 3 ), and X 6 is blocked by (u 1 , v 2 ) in L 1 . Therefore, only X 1 , X 2 , and X 3 can be a part of M. The same argument applies to u 4 , u 5 , u 6 , v 4 , v 5 , v 6 and u 7 , u 8 , u 9 , v 7 , v 8 , v 9 , implying that only We show that the remaining 24 matchings are unstable in L 2 . Table 1 shows 27 matchings in "Matching" columns and corresponding blocking pairs of 24 matchings in "BP" columns. This completes the proof.
By Lemma 2, either M 1 i, j ⊆ M for all j or M 0 i, j ⊆ M for all j holds. In the former case, we set T (x i ) = 1, otherwise, we set T (x i ) = 0. We show that T satisfies f . Suppose not, and let C be an unsatisfied clause. For t = 1, 2, 3, let the tth literal of C be the j t th occurrence of the variable x i t . We will show three claims: Consider the first literal of C . Suppose that it appears positively in C . Then by construction of the preference lists, the lists of b i 1 , j 1 and v 4 in L 1 are as follows: Next, suppose that the first literal of C is negative, i.e., x i 1 . Then by construction, the preference lists of d i 1 , j 1 and u 1 in L 1 are as follows: Since C is unsatisfied, T (x i 1 ) = 1 and so by construction of T , M 1 i 1 , j 1 ⊆ M, i.e., M(d i 1 , j 1 ) = b i 1 , j 1 . If M 1 ⊆ M, then M(u 1 ) = v 3 and hence (u 1 , d i 1 , j 1 ) blocks M in L 1 , a contradiction. Therefore, we can conclude that M 1 M.

Claim 2 M 2
M. Consider the second literal of C , and first suppose that it is a positive literal, i.e., x i 2 . Then by construction, the preference lists of b i 2 , j 2 and v 7 in L 1 are as follows: Next, suppose that the second literal of C is x i 2 . Then by construction, the preference lists of d i 2 , j 2 and u 4 in L 1 are as follows:

Claim 3 M 3
M. Consider the third literal of C . First, suppose that it is a positive literal x i 3 . Then by construction, the preference lists of b i 3 , j 3 and v 1 in L 1 are as follows: Next, suppose that the third literal of C is negative, i.e., x i 3 . Then by construction, the preference lists of d i 3 , j 3 and u 7 in L 1 are as follows: = v 9 and hence (u 7 , d i 3 , j 3 ) blocks M in L 1 , a contradiction. Therefore, we can conclude that M 3 M.
From Claims 1, 2, and 3, none of M 1 , M 2 , and M 3 can be a part of M, but this contradicts Lemma 3. Hence we conclude that T satisfies f , which completes the proof of Theorem 1.
By modifying the reduction in the proof of Theorem 1, we can show the NPcompleteness of another restricted case.

Theorem 2 For k ≥ 4, (3, 4)-SMkI is NP-complete.
Proof We assume that the readers have read the proof of Theorem 1, and give only a proof sketch. It is easy to see that (3, 4)-SMkI is in NP. It suffices to show the NPhardness of (3, 4)-SM4I, and to achieve this, we give a polynomial-time reduction from 3CNF SAT.
Let f be an instance of 3CNF SAT, consisting of variables x 1 , x 2 , . . . , x n and clauses C 1 , C 2 , . . . , C m . We construct an instance I of (3, 4)-SM4I. For each i (1 ≤ i ≤ n), let s i be the number of occurrences of the variable x i . For the jth literal of the variable x i (1 ≤ j ≤ s i ), we introduce two literal men a i, j and b i, j and two literal women c i, j and d i, j . For each clause C , we introduce three clause men u i (1 ≤ i ≤ 3) and three clause women v i (1 ≤ i ≤ 3). Note that there are 9m men and 9m women in total.
The preference lists of literal people are given in Fig. 3. As in the previous proof, their lists restrict a part of stable matchings to M 1 The structures of L 1 through L 3 depend on whether the corresponding literal (i.e., the jth occurrence of x i ) is positive or negative. If it is positive, then selecting M 0 i, j matches the man b i, j to the worse partner, which yields the risk of b i, j forming a blocking pair with V k i, j , while if it is negative, then selecting M 1 i, j does so. Suppose that the jth occurrence of x i is the tth literal of the clause C . Then V k i, j is defined as v 1 if k = t and it is null if k = t. L 4 is the same as L 2 in Fig. 1, whose role is to ensure that for each i, either M 1 i, j ⊆ M for all j, or M 0 i, j ⊆ M for all j, as was shown in Lemma 2.
The preference lists of clause people are given in Fig. 4. The role of L 4 is to restrict a part of stable matchings to Suppose that, for t = 1, 2, 3, the tth literal of the clause C is the jth occurrence of x i . Then B ,t is defined as b i, j . Now the reduction is completed. It is not hard to see that the reduction can be performed in polynomial time and each man's (woman's) preference list is of length at most three (at most four, respectively). Finally, we briefly explain the correctness of the reduction. Suppose that f is satisfiable and let T be a satisfying assignment. We will construct a jointly stable matching M for I as follows: For each i, if T (x i ) = 1, then we let M 1 i, j ⊆ M for all j, and if T (x i ) = 0, then we let M 0 i, j ⊆ M for all j. For each , if the clause C is satisfied by its tth literal, then we let M t ⊆ M. It is not hard to see that M is jointly stable.
Conversely, suppose that I admits a jointly stable matching M. We construct a satisfying assignment T of f in a straightforward manner. That is, we know that for each i, M 1 i, j ⊆ M for all j, or M 0 i, j ⊆ M for all j. In the former case, we set T (x i ) = 1, whereas in the latter case, we set T (x i ) = 0. In a similar way as the proof of Theorem 1, we can observe that T satisfies f .
In the above reductions, we have exploited existence of pairs that are acceptable in some L i but not in L j ( j = i). Then one may be curious about whether SMkI is solvable in polynomial time if the set of acceptable pairs is the same in all L i . However, this is unlikely, as shown in the following corollary. Let SMk denote the special case of SMkI where all the preference lists are complete. Clearly SMk satisfies the above mentioned condition.

Corollary 1 For k ≥ 2, SMk is NP-complete.
Proof Apparently SMk ∈ NP. For the NP-hardness, in the reduction given in the proof of Theorem 1, make every preference list complete by appending missing persons to the tail of the list in an arbitrary order. It is not hard to see that the same correctness proof (with slight modifications) applies.

Length-two preferences lists of one side
Our first positive result is for instances in which the length of preference lists of one side, say men's side, is bounded by two. In this subsection, we assume without loss of generality that acceptability is mutual, i.e., m is acceptable to w in L i if and only if w is acceptable to m in L i . This is because, if for example m is acceptable to w while w is not acceptable to m, then (m, w) can neither be a part of a matching nor a blocking pair. Hence we may remove m from w's list safely, without changing the set of jointly stable matchings. This preprocessing can be done in time linear in the total length of the input preference lists.
However, even if (m, w) is an acceptable pair in L i but is an unacceptable pair in L j ( j = i), we must not remove m and w from each other's list in L i . This is because, although (m, w) cannot be a pair in a jointly stable matching, it may block some matching in L i and removing it may change the set of jointly stable matchings.
The proof of Theorem 3 exploits a partially-ordered set (poset) of rotations and its relation to the whole set of stable matchings. These structural properties were originally studied for complete preference lists, but they can be extended easily and naturally to incomplete preference lists. Here we give brief explanations about them. See (Gusfield and Irving 1989) for more detail. Readers who are familiar with these notions may skip the following two paragraphs.
Let  w 1 ), . . . , (m r −1 , w r −1 ) (r ≥ 2) be a sequence of pairs such that each pair in ρ is contained in M and m i+1 = next M (m i ) for each i, where i + 1 is taken modulo r . Then we call ρ a rotation exposed in M. By eliminating a rotation ρ from M, we mean to replace pairs (m 0 , w 0 ), (m 1 , w 1 ), . . . , (m r −1 , w r −1 ) by (m 0 , w 1 ), (m 1 , w 2 ), . . . , (m r −1 , w 0 ) in M. The resulting matching, denoted by M/ρ, is also stable in I . Note that each man included in ρ has a worse partner in M/ρ than in M.
Let Π be the set of rotations that are exposed in one or more stable matchings for I . We can define a partial order on Π , and (Π , ) is called the rotation poset of I . A subset P ⊆ Π is called a closed subset of Π if for any ρ ∈ P and any ρ ρ, ρ ∈ P holds. There is a one-to-one correspondence between the stable matchings for I and the closed subsets of Π by the mapping defined as follows. Let M 0 be the man-optimal stable matching of I (which is guaranteed to exist and can be found by the men-oriented Gale-Shapley algorithm in time linear in the total length of preference lists). Let P be a closed subset of Π . If we eliminate rotations in P one by one according to the order , we obtain a stable matching for I . Conversely, any stable matching for I is obtained by this procedure for some closed subset of Π . In particular, the empty set corresponds to the man-optimal stable matching and the whole set Π corresponds to the woman-optimal stable matching (which is the opposite extreme to the man-optimal stable matching). The rotation poset can be constructed in time linear in the total length of preference lists (Sect. 3.3 of Gusfield and Irving 1989).

Theorem 3 (2, ∞)-SMkI is solvable in time O(kn).
Proof We first compute the man-optimal stable matchings M i for L i (i = 1, 2, . . . , k) using the men-oriented version of the Gale-Shapley algorithm. For each L i , any stable matching leaves the same set of men and women unmatched (Gale and Sotomayor 1985). Thus if there are i and j (i = j) such that the set of matched people in M i and that in M j are different, then we can immediately answer "no". In the following, we assume that the sets of matched people are the same in all M i .
For each i, we compute all the rotations ρ i 1 , ρ i 2 , . . . , ρ i n i with respect to L i . Since the length of each man's preference list is at most two, each man is contained in at most one rotation. This means that all the rotations are mutually incomparable in the rotation poset. Hence there is a one-to-one correspondence between the set of stable matchings for L i and the power set of . . , ρ i n i } (1 ≤ i ≤ k) such that M 1,S 1 = M 2,S 2 = · · · = M k,S k . For this purpose, we introduce a binary variable x i j for ρ i j (1 ≤ i ≤ k, 1 ≤ j ≤ n i ), where x i j = 1 means to put ρ i j in S i . We then construct a 2CNF SAT instance as follows.
For each man m who is matched in M 1 (and equivalently in all M i ), we fix the value of variables or construct 2CNF clauses to ensure that m's partners coincide in all M 1,S 1 , M 2,S 2 , . . . , M k,S k . If (m, w) is a pair in some stable matching of L, w is called m's stable partner in L. Also, if w is m's stable partner in all L i , w is called m's jointly stable partner. If m has no jointly stable partner, we immediately output "no". If m has one jointly stable partner w, then for each i, we enforce the variable (if any) to match m with w in M i,S i . Namely, if m is not included in a rotation, then there is no variable and we do nothing. If m is included in a rotation ρ i j and w is his first (second) choice in L i , then we set x i j = 0 (x i j = 1). During this course, if some variable is fixed differently, then we immediately output "no". Finally, suppose that m has two jointly stable partners w and w . This means that for each i, L i (m) contains both w and w and m is included in a rotation of L i . Let ρ i j i be the rotation that includes m. For each i = 2, . . . , k, we construct two clauses as follows: If the orders of w and w are same in L 1 (m) and L i (m), then we construct (x 1 j 1 ∨ x i j i ) and (x 1 j 1 ∨ x i j i ); these two clauses force x 1 j 1 = x i j i , meaning that inclusion of ρ 1 j 1 and ρ i j i to the respective posets should be the same. Otherwise, i.e. if the orders of w and w are different in L 1 (m) and L i (m), we construct (x 1 j 1 ∨ x i j i ) and (x 1 j 1 ∨ x i j i ). The construction of 2CNF formula is completed by doing this for all the men m who are matched in M 1 .
It is not hard to see that a satisfying assignment corresponds to subsets S i such that M 1,S 1 = M 2,S 2 = · · · = M k,S k .
Recall that men's preference lists are of length at most two and acceptability is mutual by assumption, so the total lengths of L i is O(n). Therefore, for each i, finding M i and computing the set of rotations of L i can be done in O(n) time, and hence in O(kn) time in total. Constructing 2CNF clauses for each man can be done in time O(k), and therefore O(kn) for at most n men. The resulting 2CNF formula has size O(kn). Finally, solving 2CNF satisfiability problem can be done in linear time (Even et al 1976;Aspvall et al 1979). Thus the overall time-complexity is O(kn).

Identical preference lists of one side
The next polynomial-time solvable case is that each woman's preference lists are identical in all L i . It should be noted that this condition is different from the so-called master lists where, in each L i , all the women have the same preference order derived from a fixed master list. (See, e.g., page 30 of Manlove 2013 for a formal definition of master lists.) In our case, w and w may have different preference lists.
In this subsection, we restrict inputs so that acceptability is mutual in each preference list set L i . Note that this assumption was made without loss of generality in Sect. 3.1, but we cannot do so here because preprocessing described in Sect. 3.1 (in particular, deleting some men from women's lists) would make some woman's list differ in L i and L j .

Remark
The case of the master list setting can be solved easily. In this case, each preference list set L i admits only one stable matching. Hence it suffices to compute the unique stable matching for each L i and see if the obtained k matchings are identical or not.

Theorem 4 If each woman's preference lists are identical in all L i (1 ≤ i ≤ k) and if in each L i acceptability is mutual, then SMkI is solvable in time O(N ), where N is the total length of preference lists in an input.
Proof Let I = (U , W , L 1 , L 2 , . . . , L k ) be an instance of SMkI. We first note that, since L 1 (w) = L 2 (w) = · · · = L k (w) for every woman w, for each man m the sets of women included in L i (m) are the same for all i, due to the mutual-acceptability assumption made at the beginning of this subsection. Now we construct a set L of preference lists from L 1 , L 2 , . . . , L k as follows: For each woman w, let L(w) := L 1 (w). For each man m, the set of women included in L(m) is the same as in L i (m), and their order is defined as follows. Let w and w be women in L(m). If m prefers w to w in all L i (m), then m prefers w to w in L(m). If m prefers w to w in some L i (m) and w to w in some L j (m), then m is indifferent between w and w in L(m). It is not hard to see that L(m) is a partially-ordered list and hence I = (U , W , L) can be regarded as an instance of the Stable Marriage problem with Partially-ordered and Incomplete lists (SMPI).
We now recall the super-stability (Gusfield and Irving 1989;Irving 1994) in the case that preference lists are not necessarily in a total order. For a matching M, (m, w) is a blocking pair in super-stability if (1) (m, w) / ∈ M but (m, w) is an acceptable pair,

Conclusion
In this paper, we considered a variant of the stable marriage problem in which we are given k sets of preference lists L 1 , L 2 , . . . , L k , and are asked to determine the existence of a matching that is stable with respect to all L i (1 ≤ i ≤ k). We have shown two NP-complete cases and one polynomially solvable case with respect to the lengths of preference lists. We also showed that the problem is solvable in linear time if every woman has an identical preference list in all L i . An important future work is to determine the complexity of (3, 3)-SMkI for k ≥ 2 and (3, )-SMkI for ≥ 4 and k = 2, 3. Another direction is approximability of SMkI; given an instance, find a matching that is stable in as many L i as possible. Finding a stable matching in any one list is a trivial k-approximation algorithm. On the other hand, using Theorem 1 we can easily deduce an approximation hardness of 2 − for even k and 2 − 2 k+1 − for odd k, for any positive constant under P =NP. Narrowing this gap is an interesting future work. Considering an alternative optimization criteria, e.g., minimizing the total number of blocking pairs over all L i , would also be attractive.