The Generalized Median Stable Matchings: finding them is not that easy

Similar documents
The Man-Exchange Stable Marriage Problem

Stable Matching Problems with Exchange Restrictions

SEQUENTIAL ENTRY IN ONE-TO-ONE MATCHING MARKETS

Stable Marriage with Ties and Bounded Length Preference Lists

Input. A set of men M, and a set of women W.

Weights in stable marriage problems increase manipulation opportunities

Three-dimensional Stable Matching Problems. Cheng Ng and Daniel S. Hirschberg. Department of Information and Computer Science

Cheating to Get Better Roommates in a Random Stable Matching

Bipartite Matchings and Stable Marriage

Lecture 5: The Principle of Deferred Decisions. Chernoff Bounds

Strategic Behavior and Manipulation in Gender- Neutral Matching Algorithms

On rank-profiles of stable matchings a

Marriage Matching: A Conjecture of Donald Knuth

An Efficient Algorithm for Batch Stability Testing

Published: Social Choice and Welfare, 33(1), June 2009, pp doi: /s SEQUENTIAL ENTRY IN MANY-TO-ONE MATCHING MARKETS

Modelling and Solving the Stable Marriage Problem Using Constraint Programming

1. REPRESENTATIVE PROBLEMS

Matching Theory and the Allocation of Kidney Transplantations

Glasgow eprints Service

An improved approximation algorithm for the stable marriage problem with one-sided ties

Matching Theory. Mihai Manea. Based on slides by Fuhito Kojima. MIT

Weights in Stable Marriage Problems Increase Manipulation Opportunities

STABLE MARRIAGE PROBLEM WITH TIES AND INCOMPLETE BOUNDED LENGTH PREFERENCE LIST UNDER SOCIAL STABILITY

Improving Man-Optimal Stable Matchings by Minimum Change of Preference Lists

1 Definitions and Things You Know

Two s Company, Three s a Crowd: Stable Family and Threesome Roommates Problems

Coalition Manipulation of the Gale-Shapley Algorithm

Incentives in Large Random Two-Sided Markets

A (ln 4)-Approximation Algorithm for Maximum Stable Matching with One-Sided Ties and Incomplete Lists

Stable matching. Carlos Hurtado. July 5th, Department of Economics University of Illinois at Urbana-Champaign

Matchings in Graphs. Definition 3 A matching N in G is said to be stable if it does not contain a blocking pair.

Two-sided Matching Theory

We set up the basic model of two-sided, one-to-one matching

Ma/CS 6b Class 3: Stable Matchings

Matching: The Theory. Muriel Niederle Stanford and NBER. September 26, 2011

Ma/CS 6b Class 3: Stable Matchings

Approximation Algorithms for Stable Marriage Problems

The key is that there are two disjoint populations, and everyone in the market is on either one side or the other

ONLINE APPENDIX TO HOW TO CONTROL CONTROLLED SCHOOL CHOICE (NOT FOR PUBLICATION)

THREE ESSAYS ON GAME THEORY. Demet Yilmazkuday. Dissertation. Submitted to the Faculty of the. Graduate School of Vanderbilt University

CSC2556. Lecture 5. Matching - Stable Matching - Kidney Exchange [Slides : Ariel D. Procaccia]

Finding Stable Matchings that are Robust to Errors in the Input

Local Search Approaches in Stable Matching Problems

An Equivalence result in School Choice

DISTRIBUTIVE LATTICES, STABLE MATCHINGS, AND ROBUST SOLUTIONS. A Dissertation Presented to The Academic Faculty. Tung Mai

Advanced Algorithms. Lecture Notes for April 5, 2016 Dynamic programming, continued (HMMs); Iterative improvement Bernard Moret

Glasgow eprints Service

Analysis of Algorithms Fall Some Representative Problems Stable Matching

Two Sided Matching: An Algorithm with both sides making proposals

1. REPRESENTATIVE PROBLEMS

Stable Matching with Uncertain Linear Preferences

Subramanian s stable matching algorithm

What do you do when you can t use money to solve your problems?

Petty Envy When Assigning Objects

This is the author s final accepted version.

Stable Matching Existence, Computation, Convergence Correlated Preferences. Stable Matching. Algorithmic Game Theory.

The Complexity of the Comparator Circuit Value Problem

14.1 Finding frequent elements in stream

Game Theory: Lecture #5

Algorithmics of Two-Sided Matching Problems

The stable marriage problem with restricted pairs

TWO-SIDED MATCHING WITH EXTERNALITIES: A SURVEY

Deposited on: 30 September 2010

Two-Sided Matching. Terence Johnson. December 1, University of Notre Dame. Terence Johnson (ND) Two-Sided Matching December 1, / 47

The Importance of Irrelevance of Rejected Contracts in Matching under Weakened Substitutes Conditions

AN IMPOSSIBILITY THEOREM IN MATCHING PROBLEMS

Disjoint paths in unions of tournaments

Random paths to stability in the roommate problem

1. STABLE MATCHING. stable matching problem Gale Shapley algorithm hospital optimality context

Hannu Salonen and Mikko A.A. Salonen Mutually Best Matches. Aboa Centre for Economics

