Abstract
In the stable marriage problem, any instance admits the so-called man-optimal stable matching, in which every man is assigned the best possible partner. However, there are instances for which all men receive low-ranked partners even in the man-optimal stable matching. In this paper we consider the problem of improving the man-optimal stable matching by changing only one man’s preference list. We show that the optimization variant and the decision variant of this problem can be solved in time and , respectively, where n is the number of men (women) in an input. We further extend the problem so that we are allowed to change k men’s preference lists. We show that the problem is W[1]-hard with respect to the parameter k and give -time and -time exact algorithms for the optimization and decision variants, respectively. Finally, we show that the problems become easy when ; we give -time and -time algorithms for the optimization and decision variants, respectively.
1. Introduction
An instance of the stable marriage problem [1] consists of the same number n of men and women, and each person’s preference list. In a preference list, each person ranks all the members of the opposite sex in a strict order. A matching is a set of n disjoint man–woman pairs in which each person appears exactly once. A blocking pair for a matching M is a man–woman pair each of whom prefers the other to his/her partner in M. A matching is stable if it contains no blocking pair.
It is known that there exists at least one stable matching in any instance, and one can be found by the Gale–Shapley algorithm (GS) in time [1,2]. The stable matching found by GS is called the man-optimal stable matching that has an extreme property that every man is assigned the best possible partner among all the stable matchings. In applications for asymmetric settings, such as assigning residents to hospitals or students to schools, it is common to formulate the problem by setting residents or students to the men’s side, so that those people can receive benefit. Nevertheless, there are instances for which all (or almost all) men are assigned low-ranked partners even in the man-optimal stable matching, (e.g., a worst case instance for GS given in Figure 1, which originates from [2]). For such instances, the merit of using the man-optimal mechanism cannot be sufficiently exploited.
Figure 1.
Worst case example for the Gale–Shapley algorithm for . Partners in the man-optimal stable matching are underlined. Each preference list is ordered from left to right in increasing order of the rank, i.e., the leftmost person is the most preferable and the rightmost person is the least preferable.
To overcome this drawback, we consider the problem of improving the man-optimal stable matching by allowing small changes in preference lists. In this paper we first allow only one man’s preference list to be changed, and consider optimization and decision variants. In the optimization variant, we are asked to find a man and a way of changing his list that cause the maximum improvement. In the decision variant, we ask if we can obtain a positive improvement. For both problems, we impose a restriction that no man should be assigned a worse partner than the man-optimal partner in the original instance. We show that these problems can be solved in time and , respectively. We then extend the problem so that we are allowed to change k men’s preference lists. We show that the optimization variant is W[1]-hard with respect to the parameter k. We also give -time and -time exact algorithms for the optimization and decision variants, respectively. Finally, we show that the problems become easy when , i.e., we are allowed to change the preference lists of any number of men. We give -time and -time algorithms for the optimization and decision variants, respectively.
Our problem can also be viewed as an issue of coalition strategy by men. Knowing all the preference lists, men are trying to maximize their total profit by submitting falsified preference lists, while bounding the number of such liars and guaranteeing that no one becomes worse off. Results of this paper show the computational complexities of obtaining an optimal strategy depending on the number k of liars. Strategic issue in the stable marriage problem is an extensively studied topic (see [3] for example).
2. Preliminaries
2.1. Problem Definitions
Let I be an instance of the stable marriage problem. In this paper, we consider only complete preference lists with no ties. The rank of a woman w in man m’s preference list, denoted , is one plus the number of women that precede w in m’s list. For a matching M and a person p, let be p’s partner in M. The score of m in M is the rank of his partner in M, i.e., . The score of M is the sum of the scores of all men, i.e., . The man-optimal score of I, denoted , is the score of the man-optimal stable matching of I.
Let k be a positive integer. If is an instance obtained by changing the preference lists of at most k men in I in some way, then we say that is a k-neighbor of I. Suppose that is a k-neighbor obtained by changing the preference lists of () and let be the man-optimal stable matching for . The man-optimal score of with respect to I, denoted , is the score of where ’s scores are measured in terms of their preference lists in I. (Intuitively, their scores are measured in their true preference lists.) We say that is proper if each man receives at least as good a partner in as in , i.e., for each m, where ’s scores are measured in their preference lists in I.
The problem MAX MAN-OPT IMPROVE(k) (MMI(k) for short) is, given a stable marriage instance I, to find a proper k-neighbor of I such that is maximized. The problem POSITIVE MAN-OPT IMPROVE(k) (PMI(k) for short) is to determine if there is a proper k-neighbor of I such that .
2.2. Reduced Lists and Rotation Digraphs
In constructing algorithms and proving W[1]-hardness, we use reduced lists and rotation digraphs. These are defined on an instance I and its stable matching M, and are constructed in the following way: For each man m and each woman w below in m’s preference list, delete w from m’s list and m from w’s list. The resulting preference lists are called the woman-oriented reduced lists with respect to I and M, denoted . (We may simply call them the reduced lists if there is no ambiguity). Note that for each woman w, lies at the top of w’s reduced list since M is stable. For each woman w, let be the man at the second position of w’s reduced list (if any). The woman-oriented rotation digraph with respect to I and M (or simply the rotation digraph) is a digraph where V is the set of men and A includes an arc (i.e., a directed edge from to ) for each woman w such that exists. Suppose that there is a directed cycle () in , and let for all i (). Then we call an ordered list of pairs a rotation exposed in M. If we modify M by removing the pairs of rotation ρ and adding for each i, then the resulting matching is also stable [2]. In this case we say that the new matching is obtained by eliminating the rotation ρ from M. Note that by eliminating a rotation, every man in the rotation obtains a better partner, while every woman in the rotation obtains a worse partner. It is also known that M is the man-optimal stable matching of I if and only if there is no rotation exposed in M (or equivalently, has no directed cycle) [2].
3. Changing One Man’s Preference List
3.1. Optimization Variant
Let I be a given instance and be its man-optimal stable matching. Let us fix a man m whose preference list is to be changed. The following proposition, due to Huang [3], is useful for our purpose. Recall that a preference list is ordered from left to right in increasing order of the rank.
Proposition 3.1
[3] Let be m’s preference list in I, where () denotes the left (right) part of in m’s list. Let be an instance constructed in the following way: Take any number of women from , move them to the right of , and arbitrarily permute each of the (new) left and right parts of . Let be the man-optimal stable matching for . Then in no man is worse off than in (with respect to preference order of I).
Then we can claim that there is an optimal solution in which lies at the top of m’s list for the following reason: Note that m cannot be matched with a woman worse than by the requirement of the problem. On the other hand, it is shown in [2] (page 56, Theorem 1.7.1) that m cannot get a better man-optimal partner by falsifying his preference list. Hence, in any feasible solution, m must be matched with . If is not at the top of m’s list in some feasible solution, we can move women on the left of to the right of without increasing the man-optimal score, by Proposition 3.1. Hence our claim holds. Since m is matched with in a feasible solution, the order of women other than in m’s list is not important. Hence all we need to do is to move to the top of m’s list, which implies the following simple Algorithm 1.
Example.
☐We give an example of the execution of Algorithm 1 for instance I given in Figure 1. The man-optimal stable matching is given in Figure 1 and . At line 2, we first consider . At line 3, we construct an instance by moving to the top of ’s list. By applying GS, we find that the man-optimal stable matching of is and . Next, we consider . The instance is constructed by moving to the top of ’s list. The man-optimal stable matching of is also and . By continuing this, we can find that . Hence, Algorithm 1 outputs since is the smallest.
| Algorithm 1: |
| 1: Find the man-optimal stable matching M0 of I. |
| 2: for each man m do |
| 3: Modify I by moving M0(m) to the top of m’s list. Let Im be the resulting instance. |
| 4: Apply GS to Im and find its man-optimal stable matching Mm. |
| 5: end for |
| 6: Let m* be a man such that the score of Mm* is minimum. |
| 7: Output Im* . |
Since GS runs in time , line 1 and the body of the for loop can be executed in time . Since there are n men, the overall time complexity of Algorithm 1 is .
Theorem 3.2
MMI(1) can be solved in time.
3.2. Decision Variant
Note that a direct application of Algorithm 1 solves PMI(1) in time. We improve this to using a structural property of stable matchings. Let I be an input. From the discussion in Section 3.1, it suffices to consider the instance for each man m (see the description of Algorithm 1 for the definition of .) It is not hard to see that the man-optimal stable matching of I is also stable in for any m. Hence, if is not the man-optimal stable matching of for some m, then the man-optimal stable matching of is better than , so the answer is “yes”; otherwise, the answer is “no”. To check whether is the man-optimal stable matching of or not in time per man, we use the woman-oriented rotation digraphs defined in Section 2.2.
Given I, we construct the rotation digraph with respect to the man-optimal stable matching . Clearly it is acyclic. For a man m, we construct the instance (defined before) and the rotation digraph (recall that is stable in and hence is defined). From the discussion in Section 2.2, we know that is the man-optimal stable matching of if and only if contains no cycle. Hence our task can be reduced to checking if contains a cycle. The pseudocode of our algorithm is given as Algorithm 2:
| Algorithm 2: |
| 1: Find the man-optimal stable matching M0 of I. |
| 2: Construct DI,M0 . |
| 3: for each man m do |
| 4: Modify I by moving M0(m) to the top of m’s list. Let Im be the resulting instance. |
| 5: Construct DIm,M0 . |
| 6: if DIm,M0 contains a cycle then |
| 7: Output “yes” and terminate. |
| 8: end if |
| 9: end for |
| 10: Output “no”. |
Example. We give an example of the execution of Algorithm 2 for instance I of Figure 1. The man-optimal stable matching is depicted in Figure 1. In constructing the reduced lists , we delete from , and ’s lists, and , and from ’s list. Hence is as follows:
| m1: w1 w2 w3 w4 w5 | w1: m2 m3 m4 m5 m1 |
| m2: w2 w3 w4 w1 | w2: m3 m4 m5 m1 m2 |
| m3: w3 w4 w1 w2 | w3: m4 m5 m1 m2 m3 |
| m4: w4 w1 w2 w3 | w4: m5 m1 m2 m3 m4 |
| m5: w1 w2 w3 w4 | w5: m1 |
The rotation digraph has four arcs , , , and , as illustrated in Figure 2(a).
Figure 2.
Rotation digraphs.
For a better exposition, let us first choose at line 3. To construct , we move to the top of ’s list. We then delete , , and from ’s list and from , , and ’s lists in , and we obtain the following :
| m1: w1 w2 w3 w4 w5 | w1: m2 m3 m4 m1 |
| m2: w2 w3 w4 w1 | w2: m3 m4 m1 m2 |
| m3: w3 w4 w1 w2 | w3: m4 m1 m2 m3 |
| m4: w4 w1 w2 w3 | w4: m5 m1 m2 m3 m4 |
| m5: w4 | w5: m1 |
To construct the rotation digraph , we remove an arc from and add because but . The resulting is depicted in Figure 2(b). This digraph contains no cycle and hence we proceed to the next man.
Next, suppose that we choose at line 3. Then is as follows:
| m1: w5 | w1: m2 m3 m4 m5 |
| m2: w2 w3 w4 w1 | w2: m3 m4 m5 m2 |
| m3: w3 w4 w1 w2 | w3: m4 m5 m2 m3 |
| m4: w4 w1 w2 w3 | w4: m5 m2 m3 m4 |
| m5: w1 w2 w3w4 | w5: m1 |
To construct the rotation digraph , we remove an arc from and add and obtain in Figure 2(c). Since contains a cycle, Algorithm 2 outputs “yes” and terminates. ☐
Lines 1 and 2 can be performed in time . Checking whether contains a directed cycle or not can be done by a standard topological sorting algorithm in time linear in the size of . Since each vertex of has outdegree at most one, the size of is and line 6 can be done in time. Shortly, we show that can be constructed from in time . Then the overall time complexity of Algorithm 2 is .
Note that the reduced lists can be constructed from by deleting each woman w who precedes from m’s preference list, and correspondingly m from w’s list. If m is not , then . Otherwise, i.e., if , then the man (say, ) at the third position of (if any) will be at the second position of , i.e., . Accordingly we must replace the directed edge by . By doing this for every such w, we can obtain in time .
Theorem 3.3
PMI(1) can be solved in time.
4. Changing k Men’s Preference Lists
4.1. Hardness Result
In this section, we show W[1]-hardness of MMI(k). This hardness implies that MMI(k) probably does not admit an FPT algorithm with parameter k, i.e., an -time algorithm where f is any function and p is a polynomial.
Theorem 4.1
MMI(k) with parameter k is W[1]-hard.
Proof.
The Densest k Subgraph problem (DkS) [4] is the following problem. We are given a graph G and a positive integer k. The task is to find an induced subgraph of G with k vertices that contains the maximum number of edges. It is known that DkS is W[1]-hard with parameter k [5]. We give an FPT-reduction from DkS to MMI(k).
Given an instance of DkS, we construct an instance of MMI(k) as follows. First, we let . Next, we construct I from . For each vertex , we construct a man and a woman . For each edge , we construct two men and and two women and . For a vertex , let be the set of edges incident to and be the set of women corresponding to . Each person’s preference list is constructed as follows, where is an arbitrarily ordered list of women in and “⋯” means an arbitrarily ordered list of those people who do not appear explicitly in the list.
| mi: L(Wi) wi … | (1 ≤ i ≤ |V|) | wi: mi … | (1 ≤ i ≤ |V|) |
| mi,j: wi,j … | ((i, j) ∈ E) | wi,j: mi,j mi mj … | ((i, j) ∈ E) |
| : wi,j … | ((i, j) ∈ E) | : mi, j … | ((i,j) ∈ E) |
It is not hard to see that the man-optimal stable matching of I consists of pairs for and and for . Note that if we ignore the “⋯” part in the above preference lists, each man is matched with the last woman and each woman is matched with the first man in . Hence these are the woman-oriented reduced lists with respect to I and , i.e., .
Clearly, the reduction can be performed in time polynomial in . To complete the proof, we show that G has an induced subgraph with vertices and at least s edges if and only if there is a proper -neighbor of I such that . Since , in the following we use k to denote and just for simplicity. First, suppose that G has an induced subgraph with k vertices and at least s edges, and let be the set of those k vertices. Then, for each , we modify ’s preference list by moving his man-optimal partner to the top of the list, and let be the resulting instance. We will show that, by doing this, and ’s scores in the man-optimal stable matching of are decreased by one respectively, if and . Since there are at least s such edges, the score is decreased by at least in total.
Recall that ’s reduced list in is “ ”. Since and and ’s preference lists are modified as mentioned above, ’s reduced list in becomes “ ”, i.e., . Note that ’s reduced list “ ” is unchanged. Then we have a directed cycle of length two in and if we eliminate this rotation, the scores of and will each be decreased by one. Note that we can repeat this argument independently for each edge.
Next, suppose that there is a proper k-neighbor of I such that and let be the man-optimal stable matching of . First, note that in , each man is matched with a woman on the reduced lists because by the condition of the problem, no man can be worse off in than in . Since is a perfect matching, we know that for each i () and either “ and ” or “ and ” for each . Therefore, only the case of “ and ”, the scores of and will each be decreased by one. This can happen only when becomes , that is, and are removed from ’s reduced list. This implies that precedes in ’s reduced list and precedes in ’s reduced list. Therefore, both and ’s lists are modified in . Since , there are at least s such pairs . Let S be the set of vertices such that ’s preference list is modified in constructing . Then and by the above discussion, S induces at least s edges, which completes the proof. ☐
4.2. Optimization Variant
From the discussion in Section 3.1, it seems that it would suffice to choose k men whose preference lists are to be modified, and move their man-optimal partners to the top of their respective preference lists. If this is true, we obtain an -time algorithm since there are combinations of selecting k men and for each of them, we run GS whose time complexity is . However, the following example (Figure 3) shows that this is not true.
Nevertheless, the following lemma allows the search space to be bounded.
Figure 3.
A counter example for the naive algorithm where . Man-optimal partners are underlined. An optimal solution is obtained by moving and to the top in ’s and ’s preference lists respectively, as a result of which the score decreases by seven. Any choice of two men and moving their man-optimal partners to the top decreases the score by at most five.
Lemma 4.2
For an instance I, let be an optimal solution and be the man-optimal stable matching of . Let S () be the set of men whose preference lists are modified in . Let be the instance obtained from I by moving to the top of m’s list for each . Then is stable, and in fact man-optimal stable, for .
Proof.
Suppose that has a blocking pair in . Each cannot be a part of a blocking pair because lies at the top of m’s list. But men not in S and all the women have the same preference list in and , so if is a blocking pair for in , then is also a blocking pair for in , a contradiction. Hence is stable for . ☐
Now suppose that is not man-optimal for and let be the man-optimal stable matching for . Since matches every man in S to his top choice in , so does . Thus some of the men not in S (whose preference lists are the same in I and ) obtain better partners in than in . This means that , which contradicts the optimality of .
By the definition of the problem, each man is matched in to the woman or a woman preceding . Hence by Lemma 4.2, if we fix the set of ℓ men whose preference lists are to be modified, it suffices to bring, for each selected man m, or a woman preceding to the top. Furthermore, we know that there is no stable matching for in which every man in S is matched to a woman strictly better than his man-optimal partner in [2]. Hence for at least one man in S, .
Putting these observations together, we have the following Algorithm 3. Let X be the set of men in a given instance.
Note that the operation of line 6 includes the case of leaving ’s preference list unchanged. Therefore at least one execution of Algorithm 3, i.e., an execution for which in the above discussion is selected in line 2 as m and the rest of the men in S are selected in line 4, creates in Lemma 4.2 and hence finds an optimal solution. The overall running time of Algorithm 3 is .
Theorem 4.3
MMI(k) can be solved in time.
| Algorithm 3: |
| 1: Find the man-optimal stable matching M0 of I. |
| 2: for each man m do |
| 3: Moving M0(m) to the top of m’s list. |
| 4: for each choice of k ‒ 1 men (m1, … , mk‒1) from X ‒ {m} do |
| 5: for each combination of k ‒ 1 women (w1, … , wk‒1) such that each wi is M0(mi) or precedes M0(mi) in mi’s list of I do |
| 6: Move wi to the top of mi’s preference list. |
| 7: end for |
| 8: Apply GS to the current instance and find its man-optimal stable matching. |
| 9: end for |
| 10: end for |
| 11: Output the instance that minimizes the man-optimal score. |
4.3. Decision Variant
A straightforward extension of Section 3.2 and Section 4.2 is as follows. We first find the man-optimal stable matching and construct the reduced list and the rotation digraph using time. For each of the possible modifications of preference lists, we modify in time and check if the resulting graph contains a directed cycle in time . If at least one execution creates a directed cycle, then the answer is “yes”, otherwise “no”. This results in the time complexity of .
We can reduce the search space significantly using the following idea. Suppose that input I is a “yes”-instance of PMI(k), and let be its optimal solution (when I is viewed as an MMI(k) instance). Let S () be the set of men whose preference lists are modified in . From the discussion in Section 4.2, we can assume that in the preference list of one man , is moved to the top in , and in the preference list of other men , or a woman preceding is moved to the top. Clearly, the rotation digraph must contain a directed cycle. Now, define as is moved to the top of m’s list in and consider the instance constructed from I by moving to the top of m’s list for each (and leaving m’s preference list for each unchanged). By the construction of reduced lists and rotation digraphs, it is not hard to see that is identical to and hence contains a directed cycle. (This can be seen as follows: If a man m is in or not in S, then m’s preference list is the same in and . If a man m is in , then the set of women preceding in m’s preference list is the same in and .) Therefore, it suffices, for each combination of choosing men, to move their man-optimal partners to the top of the lists, to modify the rotation digraph accordingly in time, and to check if the resulting digraph contains a directed cycle in time. The overall time complexity is
Theorem 4.4
PMI(k) can be solved in time.
5. Changing n Men’s Preference Lists
In this section, we show that MMI(k) and PMI(k) become easy if we are allowed to change any number of men’s preference lists. We first consider the optimization variant. Consider an instance I and its man-optimal stable matching . By the requirement of the problem, in a new matching each man m should be matched with the woman or a woman preceding in m’s list in I; in other words, each man should be matched with a woman on the reduced lists . Let be a minimum score perfect matching with this property. If we move to the top of m’s list for each m, we are done because is clearly the man-optimal stable matching of the resulting instance.
It is easy to find : We construct the edge-weighted bipartite graph where V and U are the sets of men and women respectively, and if and only if w appears on m’s reduced list in . The weight of is the rank of w in m’s list in I, that is, . We can obtain by finding a minimum cost perfect matching in G, which can be done in time [6,7]. Since finding and constructing can be done in time, the overall time complexity is .
Theorem 5.1
MMI(n) can be solved in time.
As for the decision variant, we do not need to find a minimum cost perfect matching but it suffices to check if can be Pareto improved. We can do this by constructing the digraph , where each vertex of G corresponds to a woman in a given instance I. For each man m, we include an arc from to each woman preceding in m’s preference list. It is not hard to see that can be Pareto improved if and only if G contains a directed cycle. As mentioned in the analysis of the time complexity of Algorithm 2 in Section 3.2, we can check whether G contains a directed cycle or not by a topological sorting algorithm in time linear in the size of G. Since the size of G is , it is not hard to see that the overall time complexity is .
Theorem 5.2
PMI(n) can be solved in time.
6. Conclusions
In this paper we considered the problem of changing at most k men’s preference lists to improve man-optimal stable matchings. We have proved that the problem is W[1]-hard with the parameter k. We also presented -time and -time exact algorithms for the optimization and decision variants, respectively. Finally, we have presented -time and -time algorithms for the optimization and decision variants, respectively, when . Since the problem is important when k is small, it is interesting future work to reduce the time complexity of MMI(1) from to . Another future work is to determine whether PMI(k) is NP-complete or not.
Acknowledgements
Kazuo Iwama is supported by JSPS KAKENHI Grant Number 22240001, and Shuichi Miyazaki is supported by JSPS KAKENHI Grant Number 20700009 and 24500013.
References
- Gale, D.; Shapley, L.S. College admissions and the stability of marriage. Am. Math. Mon. 1962, 69, 9–15. [Google Scholar] [CrossRef]
- Gusfield, D.; Irving, R.W. The Stable Marriage Problem: Structure and Algorithms; MIT Press: Boston, MA, USA, 1989. [Google Scholar]
- Huang, C.-C. Cheating by Men in the Gale-Shapley Stable Matching Algorithm. In Proceedings of the ESA 2006, Zurich, Switzerland, 11–13 September 2006; pp. 418–431.
- Bhaskara, A.; Charikar, M.; Chlamtac, E.; Feige, U.; Vijayaraghavan, A. Detecting High Log-densities–an O(n1/4) Approximation for Densest k-Subgraph. In Proceedings of the STOC 2010, Cambridge, USA, 5–8 June 2010; pp. 201–210.
- Komusiewicz, C.; Sorge, M. Finding dense subgraphs of sparse graphs. Proc. IPEC 2012 2012, 7535, 242–251. [Google Scholar]
- Burkard, R.; Dell’Amico, M.; Martello, S. Assignment Problems; SIAM: Philadelphia, PA, USA, 2008. [Google Scholar]
- Gabow, H.N.; Tarjan, R.E. Faster scaling algorithms for network problems. SIAM J. Comput. 1989, 18, 1013–1036. [Google Scholar] [CrossRef]
© 2013 by the authors. Licensee MDPI, Basel, Switzerland. This article is an open access article distributed under the terms and conditions of the Creative Commons Attribution license ( http://creativecommons.org/licenses/by/3.0/).