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

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

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

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

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

The stable marriage problem with restricted pairs

Upper and Lower Bounds on the Number of Faults. a System Can Withstand Without Repairs. Cambridge, MA 02139

1 Definitions and Things You Know

Glasgow eprints Service

arxiv: v1 [cs.gt] 2 Jan 2012

The Inclusion Exclusion Principle and Its More General Version

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

Matching with Couples: Semi-Stability and Algorithm

Weights in stable marriage problems increase manipulation opportunities

Modelling and Solving the Stable Marriage Problem Using Constraint Programming

Cheating to Get Better Roommates in a Random Stable Matching

Ma/CS 6b Class 3: Stable Matchings

PROOF OF TWO MATRIX THEOREMS VIA TRIANGULAR FACTORIZATIONS ROY MATHIAS

Weights in Stable Marriage Problems Increase Manipulation Opportunities

Ma/CS 6b Class 3: Stable Matchings

Bipartite Matchings and Stable Marriage

Random paths to stability in the roommate problem

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

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

Equilibria under Deferred Acceptance: Dropping Strategies, Filled Positions, and Welfare

Stable Assignment with Couples: Parameterized Complexity and Local Search

Two-sided Matching Theory

On-line Bin-Stretching. Yossi Azar y Oded Regev z. Abstract. We are given a sequence of items that can be packed into m unit size bins.

On the Algorithmic Complexity of the Mastermind Game with Black-Peg Results

CPSC 320 Sample Solution, Reductions and Resident Matching: A Residentectomy

The English system in use before 1971 (when decimal currency was introduced) was an example of a \natural" coin system for which the greedy algorithm

Matching with Couples: Semi-Stability and Algorithm

Algorithmics of Two-Sided Matching Problems

A Many-to-Many Rural Hospital Theorem

IBM Almaden Research Center, 650 Harry Road, School of Mathematical Sciences, Tel Aviv University, TelAviv, Israel

Math 301: Matchings in Graphs

The Generalized Stable Allocation Problem

Math 42, Discrete Mathematics

Glasgow eprints Service

2. Notation and Relative Complexity Notions

An Efficient Algorithm for Batch Stability Testing

Volume 31, Issue 1. A solution concept for housing market problems with externalities. Alfredo Salgado-Torres Universidad Carlos III de Madrid

is a model, supported model or stable model, respectively, of P. The check can be implemented to run in linear time in the size of the program. Since

Sisterhood in the Gale-Shapley Matching Algorithm

arxiv: v2 [cs.gt] 25 Jul 2014

Report No On the Complexity of Testing Membership. in the Core of Min-cost Spanning Tree Games

Random Paths To Popularity In Two-Sided Matching

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

A version of for which ZFC can not predict a single bit Robert M. Solovay May 16, Introduction In [2], Chaitin introd

Glasgow eprints Service

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

A Many-to-Many Rural Hospital Theorem

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

2 S. FELSNER, W. T. TROTTER S. S. Kislitsyn [9] made the following conjecture, which remains of the most intriguing problems in the combinatorial theo

ON THE COMPLEXITY OF SOLVING THE GENERALIZED SET PACKING PROBLEM APPROXIMATELY. Nimrod Megiddoy

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

Chapter 1. Comparison-Sorting and Selecting in. Totally Monotone Matrices. totally monotone matrices can be found in [4], [5], [9],

for average case complexity 1 randomized reductions, an attempt to derive these notions from (more or less) rst

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

Marriage Matching: A Conjecture of Donald Knuth

Random Paths To Popularity In Two-Sided Matching

1. REPRESENTATIVE PROBLEMS

Restricted b-matchings in degree-bounded graphs

Counting and Constructing Minimal Spanning Trees. Perrin Wright. Department of Mathematics. Florida State University. Tallahassee, FL

Two-Sided Matching with Partial Information

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

SEQUENTIAL EQUILIBRIA IN BAYESIAN GAMES WITH COMMUNICATION. Dino Gerardi and Roger B. Myerson. December 2005

Anna Bogomolnaia and Matthew O. Jackson. April, This Revision: January Forthcoming: Games and Economic Behavior.

Fall 1999 Formal Language Theory Dr. R. Boyer. 1. There are other methods of nding a regular expression equivalent to a nite automaton in

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