Approximation and Randomized Algorithms (ARA) Lecture 1, September 3, 2012

Matching with Couples: Semi-Stability and Algorithm

arxiv: v1 [math.co] 13 Dec 2014

Efficient Algorithms for Bipartite Matching Problems with Preferences

Matching Markets with Couples Revisited

Matching Problems. Roberto Lucchetti. Politecnico di Milano

Matching. Terence Johnson. April 17, University of Notre Dame. Terence Johnson (ND) Matching April 17, / 41

What Matchings Can be Stable? Refutability in Matching Theory

arxiv: v1 [cs.gt] 11 Jul 2016

MA 524 Final Fall 2015 Solutions

Manipulability in matching markets: conflict and coincidence of interests

Online Appendix for Incentives in Landing Slot Problems

Efficiency and Stability of Probabilistic Assignments in Marriage Problems

Random Matching under Priorities: Stability and No Envy Concepts

Recent Advances in Generalized Matching Theory

COOPERATIVE GAME THEORY: CORE AND SHAPLEY VALUE

APPROXIMATION ALGORITHMS FOR THE STABLE MATCHING PROBLEM

Dynamic Matching with a Fall-back Option

The Blocking Lemma and Strategy-Proofness in Many-to-Many Matchings

Pareto Optimality in Coalition Formation

What Matchings Can Be Stable? The Testable Implications of Matching Theory 1

Socially stable matchings in the Hospitals/Residents problem

Matching with Myopic and Farsighted Players

1. REPRESENTATIVE PROBLEMS

Matching with Couples: Semi-Stability and Algorithm

Sisterhood in the Gale-Shapley Matching Algorithm

The Complexity of Computing the Random Priority Allocation Matrix

Math 301: Matchings in Graphs

Competition and Resource Sensitivity in Marriage and Roommate Markets

Stability and the Core of Probabilistic Marriage Problems

Transcription:

The Generalized Median Stable Matchings: finding them is not that easy Christine T. Cheng Department of Computer Science University of Wisconsin Milwaukee, Milwaukee, WI 53211, USA. ccheng@cs.uwm.edu Abstract. Let I be a stable matching instance with N stable matchings. For each man m, order his N stable partners from his most preferred to his least preferred. Denote the ith woman in his sorted list as p i(m). Let α i consist of the man-woman pairs where each man m is matched to p i(m). Teo and Sethuraman proved this surprising result: for i = 1 to N, not only is α i a matching, it is also stable. The α i s are called the generalized median stable matchings of I. In this paper, we present a new characterization of these stable matchings that is solely based on I s rotation poset. We then prove the following: when i = O(log n), where n is the number of men, α i can be found efficiently; but when i is a constant fraction of N, finding α i is NPhard. We also consider what it means to approximate the median stable matching of I, and present results for this problem. 1 Introduction In the stable marriage problem (SM), there are n men and n women, each of whom has a list that ranks all individuals of the opposite sex. A matching is a set of man-woman pairs where each individual appears in at most one pair. The objective of the problem is to find a matching µ that has n pairs and has no blocking pairs i.e., a man and a woman who prefer each other over their partners in µ. The rationale behind the stability condition is that if a blocking pair exists, then the man and the woman will likely leave their partners and thereby compromise the integrity of the matching µ. A celebrated result by Gale and Shapley states that every instance of SM has a stable matching that can be found in O(n 2 ) time [5]. Today, centralized stable matching algorithms match medical residents to hospitals [14], students to schools [1, 2], etc. To find a stable matching for an arbitrary instance, Gale and Shapley presented the deferred-acceptance (DA) algorithm, where the men ask and the women accept or reject offers. The result is the man-optimal/woman-pessimal stable matching every man is matched to the woman he prefers the most among all his partners in a stable matching and every woman is matched to the man she prefers the least among all her partners in a stable matching. On the other hand, when the men and women switch roles, the result is the womanoptimal/man-pessimal stable matching and is defined accordingly. Thus, while

the DA algorithm produces a stable matching, one may not want to use the matching because it is biased towards one side of the matching. This motivates the problem of finding fair stable matchings. Different notions of fair stable matchings have been considered in the past. Suppose a person s happiness in a stable matching is based on his/her partner s rank in his/her preference list. Selkow [12] and, later, Gusfield [6] studied the minimum-regret stable matching, which maximizes the happiness of the unhappiest person in the matching. Irving et al. [9], on the other hand, considered the egalitarian stable matching, which maximizes the sum of the happiness of all the participants. In both cases, the proposed stable matchings can be found in polynomial time. However, by using global measures, these types of stable matchings may sacrifice the happiness of some individuals as they aim for the greater good. In another direction, Klaus and Klijn [11] suggested designing probabilistic matching mechanisms that are procedurally fair. That is, a stable matching is considered fair if the procedure used to arrive at the outcome is equitable to all the participants. They studied three different random mechanisms and the probability distributions they induce on the stable matchings of an instance. Yet another notion of fair stable matchings is due to Teo and Sethuraman [15]. Let I be a stable matching instance, M(I) its set of stable matchings, and N = M(I). Let p µ (a) denote the partner of a in stable matching µ. For each man m, sort the multiset of women {p µ (m), µ M(I)} from m s most preferred to least preferred woman. Let p i (m) denote the ith woman in this sorted list for i = 1,..., N. Do the same for each woman w. By applying linear programming tools, they showed that the following family of stable matchings exists: Lemma 1. [Teo and Sethuraman] Let α i consist of man-woman pairs where each man m is matched to p i (m). Similarly, let β i consist of all man-woman pairs where each woman w is matched to p i (w). For i = 1,..., N, α i and β i are stable matchings; moreover, α i = β N i+1. The most remarkable of these stable matchings are the ones in the middle α (N+1)/2 when N is odd, and α N/2 and α (N+2)/2 when N is even called the median stable matching of I. 1 It matches every participant to his/her (lower or upper) median stable partner and, thus, is fair at the individual level in a very strong sense. The stable matchings α i and β N i+1 are called the ith generalized median stable matching of I, for i = 1,..., N. Since Teo et al. s work [15], two other sets of authors [10, 4] have proven the existence of these matchings using different tools. No one, however, has addressed the complexity of finding an instance s median stable matching. Simply using the definition can be inefficient because there are instances whose number of stable matchings is exponential in the input size. Our goal is to fill this gap. To find an instance s median stable matching, we take a combinatorial approach and use its rotation poset. Algorithmically, the rotation poset is a very 1 Throughout the paper, we shall refer to an instance s median stable matching in singular form even though there can be two such matchings.

useful structure because it encodes all the stable matchings of the instance and, yet, is polynomial in the input size. Our main results are as follows: First, we present a new characterization of the generalized median stable matchings that is solely based on rotation posets. It implies that to find an instance s median stable matching, enumerating all of its stable matchings can be avoided; instead, the task can be accomplished by counting certain subsets of its rotation poset. Additionally, the characterization also provides interesting insights into the generalized median stable matchings that are not evident from their definitions. We prove that finding α i and α N i+1 can be done efficiently when i = O(log n), but that it is NP-hard when i is a constant fraction of N. Hence, finding an instance s median stable matching is NP-hard. Finally, we consider what it means to approximate the median stable matching of an instance, and present results for this problem. The outline for the rest of the paper is as follows: in Section 2, we define rotation posets and describe their properties. We present the new characterization for the generalized median stable matchings in Section 3, and prove the easy cases and the hardness result for finding α i in Section 4. We consider the problem of approximating the median stable matching in Section 5. 2 Some background: distributive lattices and rotation posets Let I be a stable matching instance, and µ and µ be two of its stable matchings. An individual a prefers µ to µ if a prefers his/her partner in µ over his/her partner in µ ; otherwise, a prefers µ to µ or is indifferent between them if a has the same partner in both matchings. The stable matching µ dominates µ, denoted as µ µ, if every man prefers µ to µ or is indifferent between them. It turns out that the dominance relation induces a nice structure on M(I). Theorem 1. [12] (M(I), ) is a distributive lattice. The top and bottom elements of M(I) 2 are the man-optimal stable matching µ M and the woman-optimal stable matching µ W of I, respectively since µ M dominates every stable matching of I which, in turn, dominates µ W. Associated with the distributive lattice M(I) is the rotation poset of I. Rotations are the incremental changes that need to be made so that a stable matching µ can be transformed into another stable matching µ that it dominates. We define them formally next; we refer readers to [7] for a thorough discussion of the subject. When µ µ W, there is a man m so that p µ (m) p µw (m). For each such man m, define his successor woman, s µ (m), as the first woman on his preference 2 We sometimes use M(I) to refer to the set as well as the distributive lattice. The context will indicate which one we are referring to.

list that follows p µ (m), and prefers him over her current partner in µ. For example, p µw (m) is a possible candidate for s µ (m) but there may be other eligible women ahead of her in m s preference list. A rotation ρ exposed in µ is a cyclic sequence of man-woman pairs ρ = ((m 0, w 0 ), (m 1, w 1 ),..., (m r 1, w r 1 )) such that (m i, w i ) µ and s µ (m i ) = w i+1 for all i where the addition in the subscript is modulo r. To eliminate ρ from µ, each man m i in ρ is matched to w i+1 while the rest of the pairs not in ρ are kept the same. The result is another stable matching denoted as µ/ρ which µ dominates. Let I be an SM instance of size n (i.e., it has n men and n women), and let R(I) denote the set of all rotations that are exposed in the stable matchings of I. We note the following properties of rotations. First, a man-woman pair can be part of at most one rotation of I. Thus, R(I) n 2 /2 because every rotation consists of at least two pairs, and the rotations in R(I) together contain at most n 2 pairs. Second, if ρ and ρ are two rotations exposed in µ, ρ and ρ do not have any pairs in common. This implies that ρ remains exposed in µ/ρ. Third, whenever µ µ W, there will always be at least one rotation ρ exposed in µ. Furthermore, there is no stable matching µ such that µ µ µ/ρ. Thus, in the Hasse diagram of M(I), every edge between two stable matchings can be labeled by the rotation whose elimination from the dominant stable matching results in the dominated stable matching. A rotation ρ precedes rotation ρ, ρ ρ, if in order to obtain a stable matching in which ρ is exposed, ρ must be eliminated first. The pair (R(I), ) is called the rotation poset of I. Gusfield has shown that R(I) can be constructed in an efficient manner [6]; more precisely, a rotation digraph G(I) whose vertices correspond to the rotations of R(I) and whose transitive closure contains all the precedence relations of R(I) can be built in O(n 2 ) time. A subset S of R(I) is closed if whenever a rotation is in S, all rotations that precede it are also in S. There is a very nice correspondence between the stable matchings of I and the closed subsets of its rotation poset: Theorem 2. [8] There is a one-to-one correspondence between the elements of M(I) and the closed subsets of R(I). In particular, if µ M(I) corresponds to the closed subset S of R(I), then µ can be obtained by starting at µ M and eliminating all the rotations in S. For example, the empty subset of R(I) corresponds to µ M while R(I) itself corresponds to µ W. Given R(I) and one of its closed subsets S, finding the stable matching that corresponds to S takes O(n 2 ) time since constructing µ M takes O(n 2 ) time, and the total number of pairs in the rotations of S cannot exceed n 2. Conversely, finding the closed subset of R(I) that corresponds to a stable matching µ of I also takes O(n 2 ) time. This can be done by starting at µ M, and then eliminating rotations until the partner of every man m is p µ (m). The set containing all the eliminated rotations corresponds to µ. When P is a poset, let c(p ) denote the number of closed subsets of P. According to Theorem 2, c(r(i)) = M(I). Later, we will use the fact that c(p ) is also equal to the number of antichains of P. The correspondence is as