Chapter 30 Minimality and Stability of Interconnected Systems 30.1 Introduction: Relating I/O and State-Space Properties We have already seen in Chapt

Manipulation via Capacities in Two-Sided Matching Markets

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

Finding Succinct. Ordered Minimal Perfect. Hash Functions. Steven S. Seiden 3 Daniel S. Hirschberg 3. September 22, Abstract

Matching with Couples: Stability and Algorithm

MARKOV CHAINS: STATIONARY DISTRIBUTIONS AND FUNCTIONS ON STATE SPACES. Contents

Incentives and Manipulation in Large Market Matching with Substitutes

Lower Bounds for Shellsort. April 20, Abstract. We show lower bounds on the worst-case complexity of Shellsort.

1. REPRESENTATIVE PROBLEMS

Approximate Map Labeling. is in (n log n) Frank Wagner* B 93{18. December Abstract

DD2446 Complexity Theory: Problem Set 4

Lecture 15 - NP Completeness 1

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

A Stable Marriage Requires Communication

Popular Matchings with Lower Quotas

Polynomial-Solvability of N P-class Problems

(Group) Strategy-proofness and stability in many-to-many matching markets

Preface These notes were prepared on the occasion of giving a guest lecture in David Harel's class on Advanced Topics in Computability. David's reques

Complexity analysis of job-shop scheduling with deteriorating jobs

The Complexity of Maximum. Matroid-Greedoid Intersection and. Weighted Greedoid Maximization

Egalitarian solutions in the stable roommates problem

Czechoslovak Mathematical Journal

M 2 M 3. Robot M (O)

Manipulability in matching markets: conflict and coincidence of interests

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

An Alternative To The Iteration Operator Of. Propositional Dynamic Logic. Marcos Alexandre Castilho 1. IRIT - Universite Paul Sabatier and

A PARALLEL ALGORITHM TO SOLVE THE STABLE MARRIAGE PROBLEM. S. S. TSENG and R. C. T. LEE

Universal Juggling Cycles

Transcription:

Three-dimensional Stable Matching Problems Cheng Ng and Daniel S Hirschberg Department of Information and Computer Science University of California, Irvine Irvine, CA 92717 Abstract The stable marriage problem is a matching problem that pairs members of two sets The obective is to achieve a matching that satises all participants based on their preferences The stable roommate problem is a variant involving only one set, which is partitioned into pairs with a similar obective There exist asymptotically optimal algorithms that solve both problems In this paper, we investigate the complexity of three-dimensional extensions of these problems This is one of twelve research directions suggested by Knuth in his book on the stable marriage problem We show that these problems are N P-complete, and hence it is unlikely that there exist ecient algorithms for their solutions The approach developed in this paper provides an alternate N P-completeness proof for the hospitals/residents problem with couples an important practical problem shown earlier to be N P-complete by E Ronn

Key Words stable marriage problem, stable roommate problem, N P-complete problems, three-dimensional matching AMS(MOS) Subect Classications 68Q25, 90B99 Abbreviated Title Three-dimensional Stable Matching Problems 1

Three-dimensional Stable Matching Problems Introduction Consider the problem of assigning 3n students to n disoint work groups of three students each The students must guard against any three individuals abandoning their assignments and instead conspiring to form a new group that they consider more desirable 1 The following procedure is followed: each student ranks all (3n 0 1)(3n 0 2) 2 possible pairs of fellow students according to her preference for working with the pairs A destabilizing triple for an assignment M consists of three students such that each ranks the remaining two (as a pair) more desirable than the pair that she is assigned to in M The students' task, the 3-person stable assignment problem (or 3PSA for short), is to nd a stable assignment, one that is free of all destabilizing triples, if such an assignment exists Readers will recognize that 3PSA is a three-dimensional generalization of the stable roommate problem, which partitions 2n persons into n pairs of stable roommates A better known variation is the stable marriage problem, which divides the participants into two disoint sets, male and female Each pair in a stable marriage must include a male and a female The stable marriage problem has a similar generalization in three dimensions, which we name the 3-gender stable marriage problem (or 3GSM for short) and dene in the next section The stable roommate and stable marriage problems have been studied extensively [3] [4] [5] [9] There exist ecient algorithms for both problems that run in 2

3 O(n 2 ) time [1] [6] [10] Ng and Hirschberg have obtained lower bound results proving that these algorithms are asymptotically optimal [12] Since no signicant improvement is possible on the original problems, it is then natural to consider their three-dimensional generalizations, 3GSM and 3PSA This is one of twelve research directions suggested by Knuth in his treatise on the stable marriage problem [9] In this paper, we show that both 3GSM and 3PSA are N P-complete Hence, it is unlikely that fast algorithms exist for these problems The N P-completeness of 3GSM has been independently established by Subramanian [15] In [11], we extend the approach developed in this paper to the study of two problems dealing with the task of matching married couples to obs Denitions An instance of 3GSM involves three nite sets A, B, and D These sets have equal cardinality k, which is the size of the problem instance A marriage in 3GSM is a complete matching of the three sets, ie, a subset of A 2 B 2 D with cardinality k such that each element of A, B, and D appears exactly once For each element a of A, we dene its preference, denoted by a, to be a linear order on the elements of B 2 D The intuitive meaning of ( 1 ; 1 ) a ( 2 ; 2 ) is that a prefers ( 1 ; 1 ) to ( 2 ; 2 ) in a marriage For b 2 B and d 2 D, there are also analogous denitions b and d on the Cartesian products A 2 D and A 2 B respectively When the subscript in the relation is evident from context, we omit it from the notation A marriage is unstable if there exists a triple t 2 A2B 2D such that t is not in the marriage and each component of t prefers the pair that it is matched with in t to the pair that it is matched with in the actual marriage A stable marriage is a marriage where no such destabilizing triple can be found Formally, a stable marriage is a

marriage M, such that, 8(a; b; d) 62 M and for the triples (a; 1 ; 1 ), ( 2 ; b; 2 ), ( 3 ; 3 ; d) 2 M; either ( 1 ; 1 ) a (b; d), ( 2 ; 2 ) b (a; d), or ( 3 ; 3 ) d (a; b) 4 A 3PSA instance of size n involves a set S of cardinality n = 3k, where k is an integer The preference of s 2 S, denoted s, is a linear order on the set of unordered pairs 8 fs 1 ; s 2 g s 1 6= s 2 and s 1 ; s 9 2 2 S0fsg A stable assignment M in 3PSA is a partition of S into k disoint three-element subsets, such that, 8fs 1 ; s 2 ; s 3 g 62 M and for the subsets fs 1 ; 11 ; 12 g, fs 2 ; 21 ; 22 g, fs 3 ; 31 ; 32 g 2 M; either f 11 ; 12 g s1 fs 2 ; s 3 g, f 21 ; 22 g s2 fs 1 ; s 3 g, or f 31 ; 32 g s3 fs 1 ; s 2 g When referring to preferences, we adopt the convention that items are listed in decreasing order of favor For example, the listing p 1 p 2 p k, where each p i denotes a pair, represents the preference p 1 p 2 1 1 1 p k We also use the simpler notation xyz to denote the ordered triple (x; y; z) or unordered fx; y; zg Similarly, xy denotes (x; y) or fx; yg Although 3GSM is similar to its 2-gender counterpart in that an instance can have more than one stable marriage, 1 it diers from the 2-gender counterpart in that there exist instances that have no stable marriage Figure 1 shows a 3GSM instance with A = f 1 ; 2 g, B = f 1 ; 2 g and D = f 1 ; 2 g A complete list of all possible marriages, each shown with a corresponding destabilizing triple, conrms that no stable marriage exists for this instance of 3GSM N P-Completeness of 3GSM In the previous section, we noted that some instances of 3GSM do not have stable marriages In this section, we will show that deciding whether a given instance of 3GSM has a stable marriage is an N P-complete problem This is accomplished 1 In fact, the number of stable marriages in many instances is exponential in the instances' size Irving and Leather [7] give a proof of this for the 2-gender case Extending the proof to cover the 3-gender case is straightforward

5 1 1 2 1 1 2 2 2 1 2 2 2 1 1 2 1 1 2 1 2 1 1 2 1 1 2 2 2 2 1 1 1 2 2 1 2 1 1 2 1 1 2 1 2 2 2 1 1 2 2 1 2 2 1 Possible Marriage Destabilizing Triple f 1 1 1 ; 2 2 2 g 1 1 2 f 1 1 2 ; 2 2 1 g 2 1 1 f 1 2 1 ; 2 1 2 g 1 1 2 f 1 2 2 ; 2 1 1 g 2 2 2 Figure 1 An instance of 3GSM that has no stable marriage by giving a polynomial transformation from the 3-dimensional matching problem (or 3DM for short) to 3GSM A proof that 3DM is N P-complete is rst given in Karp's [8] landmark paper An instance of 3DM involves three nite sets of equal cardinality which we denote by A 0, B 0, and D 0, relating them to A, B, and D of 3GSM Given a set of triples T 0 A 0 2 B 0 2 D 0, the 3DM problem is to decide if there exists an M 0 T 0 such that M 0 is a complete matching, ie, each element of A 0, B 0, and D 0 appears exactly once in M 0 Given a 3DM instance I 0, we construct a corresponding 3GSM instance I Although our construction can be adapted to work for any 3DM instance in general; we shall assume, in order to simplify the presentation, that no element of A 0, B 0, or D 0 appears in more than three triples of T 0 This assumption is made without loss of generality In their reference work on N P-completeness, Garey and Johnson [2, p 221] mention that 3DM remains N P-complete with this restriction

6 We construct I by rst building a \frame" consisting of the elements 1 ; 2 2 A, 1 ; 2 2 B, and 1 ; 2 2 D The preferences of these elements do not depend on the structure of I 0 and are displayed in Figure 2 In Figure 2 and subsequent gures, we are only interested in the roles played by a few items in each preference list Therefore, we use the notation 5 Rem to denote any xed but arbitrary permutation of the remaining items 1 1 1 2 1 1 2 5 Rem 2 2 2 5 Rem 1 1 2 5 Rem 1 1 2 2 2 1 1 5 Rem 1 1 2 5 Rem 1 1 2 1 1 2 2 5 Rem Figure 2 Preferences of the elements 1 ; 2 ; 1 ; 2 ; 1 ; 2 : We shall prove later in Lemma 2 that the triples 1 1 1 and 2 2 2 must be included in any stable marriage Note that 1 1 1 is the weakest link in such a marriage because it represents the least preferred match for both 1 and 1 Consequently, if any element a 2 A is matched in marriage with a pair that it prefers less than 1 1, then a 1 1 becomes a destabilizing triple The above observation gives us a strategy that uses the pair 1 1 as a \boundary" in the preferences of A's remaining elements A necessary condition for a stable marriage in I is that all remaining elements of A must match with pairs located left of the boundary, ie, 1 1 Using information from T 0 to construct the set of items to be positioned left of the boundary, we ensure that this condition for stable marriage can be met only if T 0 contains a complete matching The remaining diculty is to ensure that matching all elements of A left of the boundary

7 is sucient to yield a stable marriage Before giving details of the construction that provides the solution, we rst prove the lemmas that establish the frame's properties Lemma 1: If a stable marriage M exists for I constructed by extending the frame in Figure 2, then 1 2 1 62 M Proof: By contradiction Suppose 1 2 1 2 M Since 1 2 1 2 M, 2 's match cannot be 1 1 or 2 2 From 2 's preference, 1 1 is the only pair 2 2 2 Therefore, 2 2 2 2 's match in M Moreover, 2 2 and 2 2 are the rst preference choices of 2 and 2 respectively Hence, 2 2 2 is a destabilizing triple for M, a contradiction Lemma 2: If a stable marriage M exists for I constructed by extending the frame in Figure 2, then 1 1 1 2 M and 2 2 2 2 M Proof: We rst prove 1 1 1 2 M Suppose 1 is not matched with 1 1 in M, we can then nd a destabilizing triple for M There are two cases: Case 1: 1 is matched with 1 2 1 1 2 2 M implies that 2 2 2, 1 1 1, and 1 2 1 62 M By an argument similar to that of Lemma 1, 1 2 1 is a destabilizing triple Case 2: 1 is not matched with 1 2 nor 1 1 1 2 1 62 M by Lemma 1 Also, 1 1 1 62 M, which implies that 1 1 2 is a destabilizing triple in this case Hence, we conclude that 1 1 1 2 M, which implies that 1 1 2 62 M It is now easy to verify that if 2 2 2 62 M, then it is a destabilizing triple

8 If the sets of I 0 (A 0, B 0, and D 0 ) each has k elements, then the sets of I (A, B, and D) each has 3k + 2 elements The 's, 's, or 's, which are in the frame, account for two elements The remaining 3k elements are dened as follows Suppose A 0 = fa 1 ; a 2 ; ; a k g, B 0 = fb 1 ; b 2 ; ; b k g, and D 0 = fd 1 ; d 2 ; ; d k g According to an earlier assumption, each element a i 2 A 0 appears in no more than three triples of T 0 We clone three copies of a i and replace a i with the clones a i [1], a i [2], and a i [3] in A These clones' preferences are set up to make it possible for exactly one of their matches in a stable marriage to correspond to a triple in T 0 To prevent the two remaining clones from interfering with the above setup, we add elements w ai,y ai to B and x ai,z ai to D In a stable marriage, the pairs w ai x ai and y ai z ai are required to match with two of a i 's clones, putting them out of action We complete the sets B and D by adding to them the elements of B 0 and D 0 respectively To summarize, A = f 1 ; S 8 2 g [ a ai i2a [1]; a 0 i [2]; a i [3] 9, B = B 0 [ f 1 ; 2 g [ S 0fw a i2a a i ; y ai g, and D = D 0 [ f 1 ; 2 g [ S 0fx a i2a a i ; z ai g Given that a i b 1 d l1, a i b 2 d l2, and a i b 3 d l3 are the triples containing a i in T 0, the preferences in Figure 3 accomplish the obectives outlined above When there exist fewer than three triples containing a i, we equate two or more of the 's and l's The following lemma establishes the roles of w ai, x ai, y ai and z ai Lemma 3: If a stable marriage M exists for I constructed with the preferences shown in Figure 3, then for every a i 2 A 0, there exist 1 ; 2 2 f1; 2; 3g, 1 6= 2 such that a) a i [ 1 ] w ai x ai 2 M, and

9 1 2 a i [1] w ai x ai y ai z ai b 1 d l1 1 1 5 Rem a i [2] w ai x ai y ai z ai b 2 d l2 1 1 5 Rem a i [3] w ai x ai y ai z ai b 3 d l3 1 1 5 Rem 1 2 w ai a i [1] x ai a i [2] x ai a i [3] x ai 5 Rem y ai a i [1] z ai a i [2] z ai a i [3] z ai 5 Rem b i 5 Rem 1 2 x ai a i [3] w ai a i [2] w ai a i [1] w ai 5 Rem z ai a i [3] y ai a i [2] y ai a i [1] y ai 5 Rem d i 5 Rem Figure 3 Preferences in the 3GSM instance I The column of 1 1 's represents the boundary Preferences of 's, 's, and 's are those shown in Figure 2 b) a i [ 2 ] y ai z ai 2 M Proof: Consider the triple a i [1] w ai x ai, which represents the third preference choice of x ai and the rst preference choices of a i [1] and w ai It becomes a destabilizing triple unless x ai is matched with one of its rst three preference choices, proving part (a) of the lemma