µ µ 1 ρ1 µ 2 ρ2 ρ3 3 µ 4 ρ ρ 3 2 µ 5 ρ 4 µ 6 ρ ρ ρ 1 ρ 2 3 4 Fig. 1. The Hasse diagrams for the lattice of stable matchings and rotation poset of the example in Section 2. follows: if A is an antichain, let S A be the closed subset that contains A and all the elements that precede a for each a A; if S is a closed subset, let A S be the antichain that contains all the bottom elements of S. Interestingly, the rotation posets of SM instances do not have any special structure in the following sense Blair showed that for every poset P, there is an SM instance I(P ) whose rotation poset is isomorphic to P [3]. In [8], Irving and Leather presented an algorithm that given P will construct I(P ) whose size and construction time is O( P 2 ). Moreover, defining the isomorphism between the elements of P and the rotations of I(P ) is straightforward. Before we end this section, we present an example to illustrate the distributive lattice and rotation poset of the following SM instance I: m 1 : w 1 w 2 w 3 w 4 w 5 w 6 m 2 : w 2 w 3 w 4 w 1 w 5 w 6 m 3 : w 3 w 1 w 5 w 2 w 4 w 6 m 4 : w 4 w 3 w 1 w 2 w 5 w 6 m 5 : w 5 w 1 w 6 w 2 w 3 w 4 m 6 : w 6 w 3 w 1 w 2 w 4 w 5 w 1 : m 4 m 5 m 3 m 1 m 2 m 4 w 2 : m 1 m 2 m 3 m 4 m 5 m 6 w 3 : m 6 m 4 m 2 m 3 m 1 m 5 w 4 : m 2 m 4 m 1 m 3 m 5 m 6 w 5 : m 3 m 5 m 1 m 2 m 4 m 6 w 6 : m 5 m 6 m 1 m 2 m 3 m 4 It has six stable matchings, where µ 1 is the man-optimal stable matching and µ 6 is the woman-optimal stable matching: µ 1 : {(m 1, w 1 ), (m 2, w 2 ), (m 3, w 3 ), (m 4, w 4 ), (m 5, w 5 ), (m 6, w 6 )} µ 2 : {(m 1, w 2 ), (m 2, w 3 ), (m 3, w 1 ), (m 4, w 4 ), (m 5, w 5 ), (m 6, w 6 )} µ 3 : {(m 1, w 2 ), (m 2, w 4 ), (m 3, w 1 ), (m 4, w 3 ), (m 5, w 5 ), (m 6, w 6 )} µ 4 : {(m 1, w 2 ), (m 2, w 3 ), (m 3, w 5 ), (m 4, w 4 ), (m 5, w 1 ), (m 6, w 6 )} µ 5 : {(m 1, w 2 ), (m 2, w 4 ), (m 3, w 5 ), (m 4, w 3 ), (m 5, w 1 ), (m 6, w 6 )} µ 6 : {(m 1, w 2 ), (m 2, w 4 ), (m 3, w 5 ), (m 4, w 1 ), (m 5, w 6 ), (m 6, w 3 )} It has four rotations: ρ 1 : ((m 1, w 1 ), (m 2, w 2 ), (m 3, w 3 )), ρ 2 : ((m 2, w 3 ), (m 4, w 4 )), ρ 3 : ((m 3, w 1 ), (m 5, w 5 )) ρ 4 : ((m 4, w 3 ), (m 5, w 1 ), (m 6, w 6 )). Figure 1 shows the Hasse diagrams of (M(I), ) and (R(I), ). The correspondence between the stable matchings of I and the closed subsets of R(I) are: µ 1 and, µ 2 and {ρ 1 }, µ 3 and {ρ 1, ρ 2 }, µ 4 and {ρ 1, ρ 3 }, µ 5 and {ρ 1, ρ 2, ρ 3 }, µ 6 and {ρ 1, ρ 2, ρ 3, ρ 4 }.

3 A new characterization In this section, we present a characterization of the generalized median stable matchings by describing the closed subsets of R(I) they correspond to. Not only does the characterization provide an alternate way to compute the matchings, it also leads to some interesting insights that are not evident from their definitons. Theorem 3. For each ρ R(I), let n ρ denote the number of closed subsets of R(I) that do not contain ρ. For i = 1,..., N, S(i) = {ρ : n ρ < i} is a closed subset of R(I), and α i is the stable matching obtained by starting at µ M and eliminating all the rotations in S(i). Proof. By the definition of closed subsets, the function n ρ is an increasing function; i.e., if ρ precedes ρ in R(I), n ρ < n ρ. Therefore, if ρ S(i), every rotation that precedes ρ also belongs to S(i). For i = 1 to N, let S(α i ) denote the closed subset of R(I) that corresponds to α i. The second part of the theorem states that S(α i ) = S(i). To prove it, we shall show that each man m satisfies the following condition: the set of rotations in S(α i ) that m appears in is exactly the set of rotations in S(i) that m appears in. This is sufficent because if S(α i ) S(i), there is a rotation ρ (S(α i ) S(i)) (S(α i ) S(i)), and every man that appears in ρ will not satisfy the condition. When m does not appear in any rotations in R(I) (i.e., m s partner in µ M is never replaced in any of the stable matchings of I), the above condition is clearly satisfied. So suppose m does appear in some rotations in R(I): ρ 1, ρ 2,..., ρ k where m appears with w j in ρ j. Additionally, suppose m prefers w 1 the most, followed by w 2, then w 3, etc. This means that ρ 1, ρ 2,..., ρ k form a chain in the rotation poset because ρ i must be eliminated before m can be matched to w i+1 for i = 1,..., k 1. Let x j denote the number of stable matchings that match m to w j. By applying the definition of α i, m s partner in α i is w j where j is the index that satisfies the inequality: x 1 + x 2 +... + x j 1 < i x 1 + x 2 +... + x j 1 + x j. (1) In order for m to be matched to w j, rotations ρ 1,..., ρ j 1 have to be eliminated but ρ j, ρ j +1,..., ρ k are not; i.e., of the k rotations that m appears in, the first j 1 are the only ones that lie in S(α i ). Next, notice that if a stable matching corresponds to a closed subset of R(I) that does not contain ρ j, m must be matched to one of the following women: w 1, w 2,..., w j. This implies that n ρj = x 1 + x 2 +... + x j. Applying inequality (1), n ρj < i if and only if j < j. Thus, ρ 1,..., ρ j 1 belong to S(i) but ρ j, ρ j +1,..., ρ k do not. We have now shown that, for every man m, the rotations that m appears in in S(α i ) are exactly the same ones in S(i). Thus, α i is the stable matching obtained by eliminating the rotations in S(i). In the example in Section 2, n ρ1 = 1, n ρ2 = n ρ3 = 3, and n ρ4 = 5. Since N = 6, the median stable matching will consist of two stable matchings the

two that correspond to S(3) = {ρ 1 } and S(4) = {ρ 1, ρ 2, ρ 3 }, which are µ 2 and µ 5 respectively. Next, we note some unexpected observations about the generalized median stable matchings. 1. Location of the median stable matching. Does an instance s median stable matching lie in the middle of its lattice of stable matchings or can it be somewhere else? Consider an instance I whose rotation poset consists of k rotations which are pairwise incomparable; i.e., R(I) is an antichain of size k. Every subset of R(I) is a closed subset so I has 2 k stable matchings. Moreover, for each rotation ρ, n ρ = 2 k 1. Thus, for 1 i 2 k 1, S(i) =, and for 2 k 1 + 1 i 2 k, S(i) = R(I). In other words, the lower median stable matching of I is the man-optimal stable matching, which is the top element of M(I), while the upper median stable matching of I is the woman-optimal stable matching, which is the bottom element of M(I) exactly the two stable matchings we least expected for the median stable matching! Indeed, it is not difficult to construct examples that show that the median stable matching can lie anywhere in the distributive lattice of stable matchings. 2. Number of distinct generalized median stable matchings. Teo and Sethuraman [15] had already observed that an instance s generalized median stable matchings need not be all distinct. In our example above, the instance has 2 k different stable matchings and, yet, its generalized median stable matchings consisted of only two types. In general, how many could there be? By Theorem 3, it is equal to the number of distinct S(i) sets. But this number is simply one more than the number of distinct n ρ values; the additional one accounts for the fact that none of the rotations belong to S(1). Thus, if I has size n, it can have at most n 2 /2 + 1 distinct types of generalized median stable matchings. 3. Instances with isomorphic rotation posets. Finally, Theorem 3 also implies that an instance s generalized median stable matchings are completely dependent on the structure of its rotation poset. To see this, consider two instances I and I whose rotation posets are isomorphic. Let f be an isomorphism from R(I) to R(I ). For each ρ R(I), n ρ = n f(ρ). Thus, if S(i) is the closed subset of R(I) that corresponds to the ith generalized median stable matching of I, then f(s(i)) = {f(ρ) : ρ S(i)} is the closed subset of R(I ) that corresponds to the ith generalized median stable matching of I. Interestingly, the median stable matching is the only fair stable matching we know of that has this property. 4 Finding the generalized median stable matchings Suppose we find the ith generalized median stable matching of I using its definition, which we call the direct method. It requires (i) enumerating all the stable matchings of I to construct the multiset of stable partners for each man, (ii) sorting each man s multiset of stable partners from his most preferred to his

least preferred woman, and (iii) matching each man to the ith woman in his sorted multiset of stable partners. Clearly, the bottleneck is in steps (i) and (ii); these steps take O(n 2 + nn) time by using the enumeration algorithm in [6] for step (i) and bucket sort for step (ii). Lemma 2. Let I be a stable matching instance of size n with N stable matchings. When N is polynomial in n, the direct method for finding α i runs in time polynomial in n, for i = 1,..., N. Thus, when N is no longer polynomial in n, can α i still be computed efficiently? We shall show next that there are indeed some easy cases but that, in general, the the answer is no unless P=NP. Theorem 3 will play a key role in the derivation of our results. Theorem 4. Let I be an SM instance of size n with N stable matchings. When i = O(log n), computing α i and α N i+1 can be done in polynomial time. Proof. Let ρ R(I). Let R(I) ρ denote the poset obtained from R(I) by deleting ρ and every rotation it precedes. Notice that n ρ = c(r(i) ρ ), the number of closed subsets of R(I) ρ. Moreover, (i) when R(I) ρ has at least i 1 elements, ρ S(i) because c(r(i) ρ ) i, and (ii) when R(I) ρ has at most i 2 elements, we can simply check which subsets of R(I) ρ are closed subsets to determine the exact value of c(r(i) ρ ). Using these observations, it is not difficult to show that determining S(i) exactly and then eliminating all its rotations from µ M to construct α i can be done in O(i2 i n 4 ) time. Thus, if i = O(log n), finding α i can be done in polynomial time. Since α N i+1 = β i, the same result also holds for finding α N i+1. 4.1 The hardness result Suppose P and Q are posets on disjoint sets. Their ordinal sum is the poset P + O Q on the set P Q such that x y in P + O Q if (i) x, y P and x y, or (ii) x, y Q and x y, or (iii) x P and y Q. The following is easy to establish: Lemma 3. Let P and Q be posets on disjoint sets and c( ) be a function that counts the number of closed subsets of a poset. Then c(p + O Q) = c(p )+c(q) 1. Here is a technical lemma we need for our hardness result. Lemma 4. Let M be a positive integer. There is a poset Q M so that Q M = O(log 2 M), the number of edges in its Hasse diagram is O(log 3 M), and c(q M ) = M. Proof. Consider the binary representation of M: b 0 2 0 + b 1 2 1 +... + b k 2 k. Let A i and C i denote an antichain of size i and a chain of size i, respectively. When b 0 = 0 (i.e., M is even), let Q M = A b1 1 + O A b2 2 + O... + O A bk k + O C nz 1 where nz is the number of non-zero bits in the binary representation of M. Thus,

Q M 1 + 2 +... + k + k = O(k 2 ), which is O(log 2 M); the number of edges in Q M s Hasse diagram is at most 1 2 + 2 3 +... + (k 1) k + k + k 1 = O(k 3 ), which is O(log 3 M). From Lemma 3, it is straightforward to check that c(a b1 1 + O A b2 2 + O... + O A bk k) = M (nz 1) and c(c nz 1 ) = nz, so c(q M ) = M (nz 1) + nz 1 = M. When b 0 = 1 (i.e., M is odd), let Q M = Q M 1 + O C 1. By applying the same analysis when b 0 = 0, Q M satisfies the three properties in the lemma as well. Theorem 5. Let I be an SM instance with N stable matchings. Suppose p and q are positive integers such that p < q. When i = pn/q, computing α i and α N i+1 is NP-hard. Proof. Since α N i+1 = β i, it is sufficient to prove the theorem for α i. Let us first consider the case when p = 1. Let ComputeMedian-q be an algorithm whose input is an SM instance I and whose output is I s M(I) /q -generalized median stable matching and its corresponding closed subset. Its runtime is f( I ), where I denotes the size of I. Let P be a poset. Recall that c(p ) denotes the number of closed subsets of P. The main idea behind our proof is that ComputeMedian-q can be used to answer queries of the form Is c(p ) m?. We describe how this can be done next. Query(P, m) 1. Construct the poset P 0 = qp + O x + O Q q(q 1)m+q 1 where qp denotes the ordinal sum of q copies of P, x is the singleton poset containing x and Q i is the poset described in Lemma 4. Note that c(p 0 ) = qc(p ) + 2 + q(q 1)m + q 1 (q 1) 2 = qc(p ) + q(q 1)m. 2. Construct an SM instance I(P 0 ) whose rotation poset is isomorphic to P 0. Find the rotation ρ x in R(I(P 0 )) that corresponds to x in P 0. 3. Use ComputeMedian-q to find I(P 0 ) s M(I(P 0 )) /q -generalized median stable matching and its corresponding closed subset S. 4. If ρ x S return yes ; else, return no. By the construction of P 0, n x = qc(p ) (q 1). Since n ρx = n x and S = S(c(P ) + (q 1)m), ρ x S implies that c(p ) < m + 1 or c(p ) m because c(p ) is an integer. Similarly, when ρ x S, c(p ) m + 1. The correctness of Query follows. It is straightforward to verify that since q is a constant, the sizes of P 0, I(P 0 ), and R(I(P 0 )) are all polynomial in P and log m. Thus, the runtime of Query is polynomial in P, log m and f( P + log m). Now, c(p ) 2 P. To determine c(p ), we simply do a binary search over the range [1, 2 P ] using Query as a subroutine. Clearly, O( P ) queries are sufficient where the value of m in each query is at most 2 P. If Compute-Median-q also runs in time polynomial in its input size, the algorithm we have just described computes c(p ) in time polynomial in P. In [13], it was shown, however, that computing the number of antichains of a poset is #P-complete. Since there is a one-to-one correspondence between the antichains of a poset and its closed subsets, computing c(p ) is also #P-complete. It follows that finding the M(I) /q -generalized median stable matching of an instance I is NP-hard.

Let us now prove that the theorem is also true when p > 1. Without loss of generality, assume that p and q are relatively prime. Suppose ComputeMedian-(p, q) is an algorithm like ComputeMedian-q except that it computes the p M(I) /q generalized median stable matching of I and its corresponding closed subset in g( I ) time. This time we shall use ComputeMedian-(p, q) to find the M(I) /q generalized median stable matching of I. ConstructMedian-q(I) 1. Construct R(I). Find positive integers k and r so that pk = qr + 1. (Since p and q are relatively prime, these integers exist. Also, 1 k q and 1 r p.) 2. Create the poset P 0 = R(I) + O x + O R(I) + O x + O R(I) + O... + O x + O R(I) so that there are k copies of R(I) and k 1 copies of x in P 0. For each ρ R(I), mark as ρ (j) the element that corresponds to ρ in the jth copy of R(I). Similarly, mark as x (j) the jth copy of x. Construct an SM instance I(P 0 ) whose rotation poset is isomorphic to P 0. 3. Use ComputeMedian-(p, q) to find the p M(I(P 0 )) /q -generalized median stable matching of I(P 0 ) and its corresponding closed subset S. 4. Let S consist of the rotations in P 0 that have corresponding rotations in S. (Find these rotations using the isomorphism from P 0 to the rotation poset of I(P 0 ).) Let S = {ρ : ρ (r+1) S }. 5. Find the man-optimal matching of I, µ M. Create the M(I) /q -generalized median stable matching of I by eliminating S from µ M and return the stable matching. It is straightforward to verify the following: c(p 0 ) = k c(r(i)), n x (j) = j c(r(i)) for 1 j k 1, and n ρ (j) = (j 1)c(R(I))+n ρ for each ρ R(I), 1 j k 1. By our choice of k and r, we know that pk/q = r +1/q. Thus, in step 3, p M(I(P 0 )) /q = pk c(r(i))/q = r c(r(i))+ c(r(i))/q. Consequently, in step 4, S = r j=1 {ρ(j) : ρ R(I)} {ρ (r+1) : n ρ < c(r(i))/q } {x (j) : j r}. Thus, S = {ρ : n ρ < c(r(i))/q }. Since S is the closed subset that corresponds to the M(I) /q -generalized stable matching of I, step 5 outputs the correct stable matching. Since p and q are constants, P 0 = O( R(I) ). Also, I(P 0 ) = O( R(I) 2 ) so I(P 0 ) = O( I 4 ). It is easy to verify that steps 1, 2, 4 and 5 can be accomplished in time polynomial in I. If ComputeMedian-(p, q) runs in time polynomial in its input size, step 4 will also run in time that is polynomial in I ; i.e., ConstructMedian-q is an efficient algorithm. But we just showed that finding the M(I) /q -generalized stable matching of I is an NP-hard problem. It follows that computing p M(I) /q -generalized stable matching of I when p > 1 is also NP-hard. 5 Approximating the Median Stable Matching While the median stable matching is arguably the most fair stable matching that has been proposed in the literature so far, our result in the previous section

shows that finding it is computationally hard unless P=NP. A natural direction to take is to find a stable matching that is close to the median stable matching. When N is an even number, the median stable matching of I consists of α N/2 and α (N+2)/2. Notice though that I may have stable matchings the lie between α N/2 and α (N+2)/2 in M(I). (Recall our example in Section 3.) These stable matchings have the property that at least one (but not all) men are matched to their upper median stable partners and at least one (but not all) women are matched to their lower median stable partners. If we say that α N/2 and α (N+2)/2 are fair because every individual is matched to his/her median stable partner, surely stable matchings that lie between these two matchings must also be fair. By the same reasoning, if we say that α i and α i are good approximations of the median stable matching where i < N/2 < i, every stable matching that lies between the two matchings must also be a good approximation of the median stable matching. This leads us to the following definition: Definition 1. Let I be an SM instance with N stable matchings. Let µ be one of its stable matchings and S µ be its corresponding closed subset in R(I). We say that µ is an ɛ-approximation of the median stable matching of I if µ lies between α N/2 ɛ and α N/2 +ɛ in the lattice of stable matchings of I. That is, S( N/2 ɛ) S µ S( N/2 + ɛ). Since an SM instance of size n can have at most 2 n2 /2 stable matchings, Theorem 4 implies that finding an (N/2 O(log log N))-approximation to the median stable matching of an SM instance can be found efficiently. In the next theorem, we present a slight improvement over this result. Theorem 6. Let I be an SM instance of size n with N stable matchings. Finding a stable matching µ of I such that µ lies between α log N/2 and α N log N/2 can be done in O(n 2 ) time. That is, finding an (N/2 O(log N))-approximation to the median stable matching of an SM instance can be found efficiently. Proof. Suppose R(I) has m rotations. Let ρ 1, ρ 2,..., ρ m be a topological ordering of its rotations. Let J r = {ρ 1, ρ 2,..., ρ r 1 } for r = 1,..., m + 1. Claim: For r = 1,..., m+1, J r is a closed subset, and S(r) J r S(N m+r). Proof of Claim: Since the rotations are ordered topologically, when ρ J r, every rotation that precedes ρ also belongs to J r. That is, J r is a closed subset. Suppose ρ does not belong to J r. Then n ρ r because J 1, J 2,..., J r are all closed subsets that do not contain ρ. Hence, ρ S(r). In other words, S(r) J r. On the other hand, when ρ J r, there are at least m r + 1 closed subsets that contain ρ: J i+1 for i = r,..., m. Thus, N n ρ m r +1 or N m+r 1 n ρ, so ρ S(N m + r). When r = m/2, S( m/2 ) J m/2 S(N m/2 ). But because R(I) has m rotations, m+1 N 2 m. Hence, m log N so S( log N/2 ) J m/2 S(N log N/2 ). Thus, the stable matching of I that corresponds to the closed subset J m/2 lies between α log N/2 and α N log N/2.

Now, constructing R(I) and its accompanying digraph G(I) takes O(n 2 ) time. Topologically sorting its rotations also take O(n 2 ) time. Finding µ M, and then eliminating all rotations of J m/2 from µ M also takes O(n 2 ) time. Thus, finding the stable matching in the theorem takes O(n 2 ) time. In contrast, we have the next result whose proof is like that of Theorem 5. Theorem 7. Let ɛ be a constant. Let I be an SM instance with N stable matchings. Finding a stable matching µ of I such that µ lies between α N/2 ɛ and α N/2 +ɛ is NP-hard. That is, finding an O(1)-approximation to the median stable matching of an SM instance is NP-hard. Interestingly, this leaves us with the following problem: Open Problem: Is there an efficient algorithm for finding an ɛ-approximation to the median stable matching of an SM instance where ɛ is ω(1) but at most N/2 Ω(log N)? References 1. A. Abdulkadiroglu, P. Pathak, and A. Roth. The New York City high school match. American Economic Review, Papers and Proceedings, 95:364 367, 2005. 2. A. Abdulkadiroglu, P. Pathak, A. Roth, and T. Sönmez. The Boston public school match. American Economic Review, Papers and Proceedings, 95:368 371, 2005. 3. C. Blair. Every finite distributive lattice is a set of stable matchings. Journal of Combinatorial Theory A, 37:353 356, 1984. 4. T. Fleiner. A fixed-point approach to stable matchings and some applications. Mathematics of Operations Research, 28:103 126, 2003. 5. D. Gale and L. Shapley. College admissions and the stability of marriage. American Mathematical Monthly, 69:9 15, 1962. 6. D. Gusfield. Three fast algorithms for four problems in stable marriage. SIAM Journal on Computing, 16:111 128, 1987. 7. D. Gusfield and R. Irving. The Stable Marriage Problem: Structure and Algorithms. The MIT Press, 1989. 8. R. Irving and P. Leather. The complexity of counting stable marriages. SIAM Journal on Computing, 15:655 667, 1986. 9. R. Irving, P. Leather, and D. Gusfield. An efficient algorithm for the optimal stable marriage. Journal of the ACM, 34:532 544, 1987. 10. B. Klaus and F. Klijn. Median stable matchings for college admissions. International Journal of Game Theory, 34:1 11, 2006. 11. B. Klaus and F. Klijn. Procedurally fair and stable matching. Economic Theory, 27:431 447, 2006. 12. D. Knuth. Mariages Stables. Les Presses de l Université de Montréal, 1976. 13. J. Provan and M. Ball. The complexity of counting cuts and of computing the probability that a graph is connected. SIAM Journal on Computing, 12:777 788, 1983. 14. A. Roth and E. Peranson. The redesign of the matching market of American physicians: Some engineering aspects of economic design. American Economic Review, 89:748 780, 1999. 15. C.-P. Teo and J. Sethuraman. The geometry of fractional stable matchings and its applications. Mathematics of Operations Research, 23:874 891, 1998.