10 Similarly, z ai must be matched with one of its rst three preference choices Otherwise, y ai z ai forms a destabilizing triple with a i [1] or a i [2], depending on which a i clone is matched in part (a) We are now ready to prove the N P-completeness of 3GSM by showing that I has a stable marriage if and only if T 0 has a complete matching of I 0 Theorem 1: If T 0 contains a complete matching M 0 of the 3DM instance I 0, then the constructed 3GSM instance I has a stable marriage M Proof: We show that it is possible to construct a stable marriage M Begin by adding 1 1 1 and 2 2 2 to M For each element a i 2 A 0, the only triples in T 0 containing a i are a i b 1 d l1, a i b 2 d l2, and a i b 3 d l3 using the notations found in Figure 3 One of these triples is in M 0 8 a i [1] b 1 d l1 ; a i [2] w ai x ai ; and a i [3] y ai z ai if a i b 1 d l1 2 M >< 0 ; Add to M a i [1] w ai x ai ; a i [2] b 2 d l2 ; and a i [3] y ai z ai if a i b 2 d l2 2 M 0 ; >: a i [1] w ai x ai ; a i [2] y ai z ai ; and a i [3] b 3 d l3 if a i b 3 d l3 2 M 0 : Since M 0 is a complete matching, the above construction guarantees that those elements of B and D that originate from B 0 and D 0 are used exactly once in M It is easy to verify that all other elements of A, B, and D are also used exactly once Hence, M is a marriage To show that M is stable, it is sucient to show that no element of A is a component of a destabilizing triple 1 and 2 satisfy this condition immediately because they are matched with their rst preference choices Referring to Figure 3, each of the remaining elements of A is matched with a pair located left of the boundary Hence, the only pairs that can form destabilizing

11 triples are w ai x ai and y ai z ai However, w ai 's (y ai 's) match is one of its rst three preference choices These three choices are in exact reverse order of x ai 's (z ai 's) This eliminates w ai and y ai from participating in any destabilizing triple Theorem 2: If the 3GSM instance I has a stable marriage, then T 0 contains a complete matching of the 3DM instance I 0 Proof: Suppose I has a stable marriage M Lemma 2 requires M to include 1 1 1 and 2 2 2 Lemma 3 requires that, for each a i 2 A 0, two of the a i clones match with w ai x ai and y ai z ai Let M 0 represent the matching that results when M is restricted to the remaining elements that are without predetermined matches For each a i 2 A 0, only one a i clone remains to be matched in M 0 Therefore, we shall drop the distinction between an a i clone and the a i it represents, without the risk of introducing any ambiguity in M 0 The elements that participate in M 0 can then be characterized as exactly those elements of A 0, B 0, and D 0 Since M 0 is a subset of a marriage, it represents a complete matching Due to the absence of destabilizing triples, every a i in M 0 must match with a preference choice located left of the boundary The construction of I, as illustrated in Figure 3, restricts this choice to the third item in the preference list since the rst two items are already matched Moreover, the triple formed by a i and this item is contained in T 0 Hence, every triple in M 0 is also a triple in T 0, and M 0 is the desired complete matching contained in T 0 Theorem 3: 3GSM is N P-complete

12 Proof: It is easy to verify that the construction of I from I 0 can be accomplished within a polynomial time bound Therefore, Theorems 1 and 2 establish that 3GSM is N P-hard It is also possible to check the stability of a given marriage in polynomial time, establishing 3GSM's membership in N P N P-Completeness of 3PSA The N P-completeness of 3PSA follows from that of 3GSM because the former is a generalization of the latter Given a 3GSM instance I where A = fa 1 ; a 2 ; ; a k g, B = fb 1 ; b 2 ; ; b k g, and D = fd 1 ; d 2 ; ; d k g; we can extend it into a 3PSA instance ^I by dening S = A [ B [ D Each element of S retains its entire preference list from I as the rst k 2 preference items in ^I We refer to these k 2 items as inherited items All remaining items are inconsequential in ^I and are arranged in xed but arbitrary permutations following the inherited items The result is illustrated in Figure 4 8 a 1 a 2 a k Copy preferences from I S >< b 1 b 2 b k Copy preferences from I 5 Rem >: d 1 d 2 d k Copy preferences from I Figure 4 Preferences in the 3PSA instance ^I

13 Theorem 4: 3PSA is N P-complete Proof: Any stable marriage M in I is an assignment in ^I Any destabilizing triple for M in ^I is simultaneously a destabilizing triple for M in I Therefore, the stability of M in I implies its stability in ^I We claim that any stable assignment ^M in ^I involves only inherited items and is therefore a marriage in I This is equivalent to claiming that ^M is a complete matching of A 2 B 2 D Otherwise, there exist elements a i 2 A; b 2 B; d l 2 D not matched to inherited items, which implies that a i b d l is a destabilizing triple Since ^M involves only inherited items, any destabilizing triple for ^M in I is simultaneously a destabilizing triple for ^M in ^I Therefore, the stability of ^M in ^I implies its stability in I Related Results In addition to the interest generated amongst computer scientists, the stable marriage problem has also received substantial attention from game theorists It is used to model economic problems that require matching representatives from dierent market forces, such as matching labor to the ob market Since 1951, the National Resident Matching Program (NRMP) has based its success on an algorithm that solves the stable marriage problem [14] NRMP is the centralized national program in the United States that matches medical school graduates to hospital resident positions In recent years, NRMP administrators have recognized that an increasing proportion of medical school graduates comes from the set of married couples who are both medical students graduating in the same year In 1983, NRMP instituted a \couples program" which allows a participating couple to increase the probability of

14 their being matched with two resident positions in close proximity To participate in this special program, a couple submits a combined preference list that ranks pairs of resident positions In 1984, Roth [14, p 1008] discovered a dilemma with NRMP's couples program He showed that there are instances where no stable matching can exist Recently, Ronn [13] proved that the problem of deciding whether a stable matching exists in an instance of the couples program is N P-complete As an extension of our work in this paper, we have obtained an alternate N P- completeness proof for NRMP's couples program [11] We model the couples program as a ob matching problem for dual-career couples where only a single ob market is involved Each couple has a preference list that ranks pairs of available positions However, each employer ranks applicants individually without regard to marriage relations A matching is stable if no couple can nd an alternate pair of employers such that all four participants benet from the new arrangement The N P-completeness proof for the problem in the above model is an adaptation of those developed in this paper We refer interested readers to [11] for further details In addition, we also examine the simpler problem that results when the employers are partitioned into two disoint ob markets, one for the male and female participants respectively We show that the problem remains N P-complete even with this simplication Conclusions and Open Problems We have shown that three-dimensional generalizations of the stable marriage and stable roommate problems are N P-complete Our result also applies to the problem of nding stable ob assignments for dual-career couples, resulting in an

15 alternate N P-completeness proof for NRMP's couples program It may be interesting, as a topic for further research, to investigate the possibility of applying our result to other matching problems and their variants The proofs in this paper exploit the ability to assign a somewhat \inconsistent" preference list For example, in Figure 2, 2 does not rank 1 consistently ahead of 2 but instead depends on who the 's are matched with In the example, 1 1 2 1 2 but 2 2 2 2 1 An interesting question to consider is whether the matching problems remain N P-complete if all preference lists must obey a \consistency property", namely, xy a xz holds for either all x's or no x The are other ways to generalize the stable marriage problem in three dimensions besides those considered in this paper One approach allows A to rank only elements of B, B ranks only elements of D, and D ranks only elements of A A triple abd 62 M is destabilizing if ab 1 d 1 ; a 2 bd 2 ; a 3 b 3 d 2 M and b a b 1 ; d b d 2 ; a d a 3 One of the referees, who called our attention to this problem, attributes its origin to Knuth and dubbed it \circular" 3GSM The complexity of this problem is currently an open problem Acknowledgment We thank the referees for many helpful suggestions that have improved the presentation of this paper and for pointing out the two open problems in the previous section

16 References [1] Gale, D and L Shapley College admissions and the stability of marriage Amer Math Monthly 69 (1962), 9{15 [2] Garey, M R and D S Johnson Computers and intractability; a guide to the theory of NP-Completeness, W H Freeman & Co, New York, 1979 [3] Gusfield, D Three fast algorithms for four problems in stable marriage SIAM J Comput 16 (1987), 111{128 [4] Gusfield, D The structure of the stable roommate problem: ecient representation and enumeration of all stable assignments SIAM J Comput 17 (1988), 742{769 [5] D Gusfield and R W Irving, The Stable Marriage Problem: Structure and Algorithms, MIT Press, Cambridge, Massachusetts, 1989 [6] Irving, R W An ecient algorithm for the \stable roommates" problem J Algorithms 6 (1985), 577{595 [7] Irving, R W and P Leather The complexity of counting stable marriages SIAM J Comput 15 (1986), 655{667 [8] Karp, R M Reducibility among combinatorial problems In Complexity of computer computations, R E Miller and J W Thatcher, Ed, Plenum Press, New York, 1972, pp 85{103 [9] Knuth, D E Mariages stables, Les Presses de L'Universite de Montreal, 1976 [10] McVitie, D G and L B Wilson The stable marriage problem Comm ACM 14 (1971), 486{492 [11] Ng, C and D S Hirschberg Complexity of the stable marriage and stable roommate problems in three dimensions Technical Report 88{28 Department of Information and Computer Science, University of California, Irvine (1988) [12] Ng, C and D S Hirschberg Lower bounds for the stable marriage problem and its variants SIAM J Comput 19 (1990), 71{77 [13] Ronn, E NP-complete stable matching problems J Algorithms (to appear) [14] Roth, A The evolution of the labor market for medical interns and residents: a case study in game theory J Political Economy 92 (1984), 991{1016