BME Matematikai ´es Sz´am´ıt´astudom´anyok Doktori Iskola

The stable problem and its generalizations: an algorithmic and game theoretical approach

PhD Thesis

P´eter Bir´o supervisor: Tam´as Fleiner

Budapest, September 2007 Declaration

Ezen ´ertekez´es b´ır´alatai ´es a v´ed´esr˝ol k´esz¨ult jegyz˝ok¨onyv a k´es¨obbiekben a Budapesti M˝uszaki ´es Gazdas´agtudom´anyi Egyetem Term´eszettudom´anyi Kar´anak D´ek´ani Hi- vatal´aban el´erhet˝o.

Alul´ırott, Bir´oP´eter kijelentem, hogy ezt a doktori ´ertekez´est magam k´esz´ıtettem ´es abban csak a megadott forr´asokat haszn´altam fel. Minden olyan r´eszletet, ame- lyet sz´oszerint, vagy azonos tartalomban, de ´atfogalmazva m´as forr´asb´ol ´atvettem, egy´ertem˝uen, a forr´asok megad´as´aval megjel¨oltem.

Budapest, 2007. szeptember 13...... Bir´oP´eter 3 Abstract

We say that a market situation is stable in a general sense, if there is no set of agents such that all of them are interested in creating a new cooperation (after breaking their other eventual cooperations). As a special question, Gale and Shapley [48] introduced and studied the problem of stable marriages. Here a matching, that corresponds to a set of marriages, is stable, if there exists no man and woman, who would both prefer to marry each other (after leaving their eventual partners). Gale and Shapley described a natural that finds a stable matching for the marriage, so when the graph, that models the possible partnerships, is bipartite. The stable matching problem and its generalizations have been extensively studied in combinatorial optimization and . The main reason is that these models are useful to describe economic and social situations. Moreover, as real applications, centralized matching programs have been established in several areas. In this thesis, beside describing the basic models and studying some special problems, we also present some important applications.

The stable matching problem for bipartite graphs is often studied in the context of stable marriages. Actually, whenever we use the marriages as an example for the above problem, we must have at least three assumptions: payment (dower) is not allowed, only men and women can marry each other, and everybody can have at most one partner. The most important generalizations of the stable matching models can be obtained by relaxing these conditions.

If we allow transfers between the agents in the , then we get a problem, that corresponds to the assignment game, defined by Shapley and Shubik [102]. Stable matching problems with or without sidepayments are equivalent to the problem of finding a element of the corresponding so-called TU or NTU-games, (i.e. cooperative games with or without transferable utility,) respectively. If the size of the basic coalitions may be more than 2, then instead of graphs, we can model these problems with . In Chapter 1, we show that the nonemptyness of the core in bipartite matching games is a consequence of a game theoretical lemma of Scarf [97] and a theorem of Lov´asz [70] on normal hypergraphs. Besides, we describe some other interesting connections between and game theory. We note for example that the result of Shapley and Shubik [102] is an easy consequence of a theorem of Egerv´ary [39] about maximum weight matching in bipartite graphs.

If we study one-sided markets instead of two-sided ones, then we get the stable roommates problem and we model it with nonbipartite graphs. As Gale and Shapley [48] showed, a stable matching may not always exist. Irving [56] constructed the first polynomial algorithm that finds a stable matching if there exists one in the given 4 instance. Later, Tan [104] showed that a so-called stable half-matching always exists for the roommates problems. In Chapter 2, we describe two special studies about the stable roommates problem. The first one [21] is about the dynamics of the stable marriage and roommates problems. In this work, we used the algorithm of Roth and Vande Vate [93] in the bipartite case, and a similar algorithm of Tan and Hsueh [105] in the one-sided case to model the dynamics of the matching market. We analyze the properties of the solutions obtained by these incremental . In the second paper [5], we study the complexity of the problem of “almost stable matchings”, that is to find a matching for a roommates problem with the fewest number of blocking pairs.

If an agent can be involved in several partnerships at the same time (according to a quota), then we get the stable b-matching problem. This problem is also solvable by the Gale-Shapley algorithm, in fact, the original goal of their paper was to study this so-called college admission problem. Their algorithm is used currently for many two- sided markets. Moreover, Roth [83] discovered that the very same method had already been implemented in 1952 in the National Intern Matching Program [77]. In Chapter 3, we study the higher education admission process in Hungary. Here, the model is a bit more complicated, since students may have equal scores, so ties must be handled. The presented results have been published in [18]. In this chapter we also introduce and study the so-called stable allocation problem, that is the stable matching problem with bounds on the vertices and capacities on the edges. Here, we generalize the inductive algorithm of Ba¨ıou and Balinski [14] for nonbipartite graphs.

Finally, we study the problem of exchange of indivisible goods. Shapley and Scarf [103] introduced the houseswapping game as a basic NTU-game. The TU-version is called permutation game. Tijs et at. [106] showed that these games also have a nonempty core. In Chapter 4, we focus on the problem, in which the lengths of the possible trading cycles are bounded. Note that if only pairwise exchanges are allowed, then we get again the stable matching problem (with or without sidepayments). For larger bounds, most of the problems become NP-hard. Complexity questions about the so-called stable exchange problems, that are related to the above NTU-games, are studied on the basis of paper [19]. We present a result published in [20] about the inapproximability of a special stable exchange problem. Finally, we consider the maximum weight directed cycle packing problem, that is related to the problem of finding a core element in a permutation game with restrictions. The presented results come from [22]. We note, that the problem of finding an “optimal” exchange with length restrictions is relevant also because it has a very special application: in some already established kidney exchange programs exactly the two- and three-way exchanges are allowed (see [78] for example). Contents

1 Core of cooperative games 8 1.1 NTU-games ...... 8 1.1.1 Partitioning game, redundant and essential coalitions...... 9 1.1.2 Preferences over the set of outcomes ...... 9 1.1.3 FractionalcorebyScarf’slemma ...... 11 1.1.4 Breaking the ties in case of indifferences ...... 13 1.1.5 Fractional stable matching in hypergraphs ...... 14 1.1.6 Normality implies the nonemptyness of the core ...... 15 1.2 TU-games ...... 16 1.2.1 Partitioning game, relevant and essential coalitions ...... 17 1.2.2 Thecoreofbalancedgames ...... 18 1.2.3 Coalition formation game with sidepayments ...... 19 1.3 Matchinggames...... 19 1.3.1 Two-sidedmatchinggames...... 21 1.3.2 One-sidedmatchinggames ...... 22

2 Stable matching problems 23 2.1 The stable marriageand roommates problem ...... 23 2.1.1 Preliminaries ...... 23 2.1.2 Thestablemarriageproblem...... 24 2.1.3 Thestableroommatesproblem ...... 26 2.2 The dynamics of stable matchings ...... 28 2.2.1 Theincrementalalgorithms ...... 30 2.2.2 Getting the best stable partner by making proposals ...... 33 2.2.3 Improving the situation by accepting proposals ...... 37 2.2.4 The increasing side gets worse off ...... 42 2.3 Stable matching with ties, complexity results ...... 43 2.3.1 Findingastablematching ...... 44 2.3.2 “Almoststable”matchings...... 45

5 CONTENTS 6

3 Stable allocation problems 47 3.1 Stable allocation problem by Scarf’s lemma ...... 47 3.1.1 Fractional b-coreelement...... 47 3.1.2 Fractional b-core element with capacities: stable allocation . . . 48 3.2 Integral stable allocation problem for graphs ...... 52 3.2.1 Specialcases...... 52 3.2.2 Reductionbyconstructions ...... 52 3.2.3 Generalizations of the basic algorithms ...... 55 3.2.4 The inductive algorithm for bipartite graphs ...... 56 3.2.5 The inductive algorithm for general graphs ...... 59 3.3 An application: College admission in Hungary ...... 63 3.3.1 The definition of stable score-limit ...... 65 3.3.2 Score-limit algorithms and optimality ...... 65 3.3.3 Furthernotes ...... 69

4 Exchange of indivisible goods 71 4.1 Preliminaries, applications ...... 71 4.1.1 Thecoreofexchangegames ...... 71 4.1.2 An application: Kidney exchange problem ...... 73 4.2 Optimal exchange with restrictions ...... 74 4.2.1 The APX-hardness of maxcover l-way exchange ...... 75 4.2.2 Approximation of the maxweight l-way exchange ...... 77 4.2.3 Exact algorithm for maxweight 3-way exchange ...... 82 4.3 Stableexchangeproblems ...... 83 4.3.1 Stableexchangewithties...... 84 4.3.2 Stable exchange under L-preferences ...... 85 4.3.3 Restrictionsonthelengths...... 85 4.3.4 Maximum size stable exchange problems ...... 86 4.3.5 Complexityresults ...... 87 4.3.6 Summary,openquestions ...... 90 CONTENTS 7 Acknowledgements

I would like to thank Tam´as Fleiner for his supervision. I contacted him in 2001, because the description of his subject for master’s thesis on “the stable matching problem and their applications” was really attractive, since I was interested both in combinatorial optimization and in economic science. This subject was a perfect choice and Tam´as has been a fantastic supervisor. During 6 years, he has been a constant source of advice and encouragement. Beside guiding me in my research and reading carefully my write-ups, he also supported me to find my special interests and to get involved in collaborations with several coauthors. I acknowledge him for all of his help and patience. I am grateful to Andr´as Recski, who introduced me the beauty of graph theory in 1997, and as the head of the Department of Computer Science and Information Theory, he offered me the privilege to become a teaching assistant there in the following year. I would like to express my gratitude to the Department for every support and for providing such a friendly environment to work in. I would like to thank Tam´as Solymosi for introducing me to , for supervising my master’s thesis in and for the useful discussions. I thank my coauthors: David J. Abraham, Katar´ına Cechl´arov´a, David F. Manlove and Romeo Rizzi. Special thanks to Katar´ına for inviting me twice to Kosice, our collaborations were really exciting and fruitful. I am grateful to David F. Manlove for involving me in my first joint work, for his advice and for his precise corrections. I would like to thank Elena Inarra for inviting me to Bilbao in 2006, and for the enjoyable discussion we had there. Finally, I acknowledge my referees, Tam´as Kir´aly and Tam´as Solymosi for their useful comments on the first draft of this thesis. Any shortage or mistake in the final version is entirely my responsibility.

I would like to thank my parents and my wife, M´arti for their love and support. Chapter 1

Core of cooperative games

Introduction

Here, we survey the basic literature about the core of the cooperative NTU- and TU- games. Our final goal is to describe and to study the stable matching problem with the presented general game theoretical notions.

1.1 NTU-games

We recall the definition of n-person games with nontransferable utility (NTU-game for short) that can also be referred to as games without side payments. Definition 1.1.1. An NTU-game is given by a pair (N,V ), where N = 1, 2,...,n is the set of players and V is a mapping of a set of feasible utility vectors,{ a subset V }(S) of RS to each coalition of players, S N, such that V ( ) = , and for all S N, S = : ⊆ ∅ ∅ ⊆ 6 ∅ a) V (S) is a closed subset of RS b) V (S) is comprehensive, i.e. if uS V (S) and u˜S uS then u˜S V (S) ∈ ≤ ∈ c) The set of vectors in V (S) in which each player in S receives no less than the maximum that he can obtain by himself is a nonempty, bounded set. One of the most important is the core. Definition 1.1.2. A utility vector uN V (N) is in the core of the game, if there exists ∈ S N S no coalition S N with a feasible utility vector u˜ V (S) such that ui < u˜i for every player i S. Such⊆ a coalition is called a blocking coalition.∈ ∈ An NTU-game (N,V ) is superadditive if V (S) V (T ) V (S T ) for every pair of disjoint coalitions S and T . In what follows, we restrict× our⊆ attention∪ to superadditive games.

8 CHAPTER 1. CORE OF COOPERATIVE GAMES 9

1.1.1 Partitioning game, redundant and essential coalitions Partitioning games are special superadditive games. Given a set of basic coalitions 2N , that contain all singletons (i.e. every single player has the right not to cooperateB ⊆ with the others), a partitioning game (N,V, ) is defined as follows: if ΠB(S) denotes the set of partitions of S into basic coalitions,B then V (S) can be generated as: S S S V (S)= u R π = B , B ,...,Bk Π (S) : u V (B ) V (B ) V (Bk) { ∈ |∃ { 1 2 } ∈ B ∈ 1 × 2 ×···× } This means that uS is a feasible utility vector of S if there exist a partition π of S S into basic coalitions, such that each utility vector u B can be obtained as a feasible | i utility vector for the basic coalition Bi of π.

Given an NTU-game (N,V ), let U(S) be the set of Pareto optimal utility vectors of the coalition S, i.e. uS U(S) if there exists nou ˜S V (S), where uS =u ˜S and uS u˜S. ∈ ∈ 6 ≤A utility vector uS V (S) is separable if there exist a proper partition π of S into ∈ S subcoalitions S1,S2,...,Sk such that u Si is in V (Si) for every Si π. A utility vector that is non-separable, Pareto-optimal and| in which each player receives∈ no less than the maximum that he can obtain by himself is called an efficient vector. A coalition S is essential if V (S) contain an efficient utility vector. In other words, a coalition S is essential, if its members can obtain an efficient utility vector that is not achievable independently by its subcoalitions. The set of essential coalitions is denoted by (N,V ). We say that a coalition S is not relevant if for every utility vector uS V (ES) there S ∈ exists a proper subcoalition T S such that u T is in V (T ). The set of relevant ⊂ | coalitions is denoted by (N,V ). The idea behind this notion is that if a non-relevant R S coalition S is blocking with a utility vector u , then some of its subcoalitions, T1 must T1 S T1 be also blocking with utility vector u = u T1 . Moreover, if T1 is not relevant or u is | T2 T1 S separable, then we can find another coalition T T , such that u = u T2 = u T2 , 2 ⊂ 1 | | an so on. By this, there must be a relevant coalition Ti S, that is blocking with a Ti S ⊂ non-separable vector u = u T . This observation implies the following Proposition: | i Proposition 1.1.3. A utility vector uN V (N) is in the core if and only if it is not blocked by any relevant coalition with an∈ efficient utility vector. Obviously, if a coalition is not essential, then it cannot be relevant either. In a partitioning game, the set of essential coalitions must be a subset of the basic coalitions by definition. Proposition 1.1.4. For every partitioning game (N,V, ), (N,V, ) (N,V, ) holds. B R B ⊆E B ⊆ B 1.1.2 Preferences over the set of outcomes Scarf observed in [97] that the previously introduced notions are purely ordinal in character: they are invariant under a continuous monotonic transformation of the utility CHAPTER 1. CORE OF COOPERATIVE GAMES 10 function of any individual. Hence, without loss of generality, we may assume that U {i} = 0 for every singleton, and all the efficient utility vectors are nonnegative. Moreover,{ } the discussion can be carried out on an abstract level with the outcomes for each individual represented by arbitrary ordered sets. In order to obtain a particular non-separable vector uS,k in U(S), the members of S have to perform a common activity, say aS,k. We denote by AS the set of activities that yield efficient utility vectors in U(S). The of a player over the possible activities in which he can be involved in is determined by the utilities that he obtains S,k T,l S,k T,l S,k by the activities. Formally, we have a i a u u for two activities a ≤ ⇐⇒ i ≤ i and aT,l, where i S and i T . Considering an∈ efficient∈ utility vector uN of the grandcoalition N, the non- separability implies that it corresponds to a common activity aN of the entire set of players. Otherwise, if uN is separable, then uN can be obtained as a direct sum of independent efficient utility vectors of essential subcoalitions that form a partition of the grandcoalition. This can be considered as a set of independent activities of the sub- coalitions. An outcome of the game, denoted by X then can be regarded as a partition π of the players and a set of activities Aπ performed independently by the coalitions in π, so X =(π, Aπ). An outcome X is judged by a player i according the activity he is involved in, denoted by ai(X). An outcome is in the core of the game, or in other words, it is stable if there exist no blocking coalition S and an activity aS,l that is S,l strictly preferred by all of its members, so a >i ai(X) for all i S. (This is equiv- N S ∈ alent to the blocking condition ui < u˜i , if the outcome X corresponds to the utility vector uN .)

uS,1

uS,2

uS,3 uS,4

uS,k

Figure 1.1: Approximation with finite number of efficient utility vectors.

An NTU-game is called finitely generated if for every essential coalition S, U(S) contains a finite number of vectors. Here, the preference order of a player over the set of activities, in which he can be involved, can be represented by preference lists. As CHAPTER 1. CORE OF COOPERATIVE GAMES 11

Scarf observed in [97] and [96], a general NTU-game can be approximated by a finitely generated NTU-game (see an illustration in Figure 1.1), thus they have similar basic properties. Here, we will not discuss this question in details. Suppose that in an NTU-game for every essential coalition S, U(S) contains one single vector uS. In this case, the outcome of the game is just a partition, since each essential coalition has one single activity to perform. So here, instead of activities, each player has a preference order over the essential coalitions in which he can be a member. These games are called coalition formation games (CFG for short), and an outcome that is in its core is called a core-partition.

Example 1.1.5. In this example, we have 6 players: A,B,C,D,E and F , and 4 pos- sible basic coalitions corresponding to activities, such that all members are interested to participate in the activity. The first activity, b (bridge) can be played by A,B,C and D, the second one, p (poker) can be played by C,D and E. Finally, B can play with C (c1) and D can play chess with F (c2).

B Activities Participants Players Preference lists A C b : A, B, C, D B [b, c1] p : {C,D,E } C [p,b,c ] D 1 E { } c1 : B,C D [b,p,c2] F c : {D, F} 2 { }

Here, p, A , B , F is a core-partition, since b is not blocking because C prefers { { } { } { }} his present coalition p to b, similarly, c1 is not blocking because C prefers playing poker with D and E to playing chess with B, and c2 is not blocking because D also prefers playing poker to playing chess with F . One can easily check that b, E , F is also { { } { }} a core-partition, but the partition c1,c2, A , E is not stable, since p and b are blocking coalitions. { { } { }}

1.1.3 Fractional core by Scarf’s lemma First, we present Scarf’s lemma [97] and we apply it to the original settings. By this, we introduce the notion of fractional core and we study some consequences. The following version of the Lemma is due to Aharoni and Fleiner [7], here [n] denotes the integers 1, 2,...,n. Rn Theorem 1.1.6 (Scarf, 1967). Let n, m be positive integers, and b be a vector in +. Also let A = (ai,j),C = (ci,j) be matrices of dimension n (n + m), satisfying the following three properties: the first n columns of A form an n× n identity matrix (i.e. Rn+m × ai,j = δi,j for i, j [n]), the set x + : Ax = b is bounded, and ci,i < ci,k

Rn+m Then there is a nonnegative vector x in + such that Ax = b and the columns of C that correspond to supp(x) form a dominating set, that is, for any column i [n+m] ∈ there is a row k [n] of C such that ck,i ck,j for any j supp(x). ∈ ≤ ∈ Let the columns of A and C correspond to the efficient utility vectors (or equiva- lently to some activities) of the essential coalitions in a finitely generated NTU-game as follows. If the k-th columns of A and C correspond to the utility vector uS,l, then let ai,k be 1 if i S and 0 otherwise, (so the k-th column of A is the membership vector ∈ S,l of coalition S). Furthermore, let ci,k = ui if i S and ci,k = M otherwise, where ∈{i} M is a sufficiently large number. We set ci,i = ui = 0 and ci,j = 2M if i = j n. Finally, let b =1N . By applying Scarf’s lemma for this setting, we obtain a solu6 tion≤ x that we call a fractional core element of the game.

What is the meaning of a fractional core element? Let us suppose first, that a fractional core element x is integer, so xi 0, 1 for all i. In this case we show that x gives a utility vector uN that is in the core∈{ of the} game. Let uN be the utility vector of N received by summing up those independent essential utility vectors for which x(uS,k) = 1, then uN is obviously in V (N) by superadditivity. To prove that uN must be in the core of the game, let uS,k be an essential utility vector, with x(uS,k) = 0. By the statement of Scarf’s lemma, there must be a player i and an essential utility vector uT,l, such that i T , x(uT,l) = 1 and uS,k uT,l, so S cannot be a blocking coalition ∈ i ≤ i with the efficient utility vector uS,k. In other words, the Ax =1N condition of the solution says that x gives a partition π of N and a set of activities Aπ that are performed (i.e. aS,k is performed, so aS,k Aπ ∈ if x(uS,k) = 1, thus S is a coalition in the partition π). Let X = (π, Aπ) be the corresponding outcome, and let aS,k be a not performed activity, (i.e. aS,k / Aπ). Then, by Scarf’s lemma there must be a player i of S for which the performed activity∈ S,k S,k ai(X), he is involved in is not worse than a , so a i ai(X), thus S cannot be a blocking coalition with the activity aS,k. ≤

In the non-integer case, we shall regard x(uS,k) as the intensity the activity aS,k is performed with, by coalition S. The Ax = 1N condition means, that each player participates in activities with total intensity 1, including maybe the activity that this single player performs alone. The domination condition says, that for each activity, that is not performed with intensity 1, there exists a member of the coalition, who is not interested in increasing the intensity of this activity, since he is satisfied by some other preferred activities that fill his remaining capacity of intensity. For- S,k T,l T,l S,k mally, if x(u ) < 1, then there must be a player i in S such that a ≥ia x(u )=1. P 1 2 In Example 1.1.5, x(p) = 3 , x(b) = 3 is a fractional core element, since for each activity there is one player who is not interested in increasing the intensity of that activity. Below, we show another example, where the core of the game is empty, and CHAPTER 1. CORE OF COOPERATIVE GAMES 13 which has exactly one fractional core element. Example 1.1.7. In this example we have 6 players, with 6 possible common activities with the following preferences:

A Activities Participants Players Preference lists p : A, D, B A [p ,p ] 1 { } 1 3 D F p : B,E,C B [p ,p ] 2 { } 2 1 p : C,F,A C [p ,p ] 3 { } 3 2 c1 : D, E D [p1,c1,c2] C { } B E c2 : E, F E [p2,c2,c3] { } c : F,D F [p ,c ,c ] 3 { } 3 3 1

It can be verified, that here the only fractional core element is x(p1) = x(p2) = 1 1 x(p3) = 2 and x(c1) = x(c2) = x(c3) = 4 . One can easily generalize this construction having 3n players, and intensity 2−n of some activities in the unique fractional core element.

1.1.4 Breaking the ties in case of indifferences In a finitely generated NTU-game it can happen that a player i is indifferent between aS,k aT,l aS,k aT,l S,k some activities and , since he gets the same utilities (so i if ui = T,l ∼ ui ). In this case so-called ties occur in the preference lists. Here, we recall the three main core-, or stability-concepts: An outcome X is in the weak core, or it is weakly stable, if there exist no blocking • coalition S with an activity aS,k such that every player i S strictly prefers aS,k S,k ∈ to ai(X), (so a >i ai(X) for all i S). ∈ An outcome X is in the strong core, or it is strongly stable, if there exist no • blocking coalition S with an activity aS,k such that every player i S strictly S,k ∈ prefers a to ai(X) or is indifferent between them, and there exist at least one S,k S,k player j, who strictly prefers a to aj(X), (so a i ai(X) for all i S and S,k ≥ ∈ a >j aj(X) for some j S). ∈ An outcome X is in the super core, or it is super stable, if there exist no blocking • coalition S with an activity aS,k such that every player i S strictly prefers aS,k S,k ∈ to ai(X) or is indifferent between them, (so a i ai(X) for all i S). ≥ ∈ Note that the weak core is simply the core. A derived game for a given finitely generated NTU-game with indifferences is obtained by breaking all the ties in some way. If we consider a fractional core x, or an outcome X that is in the core for a derived game, then obviously x is a fractional core element, or X is an outcome in the CHAPTER 1. CORE OF COOPERATIVE GAMES 14 core of the original game too. In fact, this technique is used also in the algorithm of Scarf, where the matrix C is perturbed at the beginning of the procedure in order to avoid indifferences, and thus the cycling caused by the degeneracy.1

1.1.5 Fractional stable matching in hypergraphs For a finitely generated NTU-game, the problem of finding an outcome that is in the core, is equivalent to the stable matching problem in a as defined by Aharoni and Fleiner [7]. Here, the vertices of the hypergraph correspond to the players, the edges correspond to the efficient vectors (or to activities), and the preference of a vertex over the edges it is incident with comes from the preference of the corresponding player over the activities he can be involved in. This is called a hypergraphic preference system. A matching corresponds to a set of common activities performed by some coalitions, that form a partition of the grandcoalition together with the singletons (i.e. vertices not covered by the matching). A matching is stable if there exist no blocking edge, i.e. an edge, that is not in the matching but strictly preferred to the edges in the matching by all its vertices. The corresponding set of activities gives a stable outcome, since there exist no blocking coalition with an activity that is strictly preferred by all of its members (in other words, the direct sum of the corresponding independent efficient utility vectors is a feasible utility vector for the grandcoalition which is in the core of the game). A hypergraph that represents the efficient utility vectors of a CFG is obviously simple.

The fractional stable matching for a stable matching problem in a hypergraph was defined by Aharoni and Fleiner [7] as follows. A function x assigning non-negative weights to edges of the hypergraph is called a fractional matching if x(h) 1 for v∈h ≤ every vertex v. A fractional matching x is called stable if every edge ePcontains a vertex v such that v∈h,e≤vh x(h) = 1. The existence of a fractional stable matching can be verified by Scarf’sP lemma just like the existence of a fractional core element. Actually, these two notions are basically equivalent. To show the equivalence formally, we consider on the one hand the polytope of intensity vectors x Ax = 1N , x 0 , where A is the membership-matrix of the efficient utility vectors{ | (or the corresponding≥ } activities) of dimension n (n + m) as defined by Scarf’s lemma. On the other hand, the fractional matching× polytope is x Bx 1N , x 0 , where B is the vertex-edge incidence matrix of the hypergraph { | ≤ ≥ } of dimension n m. Obviously, A =(In B), so the difference is only an n n identity matrix, i.e. the× membership-matrix of the| singletons. So, there is a natural× one-to-one

1We note that the nonemtyness of the core can depend dramatically on the way we break the ties. In fact, the problem of finding an outcome that is in the core for an NTU-game with indifferences can theoretically be more complex too. We will study some relevant cases considering matching games in Section 2.3. CHAPTER 1. CORE OF COOPERATIVE GAMES 15 correspondence between the elements of the two polytopes: if xm is a fractional matching of dimension m, then letx ¯v = 1N Axm be a vector of dimension n, that gives the unfilled intensities of the players (or− in other words, the intensities of the single activities). The direct sum of these two independent vectors, x is an intensity vector of dimension n + m, and vice versa. The stability condition is equivalent to the domination condition of Scarf’s lemma.

Finally, we have to clarify the question of indifferences. According to the definition by Aharoni and Fleiner [7], in a hypergraphic preference system the preferences of the vertices over the edges are strict. If we allow ties, then the corresponding problem is called stable matching problem in a hypergraph with ties.2 Here, the stable matching problem obtained by breaking the ties in some way is also called a derived problem. If we consider a fractional stable matching for a derived problem, this fractional matching is obviously stable for the original setting too.

Aharoni and Fleiner showed that a fractional stable matching can be assumed to be an extremal point of the fractional matching polytope. This fact comes from a statement similar to the following Proposition:

Proposition 1.1.8. If x is a fractional core element of a finitely generated NTU-game, i i i N and x = αix , where αi > 0 for all i, αi = 1 and x satisfies the Ax = 1 and xi 0 conditions,P then each xi must be aP fractional core element. ≥ The proof of this Proposition is obvious, since supp(xi) supp(x), that implies the ⊆ dominating property of the fractional core element.

Corollary 1.1.9. For any finitely generated NTU-game, there exists a fractional core element that is an extremal point of the polytope x Ax =1N , x 0 . { | ≥ } Corollary 1.1.9 implies that if all the extremal points of the above polytope are integers, or in other words the polytope has the integer property, then the finitely generated NTU-game has a nonempty core.

1.1.6 Normality implies the nonemptyness of the core The definition of a normal hypergraph is due to Lov´asz [70]. If H is a hypergraph and H′ is obtained from H by deleting edges, then H′ is called a partial hypergraph of H. The chromatic index χe(H) of a hypergraph H is the least number of colors sufficient to color the edges of H so that no two edges with the same color have a vertex in common. Note that the maximum degree, ∆(H) (that is, the maximum number of edges containing some one vertex) is a lower bound for the chromatic index. A hypergraph

2However, we note that in the literature the stable matching problem for graphs is sometimes defined by allowing ties in the preference lists (see e.g. the book of Roth ad Sotomayor [92]). CHAPTER 1. CORE OF COOPERATIVE GAMES 16

′ ′ ′ H is normal if every partial hypergraph H of H satisfies χe(H )=∆(H ). Obviously, the normality is preserved by adding or deleting parallel edges or loops. The following theorem of Lov´asz [70] gives an equivalent description of normal hypergraphs. Theorem 1.1.10 (Lov´asz). The fractional matching polytope of a hypergraph H has the integer property if and only if H is normal. Suppose that for a finitely generated NTU-game the set of essential coalitions forms a normal hypergraph. The hypergraph of the corresponding stable matching problem must be also normal, since it is obtained by adding parallel edges and by removing the loops. By Theorem 1.1.10, the fractional matching polytope, x Bx 1N , x 0 has { | ≤ ≥ } the integer property, and so has the polytope of intensity vectors, x Ax =1N , x 0 as it was discussed previously. This argument and Corollary 1.1.9{ verify| the following≥ } Lemma 1.1.11. Lemma 1.1.11. If, for a finitely generated NTU-game, the set of essential coalitions, (N,V ) forms a normal hypergraph, then the core of the game is nonempty. E By Lemma 1.1.11 and Proposition 1.1.4 the following holds. Theorem 1.1.12. If the set of basic coalitions, forms a normal hypergraph, then every finitely generated NTU-game (N,V, ) has aB nonempty core. B Let AB denote the membership-matrix of the set of basic coalitions . The fact that the integer property of the polytope x ABx = 1N , x 0 implies theB nonemp- tyness of every NTU-game (N,V, ) was proved{ | first by Vasin≥ and} Gurvich [108], and B independently, by Kaneko and Wooders [63]. Later, Le Breton et al. [69], Kuipers [68] and Boros and Gurvich [28] observed independently that the integer property of the polytope x ABx = 1N , x 0 is equivalent to the integer property of the matching polytope{ | x ABx 1N , x≥ }0 , and to the normality of the corresponding hypergraph. { | ≤ ≥ } We note that the other direction of Theorem 1.1.12 is also true: Boros and Gurvich [28] proved that if the set of basic coalitions, has the property that the polytope x ABx =1N , x 0 has a non-integer extremalB point (thus the corresponding hyper- { | ≥ } graph is not normal), then there always exist a finitely generated NTU-game (N,V, ) with an empty core. B

1.2 TU-games

An n-person game with transferable utility (TU-game for short) is given by a pair (N, v), where N is the set of players, and v is a payoff function v : 2N R, such → that v( ) = 0. Without loss of generality we may assume also that v( i ) = 0 for all singletons,∅ thus every efficient utility vector is nonnegative. The outcome{ } of the game is a vector u = uN if it satisfies u(N) = v(N) (also referred to as a preimputation), CHAPTER 1. CORE OF COOPERATIVE GAMES 17

N N where the notation u(S) means u(S)= i∈S ui . The outcome u is in the core of the TU-game (N, v) if u(S) v(S) holds forP every coalition S N. The definition of a TU-game≥ can be easily derived from⊆ the definition of NTU- games, by setting V (S)= uS RS uS v(S) . { ∈ | i∈S i ≤ } Superadditivity for a TU-game meansP v(S)+ v(T ) v(S T ) for every pair of disjoint coalitions S and T . Here again, we restrict our≤ attention∪ to superadditive games.

1.2.1 Partitioning game, relevant and essential coalitions In a partitioning TU-game (N,v, ) with a set of basic coalitions , v(S) can be generated as: B B

v(S) = max v(B )+ v(B )+ + v(Bk) π = B , B ,...,Bk Π (S) { 1 2 ··· | { 1 2 } ∈ B } To define the essential, relevant and balanced coalitions we introduce some compact formulas. Let =2N be the collection of nonempty coalitions. As it was defined in N \{∅} the previous section, A is the membership-matrix of dimension N (i.e. ai,S =1if RN | |×|N| i S and 0 otherwise), and x is a column-vector of + called intensity vector. Finally, ∈ N let v be a row-vector of R that corresponds to the payoff-function. Let maxN (LP )= N N N max v x Ax =1 and maxN (IP ) = max v x Ax =1 , x 0, 1 be the optimum of the{ linear· | and integer} programs, respectively.{ · | ∈{ } } Similarly, if is an arbitrary collection of nonempty coalitions, so , then C C ⊆N we define maxC(LP ) and maxC(IP ) to be the optimum of the restricted programs C C C (i.e if C∈C = C¯, x C = x , v C = v , and A is the restricted membership- ∪ | | C C C C C¯ matrix of dimension C¯ , then maxC(LP ) = max v x A x = 1 and C | C| ×C |C|C C¯ C C { · | } maxC(IP ) = max v x A x = 1 , x 0, 1 ). Finally, let (S) = T : T S and ∗(S)= T :{T · S |. ∈{ } } P { ⊆ } P { ⊂ }

A coalition S is essential if maxP∗(S)(IP ) < v(S). The assumed superadditivity implies that maxP(S)(IP ) = v(S) for every coalition S. Let (N, v) denote the set of essential coalitions again. In a partitioning game (N,v, ), theE payoff of the coalition S can be generated simply as v(S) = max (IP ), so (BN,v, ) is obvious. The B E B ⊆ B following Proposition says that the optimum of each integer program remains the same, if we restrict the support of x to the set of essential coalitions.

Proposition 1.2.1. Given a TU-game (N, v) and = (N, v). For every coalition S E E maxP(S)(IP ) = maxE∩P(S)(IP ) holds.

3 A coalition S is relevant if maxP∗(S)(LP ) < v(S). A coalition S is balanced if maxP(S)(LP )= v(S). If (N, v) denotes the set of relevant coalitions, then (N, v) (N, v) obviously. The meaningR of the following Proposition is that the optimumR of⊆ E 3This notion was introduced by Gillies [51], he called these coalitions as vital coalitions. CHAPTER 1. CORE OF COOPERATIVE GAMES 18 each linear program remains the same, if we restrict the support of x to the set of relevant coalitions. Proposition 1.2.2. Given a TU-game (N, v) and = (N, v). For every coalition R R S maxP(S)(LP ) = maxR∩P(S)(LP ) holds. The above Proposition implies that if the core-condition u(S) v(S) is violated for some coalition S not in (N, v), then it must also be violated≥ for some relevant R coalition T S. ⊂ 1.2.2 The core of balanced games Recall that a TU-game (N, v) is balanced if the grandcoalition N is balanced. The following well-known theorem was proved independently by Bondareva [26], [27] and Shapley [101]. Theorem 1.2.3 (Bondareva-Shapley). A TU-game (N, v) has a nonempty core if and only if it is balanced. Here, we verify this theorem only in case v is superadditive, although, we note that the theorem is true for every TU-game.

N Proof. We shall observe first that maxN (LP ) = max v x Ax 1 (so the equalities can be changed to inequalities, since all singletons are{ in· | with≤ nonnegative} payoffs). N By this we can define the dual of the above linear program: let minN (DLP ) = min y 1N yA v,y RN , where y is a row-vector, that may correspond to a payoff-function{ · | ≥ ∈ + } y : N R+. The inequalities y(S) v(S) are in fact the core-conditions, and the → ≥ ∗ objective function is i∈N yi = y(N). If y is an optimal solution of the dual program, then by using the DualityP Theorem we get v(N) = max (IP ) max (LP ) = min (DLP )= y∗(N) (1.1) N ≤ N N Finally, if u(N) is an outcome in the core, then on the one hand u(N)= v(N), and on the other hand, u must satisfy the core-conditions, so u(N) y∗(N). That is possible ≥ if and only if v(N) = maxN (LP ), thus if the game is balanced.

Moreover, Propositions 1.2.1 and 1.2.2 imply that maxN (IP ) = maxE (IP ) and maxN (IP ) = maxE (IP ) = maxR(LP ) , respectively. So, the core of a TU-game is nonempty if and only if max (IP ) = max (LP ). For a partitioning TU-game (N,v, ), E E B the above equality holds if and only if max (IP ) = max (LP ), since (N,v, ) . B B E B ⊆ B We note, that the above primal and dual programs have a well-known equivalent meaning in the theory of hypergraphs. Let the hypergraph H be formed again by the essential coalitions of the TU-game, where the weight of an edge e in the hypergraphs, w(e) is equal to the payoff of the corresponding coalition S in the TU-game, v(S). Recall that y : V (H) R is a cover of the vertex set V (H) of H, if y(v) w(e) for → + v∈e ≥ every edge e in H. The value of y is v∈V (H) y(v). The following observationP is obvious. P CHAPTER 1. CORE OF COOPERATIVE GAMES 19

Remark 1.2.1. The problems max v x Ax 1N , x 0, 1 N , max v x Ax 1N N RN { · | ≤ ∈{ } } { · | ≤ } and min y 1 yA v,y + are equivalent to the maximum weight matching, maximum{ weight· | fractional≥ ∈ matching} and minimum value cover problems in the corre- sponding weighted hypergraph H, respectively. Thus a TU-game has nonempty core if and only if the maximum weight of a matching in H is equal to the maximum weight of a fractional matching in H. It is well-known, that the optimum of a linear program can be obtained as an extremal point of the corresponding polytope. Thus, if the membership-matrix of the set of basic coalitions, AB is such that the extremal points of the polytope xB ABxB = 1N , xB 0 are integers, then the game has a nonempty core for every payo{ ff| function ≥ } v. By Theorem 1.1.10 this is possible if and only if the hypergraph formed by the basic coalitions is normal. This argument directly verifies Theorem 1.1.12 in case of TU-games. Theorem 1.2.4. If the set of basic coalitions forms a normal hypergraph, then every B TU-game (N,v, ) has a nonempty core. B 1.2.3 Coalition formation game with sidepayments Every TU-game can be equivalently described as a coalition formation game with sidepayments. We recall, that in a coalition formation game each essential coalition S has only one Pareto-optimal utility vector uS U(S). A sidepayment pS between RS ∈ S the members of S is a vector in , such that i∈S pi = 0, (i.e. the members of S can reallocate their utilities between each other).P Thus, an outcome of a CFG with sidepayments consists of a partition π of the grandcoalition, and a sidepayment vector p, that is the sum of the independent sidepayment-vectors pS for all S π. S ∈ An outcome (π,p) determine the utility of each player i, ui(π,p) = ui + pi, where i S π. An outcome (π,p) is in the core (or it is stable), if there exists no blocking ∈ ∈ T T T coalition T with some sidepayment p , such that ui + pi > ui(π,p) for each i T , (so if each member of T can be strictly better off by cooperating with each other∈ and by reallocating the common utility in a suitable way).

S The corresponding TU-game is defined with the payoff-function v(S) = i∈S u . Obviously, the set of utility vectors uS,p = uS +pS, that is achievable for S by performingP the common activity and by reallocating the common utilities with some sidepayments, contains every efficient vector of S. This is the reason of the fact that the core of a CFG with sidepayments is the same as the core of the corresponding TU-game.

1.3 Matching games

Matching games can be defined as partitioning NTU-games, where the cardinality of each basic coalition is at most 2. For simplicity, in this section we suppose that no CHAPTER 1. CORE OF COOPERATIVE GAMES 20 player is indifferent between two efficient utility vectors, so their preferences between the common activities are strict. If a matching game is finitely generated, then the problem of finding an outcome that is in the core is equivalent to a stable matching problem in a graphic preference system, where the edges of the graph correspond to the efficient utility vectors (and to the common activities). Considering the set of utility vectors, basically we have four cases. If each basic coalition (each couple), has only one efficient utility vector, then the representing graph is simple, and the problem of finding a core-solution in the obtained CFG can equivalently be called the stable roommates problem (or stable matching problem in a simple graph). If each couple has a finite number of efficient utility vectors, then these activities are represented by parallel edges in the graph, the obtained stable matching problem can also be referred to as a stable roommates problem with multiple activities. In case of a general matching game, as we mentioned before, the set of efficient utility vectors can be approximated with a finite number of vectors, thus this general game has properties similar to the stable matching problem. Finally, if the utility is transferable, then the problem can be called roommates game with transferable utilities (or with sidepayments). Figure 1.2 illustrates these four cases.

a a a a

V a,b V a,b V a,b V a,b 5 ({ })5 ({ }) ({ })5 ({ }) 4 pab

pab

3 b 3 5 b b 3 b

5 3 5 3 5 +pab 3 a b a b a b a b 4 5

Figure 1.2: The set of efficient utility vectors and the corresponding edges.

We present two simple examples of three players considering both the stable room- mates problem and the roommates problem with transferable utilities for the given utilities. Example 1.3.1. In the first example, the utility of the players from the possible com- {a,b} {a,b} {b,c} {b,c} {c,a} mon activities are the following: ua =6, ub =3, ub =4, uc =1, uc =2, {c,a} ua =1. Here, there is no stable matching (the core of the CFG is empty), but there exists a matching a, b with a sidepayment from a to b of a value between 2 and 3, that is stable (thus{ the} core of the TU-game is nonempty). CHAPTER 1. CORE OF COOPERATIVE GAMES 21

a a a 1 6 pab 2 pab 3 ≤ ≤ pab 2 3 c 1 4 b b b c c

Figure 1.3: Example 1.3.1 illustrates a core-outcome in case of the TU-game.

Example 1.3.2. The utility of the players from the possible common activities are the {a,b} {a,b} {b,c} {b,c} {c,a} {c,a} following: ua =2, ub =3, ub =2, uc =1, uc =2, ua =1.

a a a 1 2

2 3

c1 2 b b b c c

Figure 1.4: Example 1.3.2 illustrates a stable matching in case of NTU-game.

Here, the matching a, b is stable (the core of the CFG is nonempty), but the { } roommates game with transferable utilities has an empty core. (The reason of this latter fact will be explained at the end of this subsection.)

Let us suppose the set of players N can be divided into two parts, M and W such that every two-member basic coalition contains one member from each side (so if m, w then m M and w W ). In this case we get a two-sided matching game {(in the} general ∈ B case the∈ matching∈ game is called one-sided).

1.3.1 Two-sided matching games If a two-sided matching game is finitely generated, then the corresponding graphic representation of the stable matching problem is bipartite. For bipartite graphs, the following Proposition is well-known. CHAPTER 1. CORE OF COOPERATIVE GAMES 22

Proposition 1.3.3. Every is normal.

This Proposition and Theorem 1.1.12 imply the following result.

Theorem 1.3.4. Every finitely generated two-sided matching game has a nonempty core.

Theorem 1.3.4 was proved for every two-sided matching game, originally called central assignment game, by Kaneko [62]. For the corresponding CFG-s, called stable marriage problems, this result was proved by Gale and Shapley [48]. Finally, the same result for two-sided matching games with transferable utilities, defined as assignment games, was showed by Shapley and Shubik [102]. We note that by Remark 1.2.1 the latter result is an immediate consequence of the theorem by Egerv´ary [39], which states that the maximum weight of a matching and the minimum value of a cover are equal in every bipartite graph.

1.3.2 One-sided matching games As it was shown by Examples 1.3 and 1.4, a one-sided matching game can have an empty core, even for the special CFG and TU-games. Here, we present that the half-integer property of the fractional matching polytope implies the existence of half-solutions in each case. The following observation is due to Balinski [15].

Theorem 1.3.5 (Balinski). The fractional matching polytope for every graph has only half-integer extremal points.

This theorem of Balinski [15] and Scarf’s lemma imply that in every matching game there exists a fractional core element x that has the half-integer property, i.e. 1 xi 0, , 1 , called a half-core element. ∈{ 2 } Theorem 1.3.6. If a matching game is finitely generated then it always has a half-core element.

For CFG-s, the fact that for every stable matching problem there exists a stable half-matching was proved by Tan [104]. For matching games (or roommates games) with transferable utilities, a similar result was proved by Eriksson and Karlander [41]. In this case, by Remark 1.2.1 the nonemptyness of the core depends on whether the corresponding weighted matching and weighted fractional matching problems have the same optimum or not. This question is solvable in polynomial time by the algorithm of Edmonds [38]. This fact explains why the TU-game in Example 1.4 has an empty core: the maximum weight of a matching is at most 5, while there exist a half-matching with weight 5.5. Chapter 2

Stable matching problems

Introduction

In this chapter, we start with a short overview on the stable matching problem. Then we present some results on the dynamics of stable matchings, published in [21]. Finally, we consider the stable matching problem with ties, where we collect a family of related problems and we study their complexity. A part of the results come from [5].

Some important results are collected in a table at the end of Section 2.3, and a part of them are included in another table at the end of Section 4.3 as well. To clarify the connections, we give a reference index [Ri] to each problem contained in these tables of results.

2.1 The stable marriage and roommates problem

2.1.1 Preliminaries The stable matching problem on a graphic preference system (or simply the stable matching problem) was already defined in the previous section as a problem equivalent to finding an outcome in the core of a finitely generated NTU-game with basic coalitions of size at most two, called a matching game. Here, we recall the definition and introduce some further notions.

Let us model the stable matching problem with a graph G, where the agents are represented by vertices, and two vertices are linked by an edge if the agents are both acceptable to each other. For every vertex v, let

23 CHAPTER 2. STABLE MATCHING PROBLEMS 24

We say that agent v prefers edge f to e (in other words f dominates e at v) if e

For simplicity, in this section we suppose that the graphs of the stable matching problems are simple, thus the corresponding NTU-games are coalition formation games. The stable matching problem was called stable marriage problem if the graph is bipar- tite (the two color classes represent men and women), and stable roommates problem if the graph is general [48]. According to the original definitions, it is assumed that each agent finds acceptable all his possible partners, so the graph and the preference lists are also complete. Here, we relax this assumption and study stable marriage and stable roommates problems with incomplete lists.

2.1.2 The stable marriage problem The stable marriage problem was defined and studied by Gale and Shapley [48]. In their seminar paper they proved that stable matching always exists for the marriage problem, moreover their algorithm produces a solution that is optimal for each member in one of the sides. Beside presenting this algorithm, we show some other well-known results. The original goal of Gale and Shapley was to study the college admission problem, that is a generalization of the stable marriage problem. Many years later, Roth discovered that the Gale–Shapley algorithm had been in use since 1952 by the National Intern Matching Program (now called the National Resident Matching Program, NRMP), for further details, see [83] and [92]. We study similar problems with capacities in Chapter 3, where we present the Hungarian higher education admission program as a special application.

Let the vertex set of a bipartite graph G be the disjoint union of M and W (i.e. men and women). We suppose that a man and a woman are linked by an edge if they are both acceptable to each other. Each man and each woman ranks his or her possible marriages (or equivalently his or her possible partners) in a strict order, represented by a preference list. CHAPTER 2. STABLE MATCHING PROBLEMS 25

The deferred-acceptance algorithm To start, let each man propose to his favorite woman. Each woman who receives more than one proposal rejects all but her favorite, who becomes her fianc´e. In the further stages, each man who was rejected in the previous stage, proposes to his next choice according to his list, and each woman who was receiving proposals reject all but her most preferred among the group consisting of the new proposers together with her current fianc´e. Obviously, men propose to less and less preferred partners, while women receive proposals from better and better fianc´es, thus the algorithm stops in O(m) time (where m denotes the number of edges in the graph), when no more proposal is left. The fianc´es become husbands. The obtained set of marriages is obviously a matching.

To show stability, consider an edge m, w not in the matching. If m made no { } proposal to w, then m has been engaged with a preferred woman in each stage, and also at the end of the procedure. So pair m, w cannot block because of m. Otherwise, if m proposed to w during the algorithm,{ then}w refused him because she had a better proposal at that time, and since her situation was improving during the algorithm, she must have a preferred husband at the end of the algorithm too. Again m, w cannot block. { }

Theorem 2.1.1 (Gale–Shapley). For every stable marriage problem, there exists a stable matching. [R1]

Moreover, it can be verified that each man gets his best possible partner (i.e. woman w is possible for man m if there exists a stable matching M, where m, w is a matched pair) in the matching obtained by the deferred-acceptance algorithm,{ thus} this match- ing is so-called man-optimal. Indirectly, let us suppose that m is the first such man who is rejected during the algorithm by a woman w who is possible for him, (i.e. there exist a stable matching M, where m, w M). At that moment, when m is rejected by w, w must have a preferred partner,{ } say ∈ m′. Obviously, m′ must be matched with a better partner than w in M, say w′, since otherwise m′,w would block M. But, { } in this case, m′ must have been rejected by w′ (a possible partner of m′) in a previous case, a contradiction.

Theorem 2.1.2 (Gale–Shapley). The stable matching obtained by the deferred - acceptance algorithm is man-optimal.

Below we list some well-known results on stable marriages. All of them can be found in both the book of Gusfield and Irving [52] and also in the book of Roth and Sotomayor [92].

Let M and M ′ be two stable matchings for the same stable matching problem. If ′ ′ e M M , then there must exist another edge f M M such that e

2.1.3 The stable roommates problem The stable matching problem for nonbipartite simple graphs was called the stable room- mates problem by Gale and Shapley [48]. They showed the following example to prove that a stable matching may not exist. Example 2.1.8. Agents Preference-lists A : [B,C,D] B : [C, A, D] C : [A, B, D] D : arbitrary CHAPTER 2. STABLE MATCHING PROBLEMS 27

Let us imagine that these agents are tennis-players, each one is looking for a partner to play with for one hour a week. For example Andy would like to play mostly with Bill, then with Cliff and finally he prefers to play with Daniel the least. (In fact, everybody tries to avoid Daniel.) There is no stable solution. If a pair is formed from the first three players, say Andy plays with Bill, then the third one, Cliff must be matched with Daniel, but in this case Bill and Cliff block this matching.

The stable roommates problem had been a nontrivial open problem, until Irving [56] constructed the first polynomial time algorithm which determines whether a given instance of the stable roommates problem admits a stable matching, and if so, finds one [R2].

As we discussed in Section 1.3, for every matching game there exists a half-core, that corresponds to a stable half-matching for the stable roommates problem. So, if the agents can create half-time partnerships then a stable solution always exists in the sense that no pair of agents would simultaneously like to increase the intensity of their partnership. Considering the above example, we suppose that Andy, Bill and Cliff agree to meet once a week and play half-time games in each formation. Thus, each of them play one hour in sum, only Daniel remains without any tennis-partner. Stability in this case means that no pair of tennis-players wants to play more time together with each other. For example Andy plays with Daniel no time at all, because Andy fills his one-hour by playing two half-hour games with better partners. Andy and Bill will not play more than a half-hour, because Bill fills the rest of his time (a half-hour) by playing with a better partner, Cliff. Recall that half-matching hM consists of matching edges M and half-weighted edges H, so that hM = H M and each vertex is incident either with at most one matching ∪ edge or with at most two half-weighted edges. In a matching market an agent can have at most one partner or at most two half-partners. A half-matching hM is stable if for each edge e not in hM there exists a vertex v, where e is dominated either by one matching edge or by two half-weighted edges, and for every half-weighted edge h there exists a vertex v, where h is dominated by another half-weighted edge. So no pair of agents wants to improve their partnership simultaneously, because for each pair of agents who are not matched, one of them fills his capacities with better partnership(s). Otherwise, if a half-matching is unstable, then a blocking edge is an undominated edge. The fact, that every half-weighted edge must be dominated by another half-weighted edge at one of its endvertices implies that the half-weighted edges form cycles, where the direction of the domination between two consecutive half-weighted edges is the same along the cycle. To illustrate this property in the figures, we orient each half-weighted edge to its endvertex, where it is dominated by the other half-weighted edge. It is obvious that an even-cycle can be replaced by matched pairs, but Tan [104] observed that if an odd-cycle C occurs in hM then C must belong to the H-part of any stable CHAPTER 2. STABLE MATCHING PROBLEMS 28 half-matching for the given graph, so no stable matching exists. He characterized the stable half-matching (originally, called stable partition) in the following way: Theorem 2.1.9 (Tan). For any instance of the stable roommates problem there always exists a stable half-matching that consists of matched pairs and odd-cycles formed by half-weighted pairs. The set of agents can be partitioned into: a) unmatched (or single) agents, b) cycle-agents and c) matched agents. Furthermore, the same agents remain unmatched and the same odd-cycles are formed in each stable half-matching of the given instance of the problem. If for a half-matching hM = H M an edge e = u, v is in M, then we say that ∪ { } the agents u and v are partners. If two agents can be partners in a stable half-matching we call them stable partners. If an edge e = u, v H is in an odd-cycle, then u and v are half-partners. If u prefers v to his other{ half-partner,} ∈ then v is the successor of u and u is the predecessor of v.

2.2 The dynamics of stable matchings

For the bipartite case, Knuth [67] asked whether it is possible to obtain a stable match- ing by starting from an arbitrary matching and successively satisfying blocking pairs. Roth and Vande Vate [93] gave a positive answer by a decentralized algorithm, in which pairs or single agents enter the market in a random order, and stability is achieved by a proposal–rejection process. Knuth’s question for the bipartite case was also answered by Abeledo and Rothblum [4] by a common generalization of the Roth–Vande Vate and the Gale–Shapley algorithms. Later, Diamantoudi, Miyagawa and Xue [37] solved the same problem for the roommates case. They proved that one can always reach a stable matching, if one exists, from an arbitrary matching by successively satisfying blocking pairs. Recently, Inarra, Larrea and Molis [55] generalized this result for in- solvable stable roommates problems by proving the same statement for the so called, P -stable matchings instead of stable matchings. However, the original goal of Roth and Vande Vate was different, their algorithm can be used to model the dynamics of the two-sided matching market as well. In fact, they considered the situation when a new agent enters the market and the stability is restored by the natural proposal-rejection process. This mechanism also yields an algorithm to find a stable matching for a market by letting the agents enter the market in a random order. Independently, Tan and Hsueh [105] constructed an algorithm, that finds a stable half-matching for general graphs by using a similar incremental method. In the bipartite case, the Tan–Hsueh algorithm is equivalent to the Roth–Vande Vate CHAPTER 2. STABLE MATCHING PROBLEMS 29 algorithm. In the nonbipartite case infinite repetitions can occur, these are handled by the introduction of cycles. We shall call these two algorithms “incremental algorithms”. Blum, Roth and Rothblum [24] described the properties of a dynamic two-sided matching market. They showed that their proposed algorithm is similar to the McVitie– Wilson’s version [75] of the original deferred-acceptance algorithm. So, the output of the process is predictable: if some men enter the market then each man either remains matched with the same partner (if it is possible) or gets a worse (but his best) stable partner for the new market. Blum and Rothblum [25] pointed out that these results imply that the lastcoming agent gets his best stable partner in the Roth–Vande Vate algorithm. Moreover, an agent can only benefit from entering the market later (we assume here that the others enter the market in the same order). Independently, Ma [72] observed on an example of Knuth, that if agents enter the market successively then the Roth–Vande Vate algorithm may not find all stable matchings in general. Cechl´arov´a [30] strengthened Ma’s result by justifying that in a stable matching output by the incremental algorithm for a bipartite graph some agent gets his best stable partner. Here we give direct proofs for the above results in the bipartite case, and we generalize most of them to general graphs with the help of our Key Lemma. Gale and Sotomayor [49] showed that if some man expands his preference-list then no other man is better off in the new men-optimal stable matching. This implies that the same statement is true if a number of men enter the market. Roth and Sotomayor [92] proved that if a man arrives and becomes matched, then certain women will be better off, and some man will be worse off under any stable matching for the new market than at any stable matching for the original market. We generalize this theorem by using an improved version of a result of Pittel and Irving [80] on the core configuration. Our results also have an economic interpretation. Matching markets are well-known applications of the stable matching problem. A detailed description of two-sided mar- kets can be found in the book of Roth and Sotomayor [92]. An important example is job matching. Blum, Roth and Rothblum [24] studied the dynamics of the two-sided matching market in this context by analyzing the formation of “vacancy chains”. The dynamic formation of social and economic networks can be described by sta- ble matching models as Jackson and Watts considered in [61]. They illustrated the occurring mechanisms with the Roth–Vande Vate algorithm in the bipartite case. We believe that the same model can be used in the nonbipartite case, where the connec- tions between individuals might correspond to mutual “best friend” relationships. By similar reasons, Ericsson and Strimling used the same stable roommates model in [43] to analyse the mate searching processes for special preferences. Recently, the dynamics of firm mergers was also described as a one-sided stable matching market by Angelov [11]. CHAPTER 2. STABLE MATCHING PROBLEMS 30

2.2.1 The incremental algorithms Suppose a matching market is in an equilibrium with a stable matching. A natural question is how the situation changes if a new player enters the game and the prefer- ences over the former partnerships are unchanged. Let the newcomer make proposals according to his preference order. If no one accepts, then everybody has a better part- ner, so the former matching remains stable. If somebody accepts a proposal, then a new pair is formed along the proposal. The eventual left-alone partner has to leave the market and enter as a newcomer. Note that the same situation happens, when an agent leaves the market. If he was single, then the matching remains stable. Otherwise, if he was matched, then his partner has to leave the market and enter again as a newcomer.

The Roth–Vande Vate algorithm for the stable marriage problem Suppose, that in the algorithm a bipartite graph G is built up step by stepby adding vertices to the graph in some order. In a phase of the algorithm we add a new agent and restore stability. To describe a phase, let us add a vertex v to G v, where a stable − matching Mv exists. Our task is to find a stable matching M for G. If v is not incident to any blocking edge, then Mv remains stable for G, too. In this case we call the phase inactive. A phase is active if the newcomer v is a member of some blocking pair, let v,u { } be the best blocking pair for v. Let v = a0 and u = b1. If b1 was unmatched in

Mv = Ma0 , then Ma0 a , b is a stable matching for G. Otherwise, b had a partner ∪{ 0 1} 1 a1 in Ma0 , whom he leaves after receiving a better proposal. In this case, the matching

Ma1 = Ma0 a , b a , b is stable for G a . So we have a similar situation as \{ 1 1}∪{ 0 1} − 1 in the beginning: a1 enters the market and makes proposals. Continuing the process, a proposal-rejection sequence, S =(A B)= a0, b1, a1,... is constructed with the following properties: |

1. Ma = Ma −1 ak, bk ak , bk is a stable matching for G ak. k k \{ }∪{ −1 } − 2. ak−1 is a better partner for bk than ak and

3. bk+1 is a worse partner for ak than bk.

Note that here, a0, a1,... are from the same side, and b1, b2,... are from the other one. Property 2 is true, since bk accepted the proposal of ak−1 while he left ak. To see 3, realize that pairs (ak, bk) and (bk+1, ak+1) are in Mak−1 , so Property 2. and the assumption that ak prefers bk+1 to bk would imply that (ak, bk+1) is a blocking pair for

Mak−1 . A proposal-rejection process is illustrated in Figure 2.1. In this and subsequent figures, a little arrow is directed from a dominated edge to a dominating one and thick lines correspond to matching and half-weighted edges of the current (half-)matching. Observe that by this process, each ai A improves his situation and each bj B gets worse off. Consequently, the same agents∈ cannot occur as new pairs. So a phase∈ CHAPTER 2. STABLE MATCHING PROBLEMS 31

v = a0 a1 a2 ak−1 ak ak+1

Mak

u = b1 b2 bk bk+1

Figure 2.1: Proposal-rejection sequence in the Roth–Vande Vate algorithm. terminates in O(m) changes, when m denotes the number of the edges in the graph. A phase has two possible outcomes: either nobody accepts the proposals of some ai (then the size of the matching remains the same) or the last bj is unmatched, hence the size of the matching increases by one. We illustrate with an example the mechanism of the incremental algorithm and we introduce briefly our results. The preferences of the agents on their possible partnerships in this two-sided market are the following:

Example 2.2.1. a1 : [e1,d1, f1] b1 : [f3,d2, n1, e1] a2 : [e2,d2, f2] b2 : [f2,d1, e3] a3 : [e3,d3, f3] b3 : [f1,d3, e2] a4 : [s] b4 : [s, n2] a5 : [m1, m2] b5 : [m2, n3] a6 : [n1, n2, n3, n4] b6 : [n4, m1]

Let d = d1,d2,d3 , e = e1, e2, e3 , f = f1, f2, f3 . Suppose, that at the beginning a is not present{ in the} market.{ Partnerships} { e, s, m} form a stable matching in the 6 { 1} market. (It is the best one for every agent ai.) When agent a6 enters the market, four new possible partnerships are created. The best one for the newcomer is n1, and this blocks the actual matching. Following the algorithm of Roth and Vande Vate let us satisfy this blocking edge: b1 and a6 form a new pair, and partnership e1 terminates, so agent a1 has to find a new partner as a newcomer. Continuing this process, the following edges will be satisfied and terminated in sequence: d1, e3; d3, e2; d2, n1. Afterwards, agent a6 makes proposals again, that b1 and b4 refuse, because they prefer their partners to a6. We will prove later, that if a new partnership is not blocking, then it cannot be present in any stable matching. In the last step of our example, a single agent b accepts the proposal of a , and d,s,m , n 5 1 { 1 3} is a stable matching. This stable solution is the best possible for the newcomer a6, since CHAPTER 2. STABLE MATCHING PROBLEMS 32

b4 b2 a4 e3 a3 s e,s,m1

f2 d3 f3 n2

d2 b1 n1 n3 b5 a2  d, s, m1 a6 d1 e2 e1 n4 m2 f,s,m1 1 b3 f a1 1 b6 m a5

Figure 2.2: A stable matching and the lattice of the stable matchings for Example 2.2.1 before the arrival of a6. the better partnerships, that were refused by his possible partners cannot appear in any stable matching. This argument also shows that every agent that receives a partner by making a proposal during the process gets his best stable partner.

b4 b2 a4 e3 a3 s d, s, m1,n3

f2 d3 f3 n2

d2 b1 n1 n3 b5 a2 d, s, m2,n4 f,s,m1,n3 a6 d1 e2 e1 n4 m2 f,s,m2,n4 1 b3 f a1 1 b6 m a5

Figure 2.3: The obtained stable matching, and the lattice of the stable matchings for Example 2.2.1.

Note, that if we started with the stable matching f,s,m , then the process would { 1} stop in one step, since b5 accepts first the proposal of a6. The obtained stable matching f,s,m , n yields the best stable partner to the newcomer a again, but the other { 1 3} 6 agents ai do not necessarily get their best stable partners.

The Tan–Hsueh algorithm for the stable roommates problem Tan and Hsueh [105] proposed an incremental algorithm to find a stable half-matching. In this more general setting, we use the terminology of the Roth–Vande Vate algorithm. The only difference is that G is not bipartite, so instead of a matching, we maintain a half-matching hMv for G v. − Hereafter, we suppose that the stable half-matchings have no even-cycles. As we mentioned before, an even-cycle can always be separated into matching pairs, moreover, CHAPTER 2. STABLE MATCHING PROBLEMS 33 as we will see later, the incremental algorithm does not create even-cycles. By Theorem 2.2.15 we know that for a fixed stable roommates problem, the same odd-cycles are present in each stable half-matching hM i = H M i. So H is determined, only the M i parts can differ for two stable half-matchings∪ for a given graph. In fact, H can be considered as a disjoint union of half-weighted cycles, so whenever we modify a stable half-matching during the processes, we will only add or remove matching edges or half-weighted odd-cycles. If nobody accepts the newcomer’s proposal, then the phase is called inactive again and the current stable half-matching is unchanged. If some agent u accepts the proposal of v then three cases are possible: a) If u is unmatched in hMv, then hM = hMv v,u is a stable half-matching for G. ∪{ } b) If u is a cycle-vertex in hMv, so u = c0 for some cycle C = (c0,c1,...,c2k−1,c2k), then hM = hMv C v,u c1,c2 ,..., c2k−1,c2k is a stable half-matching for G (i.e. we remove\ ∪{ the half-weighted}∪{ }∪ cycle ∪{C and we add} some matching edges). c) If u is matched with x in hMv, then hMx = hMv u, x v,u is a stable half-matching for G x. \ { }∪{ } − The current phase ends in cases a) and b). Here, unlike in the bipartite case, it can happen that an agent, who made a proposal earlier can receive a proposal later during the same phase. So the proposal-rejection sequence might never end. One result of Tan and Hsueh [105] is that a repetition always occurs along an odd-cycle.

Theorem 2.2.2 (Tan–Hsueh). If S = (A B) = a , b , a ,... is a proposal-rejection | 0 1 1 sequence and ai = bk (i

The example in Figures 2.4 and 2.5 illustrate the Tan–Hsueh algorithm: Here, vertex v enters. The first vertex accepting v’s proposal is u, and u’s previous partner x is left alone. Figure 2.4 shows the stable half-matching hMx for G x. In the next step, x makes proposals. Figure 2.5 illustrates the termination of this− phase by obtaining an odd cycle, namely the three-cycle containing vertex x and edges c1 and c2.

2.2.2 Getting the best stable partner by making proposals

Lemma 2.2.3 (Key Lemma). If hMv is a stable half-matching for G v, and edge − v,u is not blocking hMv, then v and u cannot be matched in a stable half-matching for{ G}. CHAPTER 2. STABLE MATCHING PROBLEMS 34

b a v c1 x c 2 u

Figure 2.4: The Tan–Hsueh algorithm in an example.

b a x v c1 c 2 u

Figure 2.5: The obtained stable half-matching.

Proof. Let us suppose that v,u is not blocking hMv but there is a stable half- { } matching hM of G, where v and u are matched. Let v = a0 and u = b1. First we consider the case where none of hM and hMv contains an odd-cycle. Then b1 has a partner in

Mv (say a ), who is better than a . So a , b

v = a0 a1 a2

hMv

hM

u = b1 b2

Figure 2.6: Alternating preference sequence with half-weighted edges.

As the number of agents is finite, the alternating preference sequence must return. Consider the first such repetition. If ak = ai for some k = i then bk, ai and bi, ai 6 { } { } would be in the same odd-cycle in hMv, but ai would be the predecessor of both bi and bk by the inductive definition of the sequence, a contradiction. In the other case, assume that ak = bi for some k = i. This means that bk, bi and bi, ai are in the same odd- 6 { } { } cycle in hMv. By definition, ai is the predecessor of bi, so bk should be the successor of bi, that would imply ai, bi

Theorem 2.2.9. Suppose that w and u are matched in a stable half-matching hMv for G v. They remain matched in the stable half-matching hM, obtained by the proposal- rejection− process after the arrival of v if and only if they are stable partners for G as well. Otherwise, if they are not involved in a cycle, then one of them gets a better partner than he had in hMv but receives his worst stable partner, the other one becomes single or gets a worse partner than he had in hMv but receives his best stable partner in hM . Proof. If w and u are not involved in the proposal-rejection process, then they remain matched. Otherwise, if S =(A B) is the proposal-rejection sequence, then one of them, | say w is in A and u must be in B. As they are not involved in a cycle, u improves his situation and w gets worse off during the process, and finally (by Theorem 2.2.6) u gets his worst stable partner (better than w) and w gets his best stable partner (worse than u), so u and w cannot be stable partners in the output.

2.2.3 Improving the situation by accepting proposals Our next goal is to generalize Theorem 2.26. of Roth and Sotomayor in [92]. First we give its proof implied by the results presented above. Theorem 2.2.10 (Roth–Sotomayor). Suppose a woman w is added to the market G w. Let M W be the woman-optimal stable matching for the new market, G and let M−M be the man-optimal stable matching for G w. If w is not single in M W , then w − there exists a nonempty subset of men, S, such that each man in S is better off, and each woman in S′ is worse off under any stable matching for the new market than at any stable matching for the original market, when S′ denotes the partners of men in S M under matching Mw . Proof. After adding w to the market during the proposal-rejection process starting M from Mw each man who gets a partner by accepting a proposal gets his worst possible partner at the end of the process by Theorem 2.2.4. So these men get the same partners as in M W . But their new partners are strictly better than their original partners in M Mw , who were actually their best stable partners for G w. Similarly, each woman who gets a new partner during the process by making a proposal− gets her best stable partner for G, so these women get the same partners as in M W . But their new partners M are strictly worse than their original partners in Mw , that were actually their worse stable partners for G w. − Pittel and Irving [80] considered the following situation. A new agent v enters the market, and a perfect stable matching (i.e. a stable matching where no agent is single) is achieved in such a way that the proposal-rejection sequence is as short as possi- ble. They called this special half-matching with the associated alternating sequence a core configuration relative to v. Pittel and Irving [80] proved the following interesting property. CHAPTER 2. STABLE MATCHING PROBLEMS 38

Theorem 2.2.11 (Irving–Pittel). If hMv is a core configuration relative to v, then the associated proposal-rejection sequence v = a0, b1, a1,...,ak−1, bk consists of 2k distinct persons, it is uniquely defined, and for every i =1 ...k 1 − 1. bi is the worst stable partner of ai for G v; −

2. ai is the best stable partner of bi for G v. − We generalize Theorem 2.2.11 by extending the notion of core configuration. A stable half-matching hMv is a core configuration relative to v if after adding v to the graph, the associated proposal-rejection sequence S(hMv) is as short as possible, by assuming that in case of cycling the sequence is restricted till bk, where ai = bk is the first return.

Theorem 2.2.12. If hMv is a core configuration relative to v, then the associated proposal-rejection sequence a0(= v), b1, a1,...,ak−1, bk(, ak) consists of distinct persons, it is uniquely defined. For every agent in the sequence, who is matched for G, the following properties are true: a) bi is the worst stable partner of ai for G v and bi+1 is the best stable partner of ai for G; − b) ai is the best stable partner of bi for G v and ai is the worst stable partner of bi − −1 for G. Proof. We shall construct a core configuration. Suppose that hM 0 is an arbitrary stable half-matching for G. Let a new agent u enter the market in such a way that u is acceptable only for v and u is the most preferred partner for v. Let us denote the proposal-rejection sequence by S(hM 0) and the output stable half-matching for G + u 0 ′ by hM+u. Obviously, u and v are partners in any stable half-matching hM+u for G + u, ′ ′ ′ moreover, hM+u is a stable half-matching for G + u if and only if hMv = hM+u u, v is a stable half-matching for G v. So, by deleting u, v from hM 0 we get a\{ stable} − { } +u half-matching, say hMv for G v. We prove that hMv is a core configuration relative − to v. (We denote the associated proposal-rejection sequence by S(hMv) and the output stable half-matching for G by hM.) To prove that S(hMv) is as short as possible, we show that each agent that is involved in S(hMv) must be involved in any other proposal-rejection sequence as well, and each agent occurs exactly once in S(hMv) (unless a new odd-cycle is created, when ai = bk occurs twice.) ′ First, we prove that if x S(hMv) then x S(hMv) for any stable half-matching ′ ∈ ∈ hMv for G v. We consider the cases according to the status of x (unmatched, cycle- agent or matched)− in the stable half-matchings for G v and G. − 1-2. No agent can be unmatched for G v and a cycle-agent for G at the same time, similarly, no agent can be a cycle-agent− for G v and unmatched for G. 3-4. If an agent is unmatched/cycle-agent for G− v and remains unmatched/cycle-agent − CHAPTER 2. STABLE MATCHING PROBLEMS 39 for G then he cannot be involved in any proposal-rejection sequence. 5. If x is matched for G v and becomes unmatched for G then x = ak, so x is the − last agent in S(hMv) (nobody accepts his proposal) and obviously x must be the last ′ agent in any other S(hMv) as well. 6. If x is unmatched for G v and becomes matched for G then x = bk, so x is the − last agent in S(hMv) (he accepts the last proposal) and obviously x must be the last ′ agent in any other S(hMv) as well. 7. If x is a cycle-agent for G v and becomes matched for G then x = bk, so x is − the last agent in S(hMv) (he accepts the last proposal). We prove that for any stable ′ ′ half-matching hMv, x is the last agent in S(hMv) as well. Let C = (c0,c1,...c2k) be the cycle that is eliminated when v enters the market. We suppose indirectly that two ′ different cycle-agents x = c0 and ci accept the last proposals, made by y and y in ′ S(hMv) and S(hMv) respectively. Obviously, the agent who made the final proposal is better than the predecessor of the cycle-agent who accepts it, (so y >c0 c2k and ′ y >ci ci−1). From Theorem 2.2.4, we also know that c0 and ci get their worst stable partners in hM and hM ′ respectively. This is a contradiction, because if i is even then ci would be matched with ci−1 in hM and if i is odd then c0 would be matched with ′ c2k in hM . 8. If x is matched for G v and became a cycle-agent for G then x must occur in any − proposal-rejection sequence until the first return, since Tan and Hsueh [105] proved that no new agent occurs in the sequence after the first return. 9. Finally, we consider the case where x is matched for G v and for G as well. Let us 0 0 − denote x’s partners by y , yv and y in hM , hMv and hM, respectively. a) If y x yv, then x must receive y during S(hMv) by accepting a proposal, so by Theorem 2.2.4, y is the worst stable partner of x for G. Thus, y0 y implies 0 0 ≥ y >x yv, it means that x must receive yv during S(hM ) by making a proposal, so yv is the best stable partner of x for G v. It follows that x gets a better partner − under any stable half-matching for G than at any stable half-matching for G v, so x must be involved in any proposal-rejection sequence. − c) If y = yv, then x cannot be involved in S(hMv).

Now, we prove that each agent occurs exactly once in S(hMv). Let us consider the above sequence with an extra stopping rule: if aj looks for a new partner let us choose the best one among those who either form a blocking pair with aj or some bi with i < j CHAPTER 2. STABLE MATCHING PROBLEMS 40

such that bi prefers aj to ai (and not to his actual partner ai−1). Assume that the first repetition (according to the extra stopping rule) would occur at bj+1.

Case 1. If bi = bj+1 for some i < j then let hMaj be the actual stable half-matching ′ for G aj. We construct a new stable partition for G v: hM = hMa aj, bi − − v j ∪{ }\ ap , bp , 1 p i ap, bp , 1 p i 1 . It is stable, because by comparing {{ −1 } ≤ ≤ }∪{{ } ≤ ≤ − } with hMv only agents aq, i q j get worse partners, but the extra stopping rule { ≤ ≤ } ′ preserves that no edge aq, bp , 1 p < i q j can block hMv (and obviously no other edge). {{ } ≤ ≤ ≤ } ′ In hM every agent bq, i q j gets a better partner than in hMv, and every v { ≤ ≤ } agent aq, i q j gets a worse partner than in hMv. If some of these agents is { ≤ ≤ } matched for G v and G as well, then it is a contradiction, because in hMv they are matched with their− best/worst stable partners, respectively. The last case is that all of these agents are matched for G v and become a cycle- − 0 agent for G. These agents are in the same cycle (say (c0,c1,...,c2k)) in hM as well. 0 So, when S(hM ) ends at c0 by eliminating this cycle, each of these agents becomes matched in hMv to either with his successor or with his predecessor (so c i ,c i { 2 −1 2 } ∈ hMv for all 1 i k). We show that ai must also be a cycle-agent for G. Otherwise ≤ ≤ −1 ai−1 must receive a worse partner than bi in hM, and for bi his predecessor is also worse than ai−1 (that is why bi accepted the proposal of ai−1). So ai−1 and bi would block hM. By continuing this argument, for some p < i, ap must be c0, (the cycle- 0 agent in hMv that accepted the last proposal in S(hM )). But then bp+1 must be the predecessor of c : c k. Otherwise, if for some 1 r < 2k, cr = bp then c k

Theorem 2.2.12 implies the following generalization of Theorem 2.2.10.

Theorem 2.2.13. Suppose that a new agent is added to the market. There may exist some agents that are better off, and some other agents that are worse off under any stable half-matching for the new market than at any stable half-matching for the original market. We can efficiently find all of these agents. 2 CHAPTER 2. STABLE MATCHING PROBLEMS 41

The arrival order determines the benefits If we suppose that a centralized matching program uses the incremental algorithm, or if we model the dynamics of the matching market by the natural proposal-rejection process, then the obtained solutions are determined by the arrival order of the agents. We discuss here, as a consequence of the theorems from the last subsections, how the benefits of agents depend on the arrival orders. Blum and Rothblum [25] realized that an agent can only benefit by arriving later to the market in the Roth-Vande Vate algorithm. By a similar argument, we can generalize this result for the nonbipartite case.

Lemma 2.2.14. Assume that u is a matched agent for both G v and G, and let hMv ′ − and hMv be two half-matchings for G v such that u gets at least as good partner in ′ − ′ ′ hMv as in hMv (denoted by hMv u hMv). Let hM and hM be the outputs received by the proposal-rejection process after≥ the arrival of v, respectively. Then u gets an at ′ ′ least as good partner in hM as in hM (so hM u hM ). ≥ ′ Proof. Indirectly, assume that u gets a better partner in hM than in hM, so hM u hM or hMv

Let us define two relations, B∗ and W ∗ between the agents in the following way: we ∗ denote by uB v if agent v occurs as an agent that makes a proposal in S(hMu) (the proposal-rejection sequence according to the core configuration relative to u). As an easy consequence of Theorem 2.2.12, uB∗v implies that v gets his best stable partner if u enters the market last, moreover the same theorem says, that v gets an even better partner if u does not enter the market at all. So v can only benefit if u is out of the market, or u arrives as late as possible. That is why we may regard u as a nightmare- agent of v. Similarly, we denote by uW ∗v if agent v occurs as an agent that receives a proposal ∗ in S(hMu). Here, uW v implies that v gets his worst stable partner if u enters the market last, but v gets an even worse partner if u is not present in the market. So v can only benefit if u is in the market, and he arrives as soon as possible. We call u as a dream-agent of v in this case. Obviously, neither B∗ nor W ∗ is symmetric. Moreover, the following Lemma proves, that uB∗v implies that vB∗u cannot be true, so the relation B∗ is antisymmetric.

∗ Lemma 2.2.17. If uB v, then S(hMv) is the restriction of S(hMu). Proof. Directly follows from Theorem 2.2.12. Corollary 2.2.18. The relation B∗ is transitive, so uB∗v and vB∗w imply uB∗w. Moreover, uB∗v and vW ∗w imply uW ∗w. To show, that the relation B∗ is not a linear order, one can easily find an example, where uB∗w and vB∗w, but there is no B∗ relation between u and v. We believe that there should be some further relevant questions to consider about these relations.

2.2.4 The increasing side gets worse off Finally, we give alternative proofs for certain results for two-sided matching markets. Lemma 2.2.19 is a straightforward consequence of Theorem 2 in [49]. Lemma 2.2.19. If a man enters the market then no man can have a better partner in the new men-optimal stable matching than in the former men-optimal stable matching. Proof. Let m be the man that enters the market last. We shall prove that if a man m′ gets w′ in the men-optimal stable matching M M , then m′ cannot have a worse partner in the men-optimal stable matching M M for G m. If m is unmatched in m − M M , then M M is also stable for G m. If m, w M M , then M M m, w is stable for G m, w . After w reenters− the market,{ during} ∈ the proposal-rejection\{ } process m′ either−{ remains} matched with w′ or receives a proposal from a better woman for him. Theorem 2.2.20. If some men enter the market one after another then at the end of the proposal-rejection process they all get their best stable partners in the output stable matching. CHAPTER 2. STABLE MATCHING PROBLEMS 43

Proof. Suppose that a man m′ is matched with his best stable partner w′ before a new man, m enters. If m′ remains matched with w′ in the new obtained matching, then by Lemma 2.2.19, w′ is still his best stable partner. If m′ gets a new partner during the phase, then he must receive her by making a proposal, so Theorem 2.2.6 proves that m′ gets his best stable partner again. The following theorem of Blum, Roth and Rothblum [24] can be proved the same way by using Theorem 2.2.9.

Theorem 2.2.21. If some men enter the market then any other man m either remains matched with his original partner w if w is still a stable partner for m or m receives his best stable partner in the output. 2

If the arrival order is such that women enter the market first and men follow after that, then the output will be the same as the output of the deferred-acceptance algo- rithm with men proposing by Gale and Shapley [48]. Theorem 2.2.20 is an alternative proof for the statement that the obtained stable matching is optimal for the men.

2.3 Stable matching with ties, complexity results

In this section, we collect some results on the stable matching problem with ties. First, we study the problem of finding a stable matching according the three main stability concepts. Then, we consider the problem of finding a matching for which the number of blocking pairs is minimal.

We recall, the three main stability concepts for the stable matching problem with ties.

A matching M is weakly stable if there exist no blocking edge e = ai, aj where • { } both agents strictly prefer the other to his partner in M.

A matching is strongly stable if there exist no blocking edge e = ai, aj such • { } that one of the agents, say ai strictly prefers aj to his partner in M and aj either strictly prefers ai to his partner in M or is indifferent between them.

A matching M is super stable if there exist no blocking edge e = ai, aj where • { } both agents either strictly prefers the other to his partner in M or are indifferent between them.

We note that weak stability is regarded as stability in general. If for a given instance I of the stable matching problem with ties, we break the ties, then the obtained instance I′ of stable matching problem is called the derived problem. Obviously, a matching that is stable for some derived problem is also stable for the original one. CHAPTER 2. STABLE MATCHING PROBLEMS 44

While, the above definitions are also correct in case the graph has parallel edges, here we restrict our attention to simple graphs, and call the nonbipartite case as stable roommates problem with ties, and the bipartite case as stable marriage problem with ties.

2.3.1 Finding a stable matching Considering the stable roommates problem with ties, the problem of finding a weakly stable matching, denoted by weakly srt, is NP-complete. This was proved first by Ronn [82] for complete graphs. Later, Irving and Manlove [59] verified the same result by a different proof for the more general case, when the lists can be incomplete. More- over, this result holds even if each tie is of length 2, i.e. there is at most one tie per list, and the vertices that have a tie in their list are not connected.

Theorem 2.3.1 (Ronn; Irving-Manlove). The problem of finding a weakly stable matching in an instance of the stable roommates problem is NP-complete [R3].

On the other hand, Irving [57] constructed two polynomial algorithms which determine whether a given instance of the stable marriage problem with ties admits a strongly, super- stable matching, and if so find one. He proved these results for complete{ graphs, later} Manlove [73] verified similar results for incomplete lists as well. The same questions are tractable also for stable roommates problems with ties. This was verified by Irving and Manlove [59] in case of super-stability and by Scott [99] in case of strong-stability.

For a stable matching problem it is a natural question to find such a stable match- ing that has maximal cardinality. If the preferences are strict then this problem is not interesting, since every stable matching has the same size by Theorem 2.2.15. Consid- ering weak stability in case of ties Manlove et al. [74] proved the following theorem for bipartite graphs.

Theorem 2.3.2 (Manlove et al., 2002). The decision problem related to finding the maximum size of weakly stable matchings for a given instance of the stable marriage problem with ties, denoted by max weakly smt, is NP-complete, even if ties occur only in one side of the bipartite graph. [R4].

The problems of finding a maximum size strongly and super-stable matchings are solvable: Manlove [73] proved that for a given instance of the stable marriage problem, the same agents are matched in each strongly stable matching, and similarly, the same agents are matched in each super stable-matching. Similar results were proved in the roommates case by Irving and Manlove [59] for super-stable matchings and by Scott [99] for strongly stable matchings. CHAPTER 2. STABLE MATCHING PROBLEMS 45

2.3.2 “Almost stable” matchings Here we present some results of Abraham, Bir´oand Manlove, published in [5]. For a stable roommates problem, where no stable matching exists, it is a natural question to find a matching that admits the fewest number of blocking pairs: it can be regarded as a matching that is “as stable as possible”.

Let us show first an example that is used as a gadget in the proofs of the presented theorems.

Example 2.3.3. We have given 2k +2 agents: b1, b2,...,b2k+1 = B and a. The preference of the agents are the following: { }

a b1 b2k+1 b2 a : [b1, arbitrary ] b1 : [a, b2, b3,...,b2k, b2k+1] b2 : [b3, b4,...,b2k+1, b1, a] ...... bi bi : [bi+1, bi+2,...,b2k+1, b1,...,bi−1, a] ...... b2k+1 : [b1, b2,...,b2k, a]

This graph can be considered as a “bomb”, where edge a, b is called { 1} priming. One can easily check that if a, b1 is part of a matching M, then M can be stable if the remaining{ agents} are matched as follows: b2, bk+2 , b3, bk+3 ,..., bi, bk+i . . . bk+1, b2k+1 M. On the other hand, if {a, b /}M{, then the} number{ of} blocking{ pairs is} at ∈ least k, so the bomb is exploding. { 1} ∈ To prove this, let bi be an agent, who has no partner from B in M. If bj, bk M, { } ∈ then obviously either bi, bj or bi, bk is a blocking pair. If another agent bl has no { } { } partner from B either, then the pair bi, bl is blocking, so bi must belong to at least { } k blocking pairs.

Define min-mm (respectively exact-mm) to be the problem of deciding, given a graph G and integer K, whether G admits a maximal matching of size at most (re- spectively exactly) K. Both problems are NP-complete even for cubic graph. This was proved in [53] for min-mm and in [5] for exact-mm.

Theorem 2.3.4. The problem of finding a matching in a given an instance of stable roommates problem for which the number of blocking edges is minimal is not approx- 1 imable within n 2 −ε, for any ε> 0, unless P = NP . The result holds even for complete preference lists. [R5] CHAPTER 2. STABLE MATCHING PROBLEMS 46

Sketch of the proof. The proof is based on a gap-introducing reduction starting from exact-mm for a cubic graph G of size p with a positive integer K. We create an instance I of the stable roommates problem of size n, where n>>p and p is fixed, so p can be considered as a constant relative to n. The instance I contains Θ(√n) bombs of size Θ(√n). The construction of I ensures that on the one hand, if every priming is part of a matching M ′ in I, so no bomb is exploded, then the minimum number of blocking pairs is bounded by a constant relative to n. On the other hand, if any of the priming is not part of M ′, so some bomb is exploded, then the minimum number of blocking pairs is at least Θ(√n). In the proof it is verified that G has a maximal matching M of size K if and only if no bomb is exploded in I. Thus, an algorithm that could approximate the minimum number of blocking pairs in polynomial time within a factor less than Θ(√n) would be able to decide exact-mm for cubic graphs as well.

Theorem 2.3.5. The problem of finding a matching in a given an instance of stable roommates problem with ties for which the number of blocking edges is minimal is not approximable within n1−ε, for any ε > 0, unless P = NP . The result holds even for complete preference lists. [R6]

Sketch of the proof. The idea is similar to the above proof. The only difference here is that I contains a constant number of bombs of size Θ(n). By this it follows that the existence of an approximation algorithm with a factor less than Θ(n) would imply P = NP .

We note finally, that for bipartite graphs similar inapproximability results were proved recently by Manlove (personal communication), in case the matching is restricted to be a complete matching. [R7]

In the following table we collect the above results. Here, P denotes that the problem is polynomial time solvable, NPc denotes that the (related) problem is NP-complete, (NPh) denotes that the NP-hardness of the problem is obvious from the presented results.

The problem is to where bipartite graph arbitrary graph find a matching M, M (strict) with ties (strict) with ties s.t. M (arb.) Yes [R1] (Yes) P [R2] NPc [R3] is stable max (P) NPc [R4] (P) (NPh) s.t. M has min (arb.) (=0) (=0) NPc [R5] NPc [R6] no. of blocking pairs max NPc [R7] (NPh) (NPh) (NPh) Chapter 3

Stable allocation problems

Introduction

In this chapter we study stable matching problems with vertex-bounds and edge- capacities. To introduce these notions, we recall Scarf’s lemma. Then we show that if all the bounds and capacities are integers, then the so-called integral stable alloca- tion problem for graphs can be reduced to the stable roommates problem by a sequence of constructions. We describe a strongly polynomial algorithm created by Ba¨ıou and Balinski for two-sided matching markets, and we study its generalization in the one- sided case. Finally, as a practical application of stable b-matchings, we describe the higher education admission program in Hungary on the basis of paper [18].

3.1 Stable allocation problem by Scarf’s lemma

3.1.1 Fractional b-core element In what follows, we introduce the notion of fractional b-core element as a solution of Scarf’s lemma with the original settings. Let the same matrices A and C of dimension n (n + m) correspond to the set of effective utility vectors (or activities) in a given × finitely generated NTU-game as it was described in Section 1.1.3. The only modification Rn N Rn+m is that now b is an arbitrary vector of + (instead of 1 ). Let x + be referred as a fractional b-core element if x is a solution of Scarf-lemma for the∈ above setting. Here, b(i) is an upper bound for the total intensity of which player i is capable to S,l perform activities, since i∈S x(u ) = b(i). The domination condition of the lemma says that for every activityP a there exists some player i, who is not interested in increasing the intensity of a, because his remaining intensity b(i) is filled with better T,l S,l activities, so if u corresponds to activity a, then S,k T,l x(u )= b(i). ui ≥ui P In fact, to produce a fractional core element (in other words, a fractional 1N -core element) by the algorithm of Scarf, we should perturbate not just matrix C (in case of

47 CHAPTER 3. STABLE ALLOCATION PROBLEMS 48 indifferences at the beginning), but also the vector 1N , to avoid the degeneracy. The standard nondegeneracy assumption provides that all variables associated with the n columns of a feasible basis for the equations Ax˜ = ˜b = 1N + εN are strictly positive. Thus, the perturbation uniquely determines the steps of Scarf algorithm. By rounding the final fractional ˜b-core elementx ˜, a fractional core element x is found.

The following simple Lemma says that the fractional b-core element has the scaling property. Lemma 3.1.1. Given a finitely generated NTU-game, and a positive constant λ. Sup- pose that b′ = λ b, then x is a fractional b-core element if and only if x′ = λ x is a fractional b′-core· element. · An easy consequence is that by Theorem 1.3.5, for every finitely generated matching game, there always exists an integer 2N -core element. That is actually a half-core element for the original setting.

3.1.2 Fractional b-core element with capacities: stable alloca- tion Assume now, that the intensities of the activities in the finitely generated NTU-game are bounded by capacities. Formally, for each common activity a and for the corre- sponding utility vector uS,l, there may exist a nonnegative capacity c(uS,l) for which x(uS,l) c(uS,l) is required. ≤ The stable allocation problem can be defined for hypergraphs as follow. A hyper- graph H is given and for each vertex v a strict preference order over the edges incident with v (this corresponds again to the preferences of the players over the activities, in which they can be involved). Suppose, that nonnegative bounds on the vertices b : V (H) R , and nonnegative capacities on the edges c : E(H) R are fixed. A → + → + nonnegative function x on the edges, is an allocation if x(e) c(e) for every edge e and x(h) b(v) for every vertex v. An allocation is stable≤ if every unsaturated v∈h ≤ edgePe (i.e. x(e) < c(e)) contains a vertex v such that v∈h,e≤vh x(h) = b(v). In this case we say that e is dominated at v. P

The stable allocation problem was introduced by Ba¨ıou and Balinski [14] for bipar- tite graphs. The integer version, (i.e. if the allocation x is required to be integer on every edge for integer bounds and capacities) was called the stable schedule problem by Alkan and Gale [10], however they considered a more general model, the case of so-called substitutable preferences. Here, instead of stable schedule problem, we call the integral version of the stable allocation problem simply as the integral stable allocation problem.

The following theorem was presented in [17] as a joint result with Tam´as Fleiner. CHAPTER 3. STABLE ALLOCATION PROBLEMS 49

Theorem 3.1.2. Every stable allocation problem for hypergraphs is solvable.

Proof. Let V (H) = v , v ,...,vn be the set of vertices, and let E(H) = { 1 2 } e1, e2,...,em be the set of edges in a given hypergraph H. We define the extended {membership-matrix} A, and the extended preference-matrix C of size (n+m) (n+2m) as follows. × The left part of A is an identity matrix of size (n + m) (n + m), (i.e. ai,j = δi,j for i, j [n + m]). At the bottom of the right side there is another× identity matrix of size ∈ m m, so an i,n m j = δi,j for i, j [m]. Finally, at the top of the right side we have × + + + ∈ the vertex-edge incidence matrix of H (i.e. ai,n+m+j =1 if vi ej and 0 otherwise for i [n] and j [m]). ∈ ∈ ∈ The top-right part of C correspond to the preference of the vertices (that is the preference of the players over the activities). We require the following two conditions:

ci,n m j

ci,n m j

Furthermore, suppose that cn i,n m i < cn i,n m j for every i = j [m] in the + + + + + + 6 ∈ bottom-right part of C. Finally, let the left part of C be such that it satisfies the conditions of Scarf’s lemma. Finally, the constant vector, b Rn+m is given by the bounds and capacities, let ∈ + bi = b(vi) for i [n] and bn j = c(ej) for j [m]. ∈ + ∈ We shall prove that the fractional core element x, obtained by Scarf’s lemma, e e gives a stable allocation, x by simply taking the last m coordinates of x. Here, xj is e equal to x (ej) that is the weight of the edge ej (or equivalently, this is the intensity, the corresponding activity is performed with). Ifx ¯v andx ¯e are the vectors obtained by taking the [1,...,n] and [n +1,...,n + m] coordinates of x, then these vectors correspond the remaining weights of the vertices and edges (or the remaining intensities of the players and the activities), respectively. Obviously, xe is an allocation by Ax = b, since the first n equations preserve the xe(h) b(v) condition for every vertex v, and the last m equations preserve v∈h ≤ xPe(e) c(e) for every edge e. ≤ To prove stability, let us consider an unsaturated edge ej and let us suppose that the corresponding row by the lemma is k. First we show, that i [n]. From Ax = b, e e e ∈ e obviouslyx ¯ (ek)+x (ek)= c(ek) for every edge ek. Since x (ej) 0, thus the assumptions on C imply that i = n + j, for other i [n + m] [n] the 6 ∈ v \ contradiction is trivial. If i [n], then e is dominated at vi, sincex ¯ (vi) = 0 by the assumptions on C, and the ∈Ax = b condition for the i-th row with the statement of e the lemma imply x (h)= b(vi). vi∈h,ej≤vi h P The following theorem is an easy consequence of Theorem 3.1.2. In the next sub- section we give other evidences that verify this theorem. CHAPTER 3. STABLE ALLOCATION PROBLEMS 50

Theorem 3.1.3. For every integral stable allocation problem in a graph there exists a half-integer stable allocation. If the graph is bipartite, then every integral stable alloca- tion problem is solvable.

Proof. Suppose that we have a stable allocation x that has some weights that are not half-integers. We create another stable allocation x′ with half-integer weights. If x(e) is not integer, then let v be the vertex, where e is dominated. Since b(v) is integer, there must be another edge f, that is incident with v and has non-integer weight. Moreover, f cannot be dominated at v. By this argument, it can be verified that the edges with non-integer weights form vertex-disjoint cycles, and in a such cycle, the fractional parts 1 of the weights are ε and 1 ε alternately. If a cycle is odd, then ε must be 2 . If a cycle is even, then ε can be modified− to be 0 (or 1), the obtained allocation x′ remains stable and has half-integer weights. If the graph is bipartite, thus has no odd cycle, then x′ has only integer weights, so it is a integral stable allocation . We note that the scaling property holds also for the stable allocation problem. By this, if every bound and capacity is even, then the existence of an integral stable allocation is straightforward by Theorem 3.1.3.

In the next example, we illustrate a integral stable allocation problem in a graph for which a half-integer stable allocation is obtained by the algorithm of Scarf.

Example 3.1.4. Here, 6 agents and 7 possible pairwise activities are given. The bounds of the agents are: b(a1)=4, b(a2)=1, b(a3)=1, b(a4)=2, b(a5)=2 and b(a )=4. The capacities of the possible activities are: c( a , a )=1, c( a , a )=2, 6 { 1 2} { 1 3} c( a1, a5 )=2, c( a1, a6 )=3, c( a2, a5 )=1, c( a3, a6 )=2 and c( a4, a6 )=1. The{ preference-lists} { of the} agents are{ the following:} { } { }

4 4 2 3 2 a1 : [a6, a3, a2, a5] a6 a1 a5 a2 : [a5, a1] 1 2 1 2 1 a3 : [a6, a1] a4 : [a6] a4 a3 a2 a5 : [a1, a2] 2 1 1 a6 : [a4, a3, a1]

The extended membership-matrix A is the following: CHAPTER 3. STABLE ALLOCATION PROBLEMS 51

100000 0000000 1111000  010000 0000000 1000100   001000 0000000 0100010     000100 0000000 0000001       000010 0000000 0010100     000001 0000000 0001011        A =  −−−−−− −−−−−−− −−−−−−−   000000 1000000 1000000       000000 0100000 0100000     000000 0010000 0010000       000000 0001000 0001000     000000 0000100 0000100       000000 0000010 0000010     000000 0000001 0000001    The matrix C that represents the preference of the players can be generated as follows:

0 24 23 22 21 20 19 18 17 16 15 14 13 3 4 25876  25 0 23 22 21 20 19 18 17 16 15 14 13 4 1110 9 5 7 6   25 24 0 22 21 20 19 18 17 16 15 14 13 12 4 10 9 8 5 6     25 24 23 0 21 20 19 18 17 16 15 14 13 12 11 10 9 8 7 5       25 24 23 22 0 20 19 18 17 16 15 14 13 1211 5 9 4 7 6     25 24 23 22 21 0 19 18 17 16 15 14 13 12 11 10 3 8 4 5        C =  −−−−−− −−−−−−− − − −−−−−   25 24 23 22 21 20 0 18 17 16 15 14 13 1 1110 9 8 7 6       25 24 23 22 21 20 19 0 17 16 15 14 13 12 1 10 9 8 7 6     25 24 23 22 21 20 19 18 0 16 15 14 13 1211 1 9 8 7 6       25 24 23 22 21 20 19 18 17 0 15 14 13 12 11 10 1 8 7 6     25 24 23 22 21 20 19 18 17 16 0 14 13 12 11 10 9 1 7 6       25 24 23 22 21 20 19 18 17 16 15 0 13 12 11 10 9 8 1 6     25 24 23 22 21 20 19 18 17 16 15 14 0 12 11 10 9 8 7 1    In the algorithm, we used the following perturbation on b: we set ˜bi = bi + εi = bi +1/p101−i, where pi is the i-th prime number. By rounding the outputx ˜ of the Scarf algorithm, we get the following fractional b-core element x, and stable allocation xe: CHAPTER 3. STABLE ALLOCATION PROBLEMS 52

3 2 2 a6 a1 a5 v e e e 1 3 1 1 x = [¯x x¯ x ], where x = [ , 0, , 2, , 1, 1] 1 1 1 2 | | 2 2 2 2 1 1 1 a4 a3 a2 x¯v = [0, 0, 0, 1, 0, 0] andx ¯e = [ , 2, , 1, , 1, 0] 2 2 2

In the above figure, we oriented each unsaturated edge to its endvertex, where it is dominated.

3.2 Integral stable allocation problem for graphs

3.2.1 Special cases If, for a integral stable allocation problem c(e) = 1 for every edge e, then this special case is called a stable b-matching problem (see Fleiner [46]). If the graph may contain parallel edges, then this problem was referred to as a stable multiple activities problem by Cechl´arov´aand Fleiner [31]. In case of simple graphs, this problem was called a stable fixtures problem by Irving and Scott [60]. If b(v) = 1 for every vertex, then the stable matching problem is obtained, that is called stable roommates problem for simple graphs. Furthermore, if the given graph is simple and bipartite, then the stable b-matching problem can be called many-to-many stable matching problem. If b(v) = 1 for every vertex of one of the sides, then the problem can be referred to as many-to-one stable matching, college admission or hospitals/residents problem. Finally, if b(v) = 1 for every vertex, then we get the stable marriage problem.

3.2.2 Reduction by constructions Here, we present a result of Cechl´arov´aand Fleiner [31], and we extend it by one trivial primary step. This argument says that every integral stable allocation problem on a graph can be reduced graph constructions to a stable roommates problem. However, this reduction is not polynomial.

1st step: creating parallel edges in order to omit the capacities Given a integral stable allocation problem for a graph G0. We reduce the problem to a stable b-matching problem for a graph G1 as follows.

Let G1 has the same vertex-set as G0, with the same bounds, so V (G1) = V (G0), and if v′ corresponds to v, then b(v′)= b(v). If u, v = e E(G0) and c(e)= l, then { } ∈ CHAPTER 3. STABLE ALLOCATION PROBLEMS 53

′ ′ ′ 1 ′ ′ let e1, e2,...,el E(G ), where ei = u, v and c(ei) = 1 for every index i = 1,...l. ∈ { } 0 ′ ′ ′ 1 Preferences are the following: if ev ej whenever i < j. 0 1 G G ′ u → u ′ ′ e1 el e

′ c(e)= l c(ei)=1

v v′

Figure 3.1: Creating parallel edges

Suppose that x0 is a stable allocation for G0, we shall construct a stable b-matching 1 1 0 1 ′ 1 x for G . If x (e) = k, then let x (ei) = 1 for every i = 1,...,k. Obviously, x is a ′ 1 1 ′ b-matching. If an edge ei E(G ) is not in the b-matching, so if x (ei) = 0, and e is 0 ∈ 0 ′ 1 ′ ′ dominated at v in G , then x (h) = b(v) = b(v ) = ′ ′ x (h), so e v∈h,e≤vh v ∈h,ei≤v h i is dominated at v′. P P In the other direction, suppose that x1 is a stable b-matching for G1. Let x0(e) = l ′ 0 0 i=1 x(ei), x is obviously a integral stable allocation for G . 1 ′ 1 ′ ′ P We note, that here, x (ej) = 1 implies x (ei) = 1 for every i < j, since otherwise ei cannot be dominated. This observation yields to a one-to-one correspondence between the integral stable allocation s of G0 and the stable b-matchings of G1.

2nd step: introducing 6-cycles on the edges Given a stable b-matching problem for a graph G1. We reduce the problem to another stable b-matching problem for a graph G2, where G2 is simple and satisfies the many-to-one property (i.e. u, v E(G2) b(u)=1or b(v) = 1). { } ∈ ⇒ If v V (G1) then let v′ V (G2) with the same bounds, b(v′)= b(v). If u, v = e 1 ∈ ′ ′ ∈′ ′ ′ ′ 2 { }′ ′ ∈ E(G ), then let ue,1, ue,2, ue,3, ve,1, ve,2, ve,3 V (G ) with unit bounds, and u ,ue,1 , ′ ′ ′ ′ ′ ′ ′ ′ ∈ ′ ′ ′ ′ ′ ′ { 2} v , ve,1 , ue,1,ue,2 , ue,2, ve,3 , ve,3, ve,1 , ve,1, ve,2 , ve,2,ue,3 , ue,3,ue,1 E(G ) {(with unit} { capacities),} { with the} following{ } preferences:{ } { } { } ∈

′ ′ ′ ′ ′ ′ ′ ′ ′ ′ ue,1 : [ue,2,u ,ue,3] ue,2 : [ve,3,ue,1] ue,3 : [ue,1, ve,2] ′ ′ ′ ′ ′ ′ ′ ′ ′ ′ ve,1 : [ve,2, v , ve,3] ve,2 : [ue,3, ve,1] ve,3 : [ve,1,ue,2] Suppose that x1 corresponds to a stable b-matching M 1 for G1 (i.e. e M 1 x1(e) = 1). We can construct another stable b-matching, M 2 for G2 ∈ ⇔ CHAPTER 3. STABLE ALLOCATION PROBLEMS 54

1 2 u G G u′ → ′ ue,3 ′ ue,2 ′ e ue,1 ′ ve,1 ′ ′ ve,2 ve,3 v v′

Figure 3.2: Introducing 6-cycles as follows: If u, v = e E(G1), then { }1 ∈ ′ ′ ′ ′ ′ ′ ′ ′ 2 - e M u ,ue,1 , ue,2, ve,3 , ve,2,ue,3 , v , ve,1 M ∈ 1 ⇒{ } { } { ′ } ′{ ′ } ∈′ ′ ′ 2 - e / M and e is dominated at v ue,1,ue,2 , ve,3, ve,1 , ve,2,ue,3 M It can∈ be verified that M 2 is a stable⇒{b-matching} { for G2 (see} { [31]). } ∈

In the other direction, suppose that x2 corresponds to a stable b-matching M 2 for G2. Let us create M 1 is the following way: ′ ′ ′ ′ ′ ′ ′ ′ 2 1 - u ,ue,1 , ue,2, ve,3 , ve,2,ue,3 , v , ve,1 M e M It{ can be} verified{ that} {M 1 is a stable} { b-matching} ∈ ⇒ for G∈1 (see [31]).

3rd step: b-expansion of the vertices in order to omit the bounds Given a stable b-matching problem for a graph G2, where G2 is simple and satisfies the many-to-one property. We reduce the problem to a stable roommates problem for a graph G3 as follows.

If u V (G2) and b(u) = 1, then let u′ V (G3) with b(u′) = 1. If v V (G2) ∈ ′ ′ ′ 3∈ ′ ∈ 2 and b(v) = k, then let v1, v2, . . . , vk V (G ) with b(vi) = 1. If u, v E(G ) and ′ ′ ∈ ′ ′ ′ ′ {3 } ∈ b(u) = 1, b(v) = k, then let u , v1 , u , v2 , . . . , u , vk E(G ). Considering the { } 2{ } ′{ ′ }′ ∈ ′ ′ preferences: if u, v

In the other direction, suppose that M 3 is a stable matching for G3. Let u, v M 2 { } ∈ whenever u′, v′ M 3 for some i. It can be verified that M 2 is a stable b-matching { i} ∈ CHAPTER 3. STABLE ALLOCATION PROBLEMS 55 2 3 u G G u′ →

b(v)= k ′ b(vi)=1 v ′ ′ ′ v1 v2 vk

Figure 3.3: b-expansion of the vertices for G2 (see [31], or [52] p.38 and [92] p. 131-132 in the bipartite case).

3.2.3 Generalizations of the basic algorithms By the above argument it is not surprising that every algorithm that solves the stable roommates or the stable marriage problem can be generalized to solve the integral stable allocation problem as well. In the bipartite case, the generalized version of the deferred-acceptance algorithm of Gale and Shapley was applied for the many-to-one stable matching problem (or college admission problem) in their paper [48]. Its straightforward generalization was presented by Ba¨ıou and Balinski [14] for the integral stable allocation problem. We note that Gale–Shapley type algorithms were created to solve stable b-matching problems for more general preferences, or choice functions by Kelso and Crawford [66], Roth [84], [85], Blair [23], Fleiner [44], [46], [45], Alkan [9], Eguchi, Fujishige and Tamura [40], and for integral stable allocation problems by Alkan and Gale [10], Fujishige and Tamura [47]. Considering the nonbipartite case, the generalized version of Irving’s algorithm [56] was used to solve the stable fixtures problem in [60] and for the stable multiple activities problem in [31] and [35].

However, we must remark, that the details of the generalization can be crucial considering the running time of the algorithm. The main result of Cechl´arov´aand Viera [35] is that their implementation preserves an O(m) running time also for their general settings. On the other hand, the straightforward generalization of the Gale–Shapley algorithm becomes slow for the integral stable allocation problem. Ba¨ıou and Balinski [14] showed by an example with 4 vertices and 4 edges, that the number of rounds in the algorithm can be equal to the sum of the bounds. CHAPTER 3. STABLE ALLOCATION PROBLEMS 56

In the next section we present the algorithm of Ba¨ıou and Balinski [14], that provide a stable allocation for every stable allocation problem for bipartite graphs in strongly polynomial time. (Thus, its running time does not depend on the bounds and capacities, only on the number of vertices and edges.) Then we generalize their inductive algorithm for integral stable allocation problems in the nonbipartite case, however we show by an example that this algorithm does not remain polynomial. Actually, these inductive algorithms are also a kind of generalizations of the Roth- Vande Vate and the Tan–Hsueh algorithms, respectively. Thus, they can be used to model dynamic market situations. Moreover, the obtained stable allocations by these algorithms may have special properties, similar to the properties of the obtained stable matchings and half-matchings described in Section 2.2.

3.2.4 The inductive algorithm for bipartite graphs Let us suppose that we have given a stable allocation problem for a (not necessarily bipartite) graph G with vertex-bounds b and edge-capacities c. Suppose that x is a stable allocation. Recall, that an edge is saturated if x(e)= c(e), and a vertex v is saturated if x(v) :=

v∈e x(e) = b(v). Finally, edge e is dominated at vertex v if v∈e,e≤vh x(h) = b(v). P(Note, that an allocation is stable, if every non-saturated edgeP is dominated at some of its endvertices.) Furthermore, let us define l(v) to be the edge e, that is dominated at v and x(e) > 0. Let f(v) be the edge e, that is dominated only at v, e is not saturated, and there exist no other edge f that satisfies the same property with e

Lemma 3.2.1. Given a stable allocation problem for a graph G with vertex-bounds b and edge-capacities c, and given a stable allocation x. a) Suppose that u, v = l(v) and ε x( u, v ). { } ≤ { } b(w) ε if w = u, v x(e) ε if e = u, v Let b′(w)= − Then x′(e)= − { }  b(w) otherwise.  x(e) otherwise

is a stable allocation for the modified bounds b′. b) Suppose that v,w = l(v) and ε c( v,w ) x( v,w ). { } ≤ { } − { } b(u)+ ε if u = v,w x(e)+ ε if e = v,w Let b′(u)= Then x′(e)= { }  b(u) otherwise.  x(e) otherwise

is a stable allocation for the modified bounds b′. CHAPTER 3. STABLE ALLOCATION PROBLEMS 57

Proof. a) Obvious, since u, v remains dominated at v, and every other edge that was { } dominated at u or v remains dominated there. b) Obvious, since v,w remains dominated at v, and every other edge that was dom- { } inated at v or w remains dominated there.

Augmenting procedures Suppose that our goal is to increment the bound of a vertex v from b(v) to b′(v) = b(v)+ε, by simultaneously modifying x to x′ in such a way that x′ is a stable allocation for the new settings. If f(v) does not exist, then obviously x′ = x remains stable. Otherwise, we will construct, a so-call augmenting path, to conduct the improvement of x(v). To create such a path, let a0 = v, and let the 2i-th and the (2i + 1)-th element of the sequence be

bi if ai , bi = f(ai ) and • { −1 } −1 ai if bi, ai = l(bi), respectively • { } for every index i from i = 1 while such vertex exists and no repetition occurs.

Depending on the termination of the above augmenting path, under the assumption that G is bipartite graph, we have 4 cases:

I1) f(ak) does not exist: the augmenting path is a0, b1, a1,...,bk, ak.

Let εl := min1≤j≤k x( bj, aj ) , εf := min1≤j≤k c( aj−1, bj ) x( aj−1, bj ) , { ′{ } } { { } − { } } ε = min εl,εf and b (v)= b(v)+ ε. Finally, let { } x(e)+ ε if e = aj−1, bj for 1 j k, ′ { } ≤ ≤ x (e)=  x(e) ε if e = bj, aj for 1 j k and − { } ≤ ≤  x(e) otherwise. Then x′ is a stable allocation for b′ by Lemma 3.2.1 and by the definition of f(v).

I2) l(bk) does not exist: the augmenting path is a0, b1, a1,...,ak−1, bk.

Let εl := min1≤j≤k x( bj, aj ) , εf := min1≤j≤k c( aj−1, bj ) x( aj−1, bj ) , { { } } ′ { { } − { } } ε = min εl,εf , b(bk) x(bk) and b (v)= b(v)+ ε. Finally, let { − } x(e)+ ε if e = aj−1, bj for 1 j k, ′ { } ≤ ≤ x (e)=  x(e) ε if e = bj, aj for 1 j k 1 and  x(e)− otherwise.{ } ≤ ≤ − Then x′ is a stable allocation for b′ by Lemma 3.2.1 and by the definition of l(v). CHAPTER 3. STABLE ALLOCATION PROBLEMS 58

C1) ak = ai for some k > i: the augmenting path is a0, b1, a1,...,bi, ai,...,bk, ak = ai.

Let εl := mini j k x( bj, aj ) , εf := mini j k c( aj , bj ) x( aj , bj ) , ≤ ≤ { { } } ≤ ≤ { { −1 } − { −1 } } ε = min εl,εf and let { }

x(e)+ ε if e = aj−1, bj for i j k, ′ { } ≤ ≤ x (e)=  x(e) ε if e = bj, aj for i j k and − { } ≤ ≤  x(e) otherwise.  Then x′ is a stable allocation for b by Lemma 3.2.1.

C2) bk = bi for some k > i: the augmenting path is a0, b1, a1,...,bi, ai,...,ak−1, bk = bi.

Let εl := mini j k x( bj, aj ) , εf := mini j k c( aj , bj ) x( aj , bj ) , ≤ ≤ −1{ { } } ≤ ≤ { { −1 } − { −1 } } ε = min εl,εf and let { }

x(e)+ ε if e = aj−1, bj for i j k, ′ { } ≤ ≤ x (e)=  x(e) ε if e = bj, aj for i j k 1 and  x(e)− otherwise.{ } ≤ ≤ −  Then x′ is a stable allocation for b by Lemma 3.2.1.

The algorithm of Ba¨ıou and Balinski A stable allocation problem for a bipartite graph G is given with vertex set V (G)= A B, vertex-bounds b and edge-capacities c. Let n be the number of vertices and let m∪be the number of edges in G. Here, we present the so-called inductive algorithm of Ba¨ıou and Balinski [14], that solves this problem by using at most O(n + m) times the above augmenting procedures.

At the beginning of the inductive algorithm, we set the bounds to be b0(u)=0 for every u A and b0(v) = b(v) for every v B. Here x0(e) = 0 for every e E(G) ∈ ∈ ∈ is a trivial stable allocation. The idea of the algorithm is to successively increment the bounds of the vertices in A, considering the vertices in order of their indices, by simultaneously modifying the stable allocation for the problem with the actual bounds, until reaching the vertex-bounds b for every vertex.

Suppose that after i augmenting steps a stable allocation xi for vertex-bounds bi i i i is given, where b (aj) = b(aj) for every jk. We construct the augmenting path, and we execute the formed augmenting i procedure, by settingε ¯ = min ε, b(ak) b (ak) in cases I1) and I2). { − } CHAPTER 3. STABLE ALLOCATION PROBLEMS 59

Analysis of the running time For the actual stable allocation problem in the i-th step, with bounds bi, and stable allocation xi, we define the following partition of E(G):

T (i) : e xi(e) = 0 and e is dominated only at some u A , 1 { | ∈ } T (i) : e 0 < xi(e)

Obviously, T1(0) = E(G). It can be easily verifyied that for two indices 1 p q 5 it is impossible an edge e belongs to both Tq(i) and Tp(i +1), no matter which≤ ≤ augmenting≤ procedure is executed in the i-th step. Furthermore, if a vertex v B is unsaturated before the i-th step, then it can become saturated after the i-th step,∈ but never conversely.

Moreover, after an augmenting step, one of the following four cases holds:

a new edge e becomes saturated, so e T (i + 1) T (i), • ∈ 3 \ 3 a new edge e becomes 0-weighted, so e T (i + 1) T (i), • ∈ 5 \ 5 a new vertex v B becomes saturated, so b(v)= xi+1(v) > xi(v), • ∈ i+1 i a new bound is reached, so b(ak)= b (ak) > b (ak). • Thus, the number of augmenting steps in the Ba¨ıou–Balinski algorithm is at most 2m + n.

3.2.5 The inductive algorithm for general graphs Additional augmenting procedures Assume that x is a stable allocation for a graph G with vertex-bounds b and edge- capacities c. If G is not necessarily bipartite, then the augmenting path can have two more possible endings, thus these two cases yield two new possible augmenting procedures:

I3) ak = bi for some k > i: the augmenting path is a0, b1, a1,...,bi, ai,...,bk, ak = bi. CHAPTER 3. STABLE ALLOCATION PROBLEMS 60

Let εl := min j i x( bj, aj ) , εf := min j i c( aj , bj ) x( aj , bj ) , 1≤ ≤ −1{ { } } 1≤ ≤ { { −1 } − { −1 } } εhl := mini j k x( bj, aj ) , εhf := mini j k c( aj , bj ) x( aj , bj ) , ≤ ≤ { { } } +1≤ ≤ { { −1 } − { −1 } } ε = min εl,εf , 2 εhl, 2 εhf and let { · · }

x(e)+ ε if e = aj , bj for 1 j i, { −1 } ≤ ≤  x(e) ε if e = bj, aj for 1 j i 1, ′  − ε { } ≤ ≤ − x (e)=  x(e)+ 2 if e = aj−1, bj for i +1 j k,  ε { } ≤ ≤  x(e) if e = bj, aj for i j k and − 2 { } ≤ ≤  x(e) otherwise.   Then x′ is a stable allocation for b by Lemma 3.2.1.

I4) bk = ai for some k > i: the augmenting path is a0, b1, a1,...,bi, ai,...,ak−1, bk = ai.

Let εl := min j i x( bj, aj ) , εf := min j i c( aj , bj ) x( aj , bj ) , 1≤ ≤ { { } } 1≤ ≤ { { −1 } − { −1 } } εhl := mini j k x( bj, aj ) , εhf := mini j k c( aj , bj ) x( aj , bj ) , +1≤ ≤ −1{ { } } +1≤ ≤ { { −1 } − { −1 } } ε = min εl,εf , 2 εhl, 2 εhf and let { · · }

x(e)+ ε if e = aj , bj for 1 j i, { −1 } ≤ ≤  x(e) ε if e = bj, aj for 1 j i, ′  − ε { } ≤ ≤ x (e)=  x(e)+ 2 if e = aj−1, bj for i +1 j k,  ε { } ≤ ≤  x(e) if e = bj, aj for i +1 j k 1 and − 2 { } ≤ ≤ −  x(e) otherwise.   Then x′ is a stable allocation for b by Lemma 3.2.1.

We refer hereby to the augmenting procedures I1), I2), I3) and I4) as improving procedures, and to C1), C2) as cycle-swapping procedures.

The general inductive algorithm Fix a integral stable allocation problem for a graph G with vertex-bounds b and edge-capacities c. The idea of the inductive algorithm in this general case is the same: We start with a trivial problem with b0(v) = 0 for every v V (G), and a integral ∈ stable allocation x0(e) = 0 for every edge e E(G). Then we successively execute augmenting procedures considering the vertices∈ in order of their indices, until reaching the vertex-bounds b for every vertex.

To prove that this algorithm terminates in finitely many steps, we shall show first that each stable allocation xi has only half-integer weights, moreover, the non-integer edges form disjoint odd cycles. This property trivially holds for x0. We suppose that it is true for xi, and we show that this remains true for xi+1. CHAPTER 3. STABLE ALLOCATION PROBLEMS 61

Suppose that v is incident with two non-integer edges e and e′, such that ′ e

We shall verify that cases C1) and C2) cannot occur consecutively infinite many times. Indeed, we prove that within 2m steps, at least one improving procedure must be executed in the inductive algorithm.

Lemma 3.2.2. Assume that a stable allocation problem for a graph G is given with a stable allocation x. Let the number of edges in G be E(G) = m. If we invoke the increment procedure continuously for one vertex a |V (G),| then after at most 2m 0 ∈ rounds an improving procedure will be executed.

Proof. Indirectly suppose, that after each call a cycle-swapping procedure is executed. We build a bipartite subgraph G′ of G with vertex set A B in the following way. Let 1 1 1 ∪ 1 the first augmenting path be P = (A B ). If u = aj,1 A then let u A and if 1 | ∈ ′ ∈ v = bj, B then v B. Moreover, we create a directed subgraph D of G by directing 1 ∈ ∈ each occuring vertex in the sequence to the consecutive vertex. So, if next(u)= bj+1,1, then (u, next(u)) A(D). Similarly, if next(v)= aj,1, then (v, next(v)) A(D). Note, that u, next(u) ∈= f(u) before the first round and u, next(u) = l(u)∈ after the first { } { } round. Similarly v, next(v) = l(v) before the first round and v, next(v) = f(v) after the first round.{ Let us} denote the vertex, where the first repetition{ occurs} in P 1 by r1. Obviously there exist a directed path to r1 from each vertex of P 1 in D. Moreover, r1 must be part of the second augmenting path, P 2, since until r1 the augmenting path P 2 is the same as P 1. t t t t Similarly, let the t-th augmenting path be P = (A B ). If u = aj,t A then let t | ∈′ u A and if v = bj,t B then v B. If v V (D) then we remove (v, v ) from A(D) and∈ after we add (v, next∈ (v)) to A(∈D), where∈next(v) is defined as above. Let rt denote the vertex, where the repetition occurs in P t. Obviously, there exists a directed path to rt from each vertex of P t in D, thus from rt−1, as well. This implies, by induction, that there exists a directed path to rt from each vertex of V (D) in D. To show that the above definition of G′ is correct, we have to verify that u At B (and similarly v Bt A) is not possible. Suppose otherwise that u is the first∈ vertex∩ ∈ ∩ t−1 t t−1 such that u = aj,t B. Obviously, r is already part of P before u, since until r , the augmenting path∈ P t is the same as P t−1. We can assume by induction, that there exists a directed path from u to rt−1 in D. Moreover, this directed path actually is the same as the augmenting path from u by the definition of next(v), where all the vertices are in the opposite side as before (i.e. next(u) Bt A, next(next(u)) At B and ∈ ∩ ∈ ∩ CHAPTER 3. STABLE ALLOCATION PROBLEMS 62

so on). So, a repetition must occur, either bk,t = ai,t or ak,t = bi,t thus case I3) or I4) holds, a contradiction. ′ ′ ′ ′ ′ ′ Finally, we define T1(t), T2(t), T3(t), T4(t) and T5(t) on G in the very same way as T1(i), T2(i), T3(i), T4(i) and T5(i) were defined before. Similarly, it can be verified ′ that for two indices 1 p q 5 it is impossible an edge e belongs to both Tq(t) and ′ ≤ ≤ ≤ Tp(t + 1), if one of the cycle-swapping procedure is executed in the t-th step. Moreover, one of the following two cases surely happen after a cycle-swapping procedure: a new edge e of G′ becomes saturated, so e T ′(t + 1) T ′(t), • ∈ 3 \ 3 a new edge e of G′ becomes 0-weighted, so e T ′(t + 1) T ′(t), • ∈ 5 \ 5 So, we could execute at most 2m cycle-swapping procedures consequently. A corollary of Lemma 3.2.2 is that the number of steps of the inductive algorithm is O(n + m) v∈V (G) b(v). P

An example for bad case running time Below, we create a integral stable allocation problem for a graph G, for which the number of steps in the inductive algorithm is not polynomial in n = V (G) . | | Example 3.2.3. Let Fi denotes the i-th Fibonacci number (i.e. F1 = F2 = 1, and Fi = Fi−2 + Fi−1 for i 3). A graph G of n vertices is given: a1, a2,...,an with the following edges, preferences,≥ bounds and capacities:

a1 : [a3, a2] a2 : [a4, a3, a1] b(ai)= Fi for every i =1,...,n ai : [ai+2, ai+1, ai−1, ai−2] c( ai, ai )= Fi for every i =1,...,n 1 for every i =3,...,n 2 { +1} − − c( ai, ai+2 )= Fi for every i =1,...,n 2 an−1 : [an, an−2, an−3] { } − an : [an−1, an−2]

It can be verified that the inductive algorithm executes Fi improving operations on ai, namely I1) and I2) alternately, each with improvement 1. Thus the number of n steps in the algorithm is i=1 Fi, that is an exponential function of n P However, we have just shown that the general inductive algorithm is not polynomial, we note that the scaling property ensures that this algorithm can be modified with standard techniques to become polynomial for the integral stable allocation problem. But it remains an open question whether there exists a strongly polynomial algorithm for the integral stable allocation or for the more general stable allocation problem on nonbipartite graphs. CHAPTER 3. STABLE ALLOCATION PROBLEMS 63

Properties of the obtained solutions Finally, we remark that solutions for the stable allocation problem obtained by the in- cremental algorithm have similar properties to the stable matchings and half-matchings for the stable roommates problem obtained by the inductive algorithm, since the Ba¨ıou– Balinski algorithm is a kind of generalization of the Roth-Vande Vate algorithm, and the general inductive algorithm is a generalization of the Tan–Hsueh algorithm.

b(a0)= ε 1+ε 2 a0 a1 a2 ai−2 ai−1 1−ε bi+2 2 ai+1 ε ε ε ε ε ε 1−ε − − − − − bi ε 1 ε 1 ε 1 1 ε 1 2

1−ε bi+1 b1 b2 b3 bi−1 2 ai 1+ε 2

Figure 3.4: A core configuration as an εv-core element.

For example, let us run the inductive algorithm for a stable matching problem. If we consider an improving procedure executed for a vertex v, then the augmenting path is actually the proposal-rejection sequence, associated to a core-configuration relative to v. To prove this by the uniqueness of the above sequence, it is enough to see that an ε-improvement for every 0 ε 1 creates a stable allocation for the problem with bounds b(v) = ε and b(u)≤ = 1 for≤ every u = v, that is a special fractional b-core 6 element, called εv-core element, illustrated in Figure 3.4.

3.3 An application: College admission in Hungary

Since 1985 the admission procedure of higher education institutions is organized by a centralized matching program in Hungary. We present the implemented algorithm, which is similar to the college-proposing version of the Gale–Shapley algorithm. The difference is that here ties must be handled, since applicants may have equal scores. The presented score-limit algorithm finds a solution that satisfies a special stability condition. We describe the applicant-proposing version of the above algorithm and we prove that the obtained solutions by these algorithms are the maximal and the minimal stable score-limits, respectively.

Preliminaries As we already noted in Section 2.1., the college admission problem was introduced and studied by Gale and Shapley [48]. Later Roth [83] described the history of the CHAPTER 3. STABLE ALLOCATION PROBLEMS 64

National Intern Matching Program, that have used the same type of algorithm since 1952. Further literature about the two-sided matching markets can be found in the book of Roth and Sotomayor [92]. Recently, the student admission problem came again into prominence (detailed description about several applications can be found in the paper of Abdulkadiro˘glu and S¨onmez [3]). New centralized matching programs have been implemented for public schools in Boston, and for high schools in New York (see [1] and [2]). However, there are some studies about existing college admissions programs as well (see the papers [81] and [16] about the programs in Spain and in Turkey, respectively), the description of many other important implementations are not available in the lit- erature. In Hungary, the admission procedure of higher education institutions is organized by a centralized matching program. The Ministry of Education founded the Admission to Higher Education National Institute (OFI) in 1985 in order to create, operate and develop the admission system of the higher education. The number of applicants is around 150000 in each year, about 100000 of them are admitted, and the fees are payed by the state for approximately 60% of the students (exact statistics in Hungarian are available at [76]). First, we note that instead of colleges, in Hungary the universities have faculties, where the education is organized in different fields of studies quite independently. So here, students apply for fields of studies of particular faculties. For simplicity, these fields are referred as colleges later in order to keep the original terminology of Gale and Shapley. At the beginning of the procedure, students give their ranking lists that correspond to their preferences over the fields they apply for. There is no limit for the length of the list, however applicants are charged after each item. The students receive scores at each field they applied for according to their final notes at the high school, and entrance exams. Note, that the score of a student can differ at two fields. These scores are integer numbers, currently limited to 144. Universities can admit a limited number of students to each of their fields, these quotas are determined by the Ministry of Education.1 The administration is organized by a state-owned center. After collecting the ap- plicants’ rankings and their scores, a centralized program computes the score-limits of the fields. An applicant is admitted by the first place on his list, where he is above the score-limit. Here, we present the currently used basic algorithm that yields a kind of stable assignment. This algorithm is very similar to the Gale–Shapley [48] algorithm, in fact, if the score of the applicants are different at each place then this algorithm is equivalent to the college-proposing algorithm of Gale and Shapley. This explains why it is not suprising that similar statements can be proved for the score-limit algoritms. Here, we show that the score-limits at each field is maximal for the college-proposing version,

1We describe some further specialities and requirements in the last subsection, that are not included in the presented basic model. CHAPTER 3. STABLE ALLOCATION PROBLEMS 65 and minimal for the applicant-proposing version in the set of the stable score-limits.

3.3.1 The definition of stable score-limit

Let A = a , a ,...,an be the set of applicants and C be the set of colleges, where { 1 2 } qu denotes the quota of college cu. Let the ranking of the applicant ai be given by a i preference list P , where cv >i cu denotes if cv preceeds cu in the list, i.e. the applicant i ai prefers the college cv to cu. Let su be ai’s final score at the college cu. The score-limit l is a nonnegative integer mapping l : C N. An applicant ai is → admitted by a college cu, if he achieves the limit at college cu, and that is the first i i such place in his list, i.e. s l(cu), and s < l(cv) for every college cv >i cu. If the u ≥ v score-limit l implies that a college cu admits applicant ai, then we set the boolean i i variable xu(l) = 1, and 0 otherwise. Let xu(l)= i xu(l) be the number of applicants allocated to cu. A score-limit l is feasible if xu(l)P qu for every college. ≤ Let lu,t be defined as follows: lu,t(u) = l(u) t and lu,t(v) = l(v) for every v = u. − 6 That is, we decrease the score limit by t at college cu, by leaving the other limits unchanged. We say that a score-limit l is stable if l is feasible but for each college cu, lu,1 is not feasible. This stability condition means that no college can decrease its limit without violating its quota (assuming that the others do not change their limits). We note that if no ties occur (i.e. two applicants have different scores at each college), then this stability condition is equivalent to the original one by Gale and Shapley.

3.3.2 Score-limit algorithms and optimality First we present the currently used algorithm and verify its correctness, then we describe its applicant-proposing version. Finally, we prove that these algorithms produce the maximal and the minimal stable score-limits, respectively.

The score-limit algorithms Both score-limit algorithms are very similar to the two versions of the original Gale–Shapley algorithm. The only difference is that now, the colleges cannot select exactly as many best applicants as their quotas are, since the applicants may have equal scores. Here, instead each college sets its score-limits always to be the smallest one, such that its quota is not exceeded. If the scores of the applicants are distinct at each college then these algorithms are equivalent to the original ones.

College-proposing algorithm: In the first stage of the algorithm, let us set the score-limit at each college independently to be the smallest value such that the number of admitted applicants does not exceed its quota by considering all its applications. Let us denote this limit by l1. Obviously, CHAPTER 3. STABLE ALLOCATION PROBLEMS 66 there can be some applicants, who are admitted by several places. These applicants keep their best offer, and reject all the less preferred ones, moreover they cancel also their less preferred applications. In the further stages, the colleges check whether their score-limits can be further decreased, since some of their applications may have been cancelled in the previous stage, hence they look for new students to fill up the empty places. So each college sets its score-limit independently to be the least possible, considering their actual applica- tions. If an applicant is admitted by some new, better place, then he accepts the best offer in suspense, and rejects or cancels his other, worse applications. Formally, let lk be the score-limit after the k-th stage. In the next stage, at every u,tu college cu, the largest integer tu is chosen, such that xu(l ) qu. That is, by decreasing k ≤ its score-limit by tu, the number of admitted applicants by cu does not exceed its quota, supposing that all other score-limits remained the same. For every college let u,tu lk+1(cu) := lk (cu) be the new score-limit. If some limits are decreased simultaneously, u,tu then some applicants can be admitted by more than one place, so xu(lk+1) xu(lk ). Obviously, the new score-limit remains feasible. ≤ Finally, if no college can decrease its limit, then the algorithm stops. The stability of the final score-limit is obvious by definition.

Example 3.3.1. In this example we consider only 3 colleges, ccs, ce and cm (i.e. college of computer science, economics and maths, respectively) and the effect caused by two applicants, ai and aj. We suppose that all the other applicants have only one place i in their lists. The preferences of ai and aj are the following: P = ce,ccs,cm,... and j i i i j P = ccs,cm,ce,... . Their scores are: scs = 112, se = 100, sm = 117, scs = 110, j j se = 103 and sm = 105. Let the quotas be qcs = 500, qe = 500 and qm = 100. We suppose that the number of applicants having

- at least 110 points at ccs is 510, - more than 110 points at ccs is 483, - at least 100 points at ce is 501, - more than 100 points at ce is 460, - at least 105 points at cm is 101, - more than 105 points at cm is 87.

In the first stage of the college-proposing algorithm the score-limits are l1(ccs) = 111, l1(ce) = 101 and l1(cm) = 106. At these limits ai is admitted to the college of computer science and to the college of maths too, while aj is admitted to the college of economics only. Since ai prefers the computer science, he rejects the latter offer (and he cancels also his other less preferred applications.) Now, in the second stage, the score-limit can be decreased by one at the college of maths, because the number of currect applications having at least 105 points is exactly 100. In this way, aj becomes admitted to this college, and since he prefers maths to economics, he rejects his offer there. In the third stage, the score-limit can be decreased by one at the college of economics. After this CHAPTER 3. STABLE ALLOCATION PROBLEMS 67

1

CS I2 J1 483th 510th

1 3

Econ J3 I1 460th 501st

1 2

Maths I3 J2 87th 101st

Figure 3.5: The score-limits in the college-proposing algorithm

change ai is admitted to the college of economics, that is his most preferred place, so he cancels all his other applications. In the final stage no score-limit can be decreased, so the algorithm stops.

Applicant-proposing algorithm: Let each applicant propose to his first choise in his list. If a college receives more applications than its quota, then let this score-limit be the smallest value such that the number of temporary accepted applicants does not exceed its quota. We set the other limits to be 0. Let the score-limit after the k-th stage be lk. If an applicant has been rejected in the k-th stage, then let him apply for the next place in his list, say cu where he achieves the actual score-limit lk(cu), (if there remained such a place in his list). Some colleges may receive new proposals, so if the number of admitted applicants exceeds their quota at a college, they set a new, higher score-limit lk+1. At the same time, they reject all those applicants that do not achieve this new limit. The algorithm stops if there is no new application. The final score-limit is obviously feasible. It is also stable, because after a limit is increased for the last time, then the rejected applicants get worse and worse offers during the algorithm. So if the limit were decreased by one at the final solution in this place, then these applicants would accept the offer, and the quota would have been exceeded.

Theorem 3.3.2. Both the score-limit lC , obtained by the college-proposing algorithm and the score-limit lA, obtained by the applicant-proposing algorithm are stable.

Below, we give a simple example to show that not only some applicants can be admitted by preferred places in lA than in lC , but the number of admitted applicants can also be larger in lA.

Example 3.3.3. We consider only two places ccs and ce with two applicants ai and aj. We suppose that all the other applicants have only one single place in their lists. The CHAPTER 3. STABLE ALLOCATION PROBLEMS 68

i j preference-lists of ai and aj are P = ce,ccs,... and P = ccs,ce,... , and their scores i i j j are: scs = 112, se = 100, scs = 110 and se = 103. Both places have quotas 500. We suppose that the number of applicants having

- at least 110 points at ccs is 501, - more than 110 points at ccs is 487, - at least 100 points at ce is 501, - more than 100 points at ce is 460.

C A CS I2 J1

487th 501st C A

Econ J2 I1

460th 501st

Figure 3.6: The final score-limits of the college-proposing and the applicants-proposing algorithm

Here, both algorithms stop after one stage. The final score-limit obtained by the college-proposing algorithm is lC (ccs) = 111 and lC (ce) = 101. The number of admitted applicants are xcs(lC ) = 487 and xe(lC ) = 460, respectively. While, the final score- limit obtained by the applicant-proposing algorithm is lA(ccs) = 110 and lA(ce) = 100. Moreover, the number of admitted applicants are 500 at both places. This extreme example shows that the difference between the solutions can be relevant.

The optimality

We say that a score-limit l is better than l for the applicants if l l , (i.e. l(cu) l (cu) ∗ ≤ ∗ ≤ ∗ for every college cu). In this case every applicant is admitted by the same or by a preferred place at score-limit l than at l∗.

Theorem 3.3.4. lC is the worst possible and lA is the best possible stable score-limit for the applicants, i.e. for any stable score-limit l, lA l lC holds. ≤ ≤ Proof. Both proofs are based on indirect arguments, that are similar to the original one of Gale and Shapley’s. Suppose first, that there exists a stable score-limit l∗ and a college cu such that l∗(cu) > lC (cu). During the college-proposing algorithm there must be two consecutive stages with score-limits lk and lk+1, such that l∗ lk and l∗(cu) > lk+1(cu) for some u,tu ≤ u,tu u,1 college cu. Obviously, l (cu) = lk (cu) by definition and xu(l ) qu < xu(l ) k +1 k ≤ ∗ by the stability of l∗. So, on the one hand, there must be an applicant, say ai who is u,1 u,tu admitted by cu at l∗ but not admitted by cu at lk . On the other hand, the indirect CHAPTER 3. STABLE ALLOCATION PROBLEMS 69

u,tu u,1 assumption lk (cu)= lk+1(cu) l∗(cu) 1= l∗ (cu) implies that ai must be admitted ≤ −u,tu u,tu by another, preferred place than cu at lk (since ai has at least lk (cu) score there), and obviously also at lk. That is impossible if l lk, a contradiction. ∗ ≤ To prove the other direction, we suppose that there exist a stable score-limit l∗ and a place cu such that l∗(cu) < lA(cu). During the applicant-proposing algorithm there must be two consecutive stages with score-limits lk and lk , such that l lk and +1 ∗ ≥ l∗(cu) < lk+1(cu) for some college cu. At this moment, the reason of the incrementation is that more than qu students are applying for cu with at least l∗ score. This implies that one of these students, say ai is not admitted by cu at l∗ (however he has at least l∗(cu) score there). So, by the stability of l∗, he must be admitted by a preferred place, say cv at l∗. Consequently, ai must have been rejected by cv in a previous stage of the algorithm, that is possible only if l∗(cv) < lk(cv), a contradiction.

3.3.3 Further notes There are many further rules required by the law. Some of them are considered in the present algorithm, some are handled manually afterwards. At each place there is a minimum score that is generally equal to 60% of the maximum score (that is 144 points usually). If an applicant does not have the minimum score at a place, then this application is simply deleted. In Hungary, some studies are completely financed by the state, some are partly financed by the students. At most of the places there are two different quotas for both kind of studies. The applicants have to indicate also in their rankings which kind of study they apply for at some field.2 These are considered in the algorithm as distinct places with distinct quotas. However, there are some requirements on their score-limits: the difference between the score-limits of the state-financed and the privately-financed studies at the same place can not be more than 10%. This rule is tracted by the current algorithm. Another speciality is that certain pairs of fields can be chosen simultaneously, and some others must come in pairs. These cases are solved manually after the first run of the program, and might cause overflowings. An actual problem of the program is that the scoring system is not fine enough, that is why huge ties are likely to emerge. As a consequence, the difference between the quota and the number of admitted applicants can be large. Moreover, in an extreme case, if the number of applicants having maximum score is greater than the quota of that place, no student can be admitted. So, it is a good news, that recently a finer scoring system has been proposed in the actual law that will increase the maximum score from 144 to 480. 2An applicant may rank first a state-financed study in economics at a university in Budapest, then secondly another state-financed study in economics at another university in P´ecs, and thirdly a privately-financed study in economics at the first university in Budapest. So the fees are included in the preferences of the applicants in this way. CHAPTER 3. STABLE ALLOCATION PROBLEMS 70

In our opinion, to change the direction of the algorithm would also be reasonable. Not just because some applicants could be admitted by preferred places, but also because the number of admitted applicants could increase too. We think that the effect of such a change would be more significant than the effect of a similar change in the National Resident Matching Program (see the study of Roth and Peranson [86] about this). Chapter 4

Exchange of indivisible goods

Introduction

In this chapter we study the question of exchanging indivisible goods. First we give a game theoretical overview on the basic results and we describe some applications that motivate our studies. In Section 4.2, we consider the optimal exchange problem with restrictions, based on the paper [22]. Finally, we study the problem of stable exchanges in Section 4.3, where we present some results published in [20] and [19].

4.1 Preliminaries, applications

4.1.1 The core of exchange games Assume that a simple digraph D =(V, A) is given, where V is the set of agents. Suppose that each agent has exactly one piece of indivisible goods, and (i, j) A if the good of agent i is suitable for agent j. An exchange is a permutation π of V such∈ that, for each i V , i = π(i) implies (i, π(i)) A. We denote by Cπ(i) the cycle of π containing i. If C∈π(i) has6 length at least 2, then∈ the agent is said to be covered.

The houseswapping game Shapley and Scarf [103] described the exchange problem of indivisible goods as a par- titioning NTU-game, referred also as houseswapping game. Here, the set of common activities for a coalition S corresponds to the set of permutations of S. The preferences of the agents over the possible permutations are derived from the preferences over the goods that are suitable for them. As in an exchange π each agent i receives the good of his predecessor, π−1(i), agent i prefers an exchange π to another exchange σ, if he prefers π−1(i) to σ−1(i). Thus, an exchange π is in the core of the game, or it is stable, if there is no blocking coalition B and permutation σ of B, such that each agent i B ∈ prefers σ to π.

71 CHAPTER 4. EXCHANGE OF INDIVISIBLE GOODS 72

Shapley and Scarf proved that each such market has a nonempty core. Moreover, they showed that a core solution can always be found by the Top Trading Cycle (TTC) algorithm proposed originally by Gale.

The permutation game The permutation game is the houseswapping game with payments. Alternatively, this is a TU-game, where the utility of each agent i having j’s good is given as a weight, w(a) of the corresponding arc a =(i, j). The payoff of a coalition S is the maximum utility of a permutation π of S, that is the sum of the utilities, so v(S) = max w(a) π { a∈π | is a permutation of S . P The nonemptyness} of the core of permutation games was proved first by Tijs et al. [106], they showed that these games are always balanced.

Note that an exchange is equivalent to a vertex-disjoint packing of directed cycles, thus the payoff of a coalition is the maximum weight of a directed cycle packing. Moreover, by Remark 1.2.1, it is obvious that the balancedeness condition is equivalent with the statement that the maximum weight of a directed cycle packing is equal to the maximum weight of a fractional packing of directed cycles. (Formally, if is the c C set of directed cycles in D, then x : R+ is a fractional packing if x(Ci) 1 C → v∈Ci ≤ for every v V (D).) P ∈ It is well-known, that every maximum weight directed cycle packing problem can be reduced to a maximum weight problem in a bipartite graph through the following construction. Define bipartite graph Gdp by dublicating the vertices of D, so vd, vp V (Gdp) if v V (D). Let ud, vp E(Gdp) if (u, v) A(D) with weight ∈ ∈ { } ∈ ∈ w( ud, vp )= w(u, v) and let ud,up E(Gdp) with weight 0 for every u V (D). If { } { } ∈ ∈ ∗ is a set of vertex-disjoint directed cycles of maximum weight, then we create C ⊆ C a perfect matching M of maximum weight as follows: let ud, vp M if (u, v)= a ∗ ∗ { } ∈ ∈ Ci , and ud,up M if u is not covered by . And vica versa. ∈ C { } ∈ C Furthermore, a fractional packing of directed cycles xc corresponds to a fractional perfect matching xm (i.e. a fractional matching that covers each vertex with total m c weight 1). Formally, for every (u, v) = a A(D), let x ( ud, vp ) = x (Ci). ∈ { } a∈Ci Since the fractional perfect matching polytope has the integer propertyP for every bipartite graph, the integer and the relaxed problems have the same optimum, that implies the balancedeness of the game.1

1We note, that the problem can be reduced to the minimum-cost circulation problem as well: We direct the edges of Gdp from up to vd if u = v and from vd to up otherwise. We set f(a) = 0 lower and g(a) = 1 upper bounds for each arc and use the negative of the weights in Gdp. Here, a minimum- cost 0-1 circulation corresponds to a maximum weight directed cycle packing. Furthermore, the dual solution of this problem corresponds to an outcome in the core. (For details, see [98], page 289.) CHAPTER 4. EXCHANGE OF INDIVISIBLE GOODS 73

The problem of finding a maximum weight perfect matching in a bipartite graph can be solved in O(n(m + nlogn)) time, where n is the number of vertices and m is the number of edges in Gdp (see [98], page 288). So, a core-solution of the permutation game can be found by a polynomial-time algorithm.

Finally, let us remark, that although a core-solution provides an exchange with maximum utility, the assumption that the utilities are transferable is quite unrealistic in several barter exchange markets. Moreover, transfers may not be allowed at all, like in the case of living organ exchanges. Therefore, to achieve a maximum utility, or so- called optimal exchange in the market the establishment of a centralized clearinghouse is needed. Furthermore, a maximum utility solution always exists even if the core of the game is empty. This is the case when the lengths of the trading cycles are restricted.

Exchanges with restricted lengths Let us suppose that the size of the basic coalitions are restricted, so = B : B l . Thus here, the outcome of the game is an l-way exchange that containsB { no cycle| | ≤ with} length more than l. Obviously, an l-way exchange is equivalent to a vertex-disjoint packing of directed cycles with length at most l.

If l = 2, so only pairwise exchanges are allowed, then the problem becomes a matching problem in an undirected graph G with the same vertex set. Here, an edge links two vertices if a pairwise exchange is possible between the corresponding pairs. So u, v E(G) if both (u, v) and (v,u) A(D). Thus, the houseswapping game is equivalent{ } ∈ to the stable roommates problem,∈ and the permutation game is equivalent to the stable roommates problem with transferable utilities, where the utility of a possible pair is w( u, v )= w(u, v)+ w(v,u), respectively. As we have seen in Section { } 1.3. these games may have an empty core, but the problem of finding a core-solution, if one exists is solvable in polynomial time in both cases.

For l 3 the problem of exchanging indivisible goods, becomes theoretically hard for the NTU≥ and TU-games as well. We study these problems in details in Section 4.2 and 4.3.

4.1.2 An application: Kidney exchange problem The trade of goods without transfer (barter exchange) is not usual in markets nowadays. However, in some countries the exchange of tenancies [42] or residences [109] is only allowed in this way. Abraham et al. [6] also mention several such exchange programs as Peerfix (DVDs), Read It Swap It (books), Intervac (holiday houses) or the National odd shoe exchange. The most serious recent application of the studied model is certainly the kidney exchange problem. Here, to find an optimal solution by a centralized program CHAPTER 4. EXCHANGE OF INDIVISIBLE GOODS 74 is not just possible, but also required. Currently, living donation is the most effective treatment for kidney failure. But patients needing transplants may have donors who cannot donate them because of immunological incompatibility. So these incompatible patient-donor pairs may want to exchange kidneys with other pairs. Kidney exchange programs have already been established in several countries [71], [65], [78]. The most important question, what the goal of the program is. As a first priority, most of the current models want to maximize the number of patients who receive a suitable kidney in the exchange (see [90], [89], [91], [94], [95]) by considering only the suitability of the kidneys. Some more sophisticated models ([100], [22], [6]) consider the difference between suitable kidneys and try to find a solution where the sum of benefits is maximal. A third concept, introduced in [88] and developed in [32], [33], [20] requires first the stability of the solution under various criteria. Formally, if we model this problem by a digraph D(V, A), then the set of nodes V represent incompatible-donor pairs and an arc (u, v) means that the kidney of u′s donor is suitable for v′s patient. In terms of the above concepts, the first problem is actually the problem of finding a maximum size directed cycle packing in this digraph. The second is a maximum weight directed cycle packing problem (that is obviously a generalization of the first problem). We remark that such a maximum weight solu- tion is actually a core-solution of the corresponding permutation game. Finally, the third concept is actually the problem of finding a core-solution in the corresponding houseswapping game. In these models, the difficulties of the corresponding problems are due to the fact that the length of the cycles in the exchanges is bounded. The reason is that all surg- eries along a cycle have to be done simultaneously. Most programs allow only pairwise exchanges. Sometimes 3-way exchanges are also possible, like it is possible currently in the New England Program [78], and it may also be allowed in the national program of the USA (as it is declared to be a goal of the system in the future in the Proposal for National Paired Donation Program [107]). In Section 4.2, we consider the maximum size and maximum weight exchange prob- lems (also called optimal exchange problem) with length restrictions. In Section 4.3 as a generalization of the houseswapping game, we define and study the so-called stable exchange problems.

4.2 Optimal exchange with restrictions

Here, we prove that the problem of finding a 3-way exchange that covers the maximum number of vertices is APX-hard. We give a 2+ε approximation for the maximum weight 3-way exchange problem, and finally we present an exact algorithm for the weighted version. Suppose that a directed graph D(V, A) is given. Let maxcover l-way exchange CHAPTER 4. EXCHANGE OF INDIVISIBLE GOODS 75 denote the problem of finding an l-way exchange that covers the maximum number of vertices. Furthermore, if w : A(D) R+ is a weight-function on the edges, then let maxweight l-way exchange denote−→ the problem of finding a maximum weight l-way exchange.

4.2.1 The APX-hardness of maxcover l-way exchange In this subsection, we show that maxcover l-way exchange is APX-hard for any constant l 3. ≥ The problem we reduce from and the background of APX-hardness Let G = (V, E) be a simple and undirected graph. A triangle of G is any induced subgraph of G having precisely 3 edges and 3 vertices. A family of triangles T1,...,Tk of G is called a vertex-packing of triangles if T1,...,Tk are vertex-disjoint. The size of this packing is k. The problem of finding a maximum size vertex-packing of triangles in a given graph G, called node-disjoint triangle packing (NTP), is known [50] to be NP-hard. In particular, NTP is known to be NP-hard also in the planar case. Moreover, NTP is known to be APX-hard [64] even for graphs with maximum degree 4 [13]. The above negative results also hold in the case when we restrict the problem to 3-partite graphs, that is, when the vertex set V of G is partitioned into three disjoint color classes V = A B C and no edge of G has its two endvertices in the same color class. Notice that when∪ G∪ has this special structure, every triangle of G must have precisely one vertex in each one of the three color classes. Given a maximization problem P, let optP (I) denote the optimal solution value for some instance I of P and, for a solution S of I, let valP (I,S) denote the associated 1 value. Given a constant ε (0, 1), a 1−ε -approximation algorithm for P is an algorithm that, applied to any instance∈ I of P, runs in time polynomial in the size of I and produces a solution whose value is at least (1 ε) optP (I). If such an algorithm − · exists, P belongs to APX. Moreover, P is said to be APX-hard if the existence of a 1 1−ε -approximation algorithm for P for any ε (0, 1) would imply the existence of a 1 ∈ 1−δ -approximation algorithm for any δ (0, 1) for all problems in APX. To show that P is APX-hard, it sufficies to show a special∈ type of polynomial time reduction from some problem Q already known to be APX-hard to P. An L-reduction [13] from Q to P consists of a pair of polynomial-time computable functions (f,g) such that, for two fixed constants α and β: (a) f maps input instances of Q into input instances of P; (b) given a Q-instance I, the corresponding P-instance f(I), and any feasible solution S for f(I), g(I,S) is a feasible solution for the Q-instance I; (c) optP (f(I)) α optQ(I) | | ≤ | | for all I, and (d) optQ(I) valQ(I,g(I,S)) β optP (f(I)) valP (f(I),S) for each | − | ≤ | − | I and for every feasible solution S for f(I). From this definition it follows that the CHAPTER 4. EXCHANGE OF INDIVISIBLE GOODS 76 relative errors are linearly related, i.e.

optQ(I) valQ(I,g(I,S)) optP (f(I)) valP (f(I),S) | − | α β | − |. optQ(I) ≤ optP (f(I))

1 Hence, if both Q and P are maximization problems, the existence of a 1−ε - 1 approximation algorithm for P implies the existence of a 1−αβε -approximation algo- rithm for Q.

The inapproximability of maxcover 3-way exchange We first illustrate the bare reduction idea for the case l = 3 and then we give a construction to generalize the APX-hardness result to any constant l. Let G =(V, E) be a 3-partite graph received in input and comprising an instance of NTP. Let A, B and C be the 3 color classes in which V is partitioned. We construct a digraph D =(V, A) by simply orienting each edge e of G as follows: if e has one endpoint in A and the other in B, then orient e as to go from A to B; if e has one endpoint in B and the other in C, then orient e as to go from B to C; if e has one endpoint in A and the other in C, then orient e as to go from C to A. To summarize, V (D) := V (G) = A B C, ∪ ∪ and

A(D) := (u, v) uv E(G),u A, v B { | ∈ ∈ ∈ } ∪ (u, v) uv E(G),u B, v C { | ∈ ∈ ∈ } ∪ (u, v) uv E(G),u C, v A . { | ∈ ∈ ∈ } Clearly, the digraph D can be constructed in polynomial time starting from the graph G. Moreover, the following lemma says that the above is an objective func- tion preserving reduction (a primary case of L reduction), whence the claimed APX- hardness result follows.

Lemma 4.2.1. The graph G admits a packing of vertex-disjoint triangles covering t vertices if and only if the digraph D admits a 3-way exchange covering t vertices.

Proof. Three vertices u,v,z V induce a triangle in G if and only if they induce a directed cycle with length 3∈ in D. As a consequence, a packing of triangles in G can be regarded as a 3-way exchange covering precisely the same set of vertices. In the other direction, notice that D contains no digons (anti-parallel arcs). Thus, any 3-way exchange contains only cycles with length 3 and can hence be regarded as a packing of triangles in G covering precisely the same set of vertices.

The inapproximability of maxcover l-way exchange The trick to generalize the above reduction to a generic l 3 is as follows. Once D has been obtained, then obtain a second digraph D′ from D≥ as follows. For each arc CHAPTER 4. EXCHANGE OF INDIVISIBLE GOODS 77

a =(u, v) of D with u C and v A, add the vertices wa, ,...,wa,l and replace the ∈ ∈ 1 −3 arc a =(u, v) with the arcs (u,wa,1), (wa,l−3, v) and (wa,i,wa,i+1) for i =1,...,l 4. To ′ − summarize, V (D ) := V (D) wa,i a =(u, v) A(D),u A, v C, i =1,...,l 3 , and ∪{ | ∈ ∈ ∈ − }

A(D′) := (u, v) uv E(G),u A, v B { | ∈ ∈ ∈ } ∪ (u, v) uv E(G),u B, v C { | ∈ ∈ ∈ } ∪ (u,wa, ), (wa,l , v) uv E(G),u C, v A { 1 −3 | ∈ ∈ ∈ } ∪ (wa,i,wa,i ) uv E(G),u C, v A, i =1,...,l 3 . { +1 | ∈ ∈ ∈ − } Clearly, the digraph D′ can be constructed in polynomial time starting from the graph G. Moreover, the following lemma says that the above is an L-reduction, whence the problem is APX-hard for any constant l. Lemma 4.2.2. The graph G admits a packing of vertex-disjoint triangles covering t vertices if and only if the digraph D′ admits an l-way exchange covering tl/3 vertices. Proof. Notice that D′ contains no directed cycle of length less then l. Moreover, three vertices a A, b B and c C induce a triangle in G if and only if the arc f =(c, a) ∈ ∈ ∈ ′ belongs to D and the vertices a,b,c,wf,1,...,wf,l−4 induce a directed cycle in D . As a consequence, a packing of triangles in G can be regarded as an l-way exchange in D covering precisely l/3 as many vertices. In the other direction, since D′ contains no directed cycle of length less then l, then any l-way exchange contains only cycles with length l and can hence be regarded as a packing of triangles in G covering precisely 3/l as many vertices. Lemmas 4.2.1 and 4.2.2 imply the following theorem. Theorem 4.2.3. maxcover l-way exchange is APX-hard for any integer l 3. ≥ We remark, that maxweight l-way exchange is also APX-hard, since max- cover l-way exchange is its particular problem for unit weights.

4.2.2 Approximation of the maxweight l-way exchange The maxweight l-way exchange problem can be reduced to the maximum weight matching problem in a hypergraph. Let H(V, E) be defined on the same vertex set as D. A hyperedge eX corresponds to a set of vertices X V (D) if X l and there exist ⊂ | | ≤ a directed cycle on X that covers every vertex of X. Let the weight wH (eX ) be equal to the weight of a maximum weight such cycle that can be formed on X. Obviously, there is a one-to-one correspondence between the l-way exchanges in D and the matchings in H. Moreover, the weights of the maximum-weight solutions are equal, so the following problem is a generalization. Given a hypergraph H = (V, E) where every hyperedge has size at most l and a nonnegative weight wH (e) R associated to each hyperedge e. Define maxweight ∈ + CHAPTER 4. EXCHANGE OF INDIVISIBLE GOODS 78 l-set packing to be the problem of finding a maximum weight matching M of H. First we describe two simple l-approximations by greedy algorithms.

Greedy algorithm

The greedy algorithm constructs a matching Mgr in the following way. We start with 0 the original edge set E0 := E(H) and Mgr = . In the i-th iteration we add a maximum i ∅ i−1 weight edge ei to the current matching Mgr := Mgr ei and delete ei together with i ∪ the set of edges that intersect ei, denoted by N (ei), from the current edge set, so i Ei := Ei−1 N (ei) ei. We repeat until all edges are removed. This algorithm\ is\ an l-approximation. To prove this, let denote a maximum weight i i matching by Mopt. We partition Mopt into subsets M , where M denotes the edges of i Mopt that were removed in the i-th iteration of the greedy algorithm. Here, M is either i i equal to ei or it is an independent set of edges from N (ei), so M l. Since each i i | | ≤ edge in N (ei) has weight less or equal to wH (ei), then wH (M ) l wH (ei) holds for ≤ · each index i. By summarizing these inequalities, we get wH (Mopt) l wH (Mgr). ≤ · Mean-greedy algorithm The mean-greedy algorithm is a modification of the above algorithm as we look for a maximum mean-weights edge, that is the original weight divided by the size of the edge. So let mwH (e) := wH (e)/ e for each e E(H), and let the final matching be | | ∈ Mmgr. To prove the approx-factor, we use the similarly defined partition of a maximum i weight solution Mopt into subsets M as for the mean-greedy algorithm. By using a i i similar notation here, M ei . Since each edge in N (ei) has mean-weight less | |≤| | i or equal to mwH (ei), then mwH (M ) ei mwH (ei) = wH (ei) holds for each in- i ≤ | |· dex i, which implies wH (M ) l wH (ei). By summarizing these inequalities, we get ≤ · wH (Mopt) l wH(Mmgr). We remark,≤ · that in a kidney exchange program, the greedy algorithm is likely to choose 3-way cycles first, which are not optimal, since two-way exchanges are more safe. That is why the mean-greedy algorithm seems to be a better heuristic for kidney exchange programs.

Local search The maxweight l-set packing problem can further be reduced to the problem of maxweight independent set in (l + 1)-claw free graphs, by working on the intersection graph of the hypergraph. In this simple graph, L(H) the vertices are the edges of H, and two vertices are adjacent if the corresponding edges intersect. The fact that H contains only edges with size at most l implies that L(H) is an (l + 1)-claw free graph. We define a weight-function on the vertices of L(H) in a natural way: let wL(vX ) = wH (X) if X is an edge in H and vX is the corresponding vertex in L(H). CHAPTER 4. EXCHANGE OF INDIVISIBLE GOODS 79

Obviously, a maximum weight independent set in L(H) corresponds to a maximum weight matching in H (that corresponds to a maximum weight exchange in D). Our goal is to approximate this more general problem. Fix an independent set I in L(G). A natural idea to improve the actual solution is the t-local search (see [12]). This means that we attempt to add an independent set X to I with cardinality at most t and remove the subset of I that is in N(X), so that the total weight increases. If no such t-local improvement exists then the solution is a t-local optimum. Note, that if we compare two disjoint independent sets, say I and Iopt, then these sets can be viewed as the two sides of a bipartite subgraph of L(H). Moreover, each vertex in this subgraph has degree at most l, by the (l +1)-claw freeness of L(H). That is why the conditions of the following theorem can describe the relation of a t-local optimum I and a global optimum Iopt. Theorem 4.2.4 (Arkin, Hassin, 1998). For any given k and t and every instance G =(A, B, E) satisfying the following three conditions:

N(a) k for each a A; • | | ≤ ∈ N(b) k for each b B; • | | ≤ ∈ any subset X A of at most t vertices satisfies w(X) w(N(X)); • ⊆ ≤ we have w(A) 1 k 1+ . w(B) ≤ − t The above theorem obviously implies that a t-local optimum approximates the global optimum with the same factor for any t. By this, it can be proved that an algorithm, based on the t-local search method, also approximates the maxweight l-set packing problem with factor l 1+ ε for any ε> 0. − Augmenting path search Here we show, that the same approximating ratio can be reached by using only a partic- ular t-local search. The t-augmenting path search is a special t-local search, where the new set X is chosen along an alternating path in L(H). Formally, let X = x1, x2,...,xs, where s t and there is a subset Y of the actual solution I, such that Y = s 1 and ≤ | | − X = x1,y1, x2,y2,...xs−1,ys−1, xs is a path in the intersection graph, L(H). Theorem 4.2.5. For any given k and t and every instance G = (A, B, E) satisfying the following three conditions:

N(a) k for each a A; • | | ≤ ∈ N(b) k for each b B; • | | ≤ ∈ CHAPTER 4. EXCHANGE OF INDIVISIBLE GOODS 80

any subset X A of at most t vertices, where X is a set of consecutive vertices • ⊆ in an alternating path of G, satisfies w(X) w(N(X)); ≤ we have w(A) 2 k 1+ . w(B) ≤ − t This theorem implies an alternative proof for the existence of an approximation algorithm – that use “only” augmenting path searches – with factor l 1+ ε for any ε> 0. − We use the following well-known lemma in the proof of Theorem 4.2.5: Lemma 4.2.6. If G(A, B, E) is a k-regular bipartite graph, then the set of edges, E(G) can be partitioned into k perfect matchings. Proof. (of Theorem 4.2.5) We complete G into a k-regular graph G′ by adding dummy vertices with zero weight and some edges. By Lemma 4.2.6 we can partition the set of edges into k perfect matchings. Two of these perfect matchings form a 2- factor, that is a perfect covering by a set of disjoint alternating cycles. Le us fix this 2-factor . The mainC idea of the proof is that the cycles of with length exceeding 2t can be cut into alternating paths of length at most 2t suchC that the total weight of the 2 endvertices of these paths in B is at most t w(B). This is done as follows: Consider a 1 1 2 c c cycle Ci = (Xi Yi)=(xi ,yi , xi ,...,xi ,yi ) from , with Xi = Yi = c > t. We show | C | | | c| that we can always find a set of vertices Ri Yi with cardinality , that satisfies the ⊂ t following properties:  

j p j+1 p+s If r = y and r = y are in Ri then s t (mod c) (4.1) i i i i ≤ w(R ) w(Y ) i i (4.2) Ri ≤ Yi | | | | (Here, property (4.1) ensures that between two consecutive vertices in Ri the dis- tance is at most t. Property (4.2) says that the mean-weight of Ri is less or equal than the mean-weight of Yi.) The proof of the existence is easy: first we choose a set with the given cardinality that satisfies the (4.1) property, then we rotate this set along the cycle (we increase all of the indexes one by one) and we select the set with minimum total weight. Using property (4.2) and c > t, we get

c Ri t 2 w(Ri) | |w(Yi)= w(Yi) < w(Yi) . ≤ Yi c t | | If we consider all of the cycles Ci with length more than 2t, then for R = Ri we have ∈ C ∪ CHAPTER 4. EXCHANGE OF INDIVISIBLE GOODS 81

2 2 w(R)= w(Ri) < w(Yi) w(B). (4.3) t ≤ t i:|XXi|>t i:|XXi|>t Now, we create a partition of A the following way: we restrict the graph of from G′ to G, then we delete the vertices of R. The graph we get consists of disjoint pathsC and cycles - the cycles have length at most 2t whereas the paths contain at most t vertices in A. Form partition from sets of vertices X A that are in the same component in the above graph. Obviously,A for each X the⊆ third condition of the Theorem 4.2.5 ∈A applies. Notice that a vertex b B belongs to at most k sets of the form N(X) with X . Moreover, if b B R,∈ then b belongs to at most k 1 sets of the form N(X) with∈AX since either∈ N\(b) k 1 or b has two neighbors− in the same class of the ∈A | | ≤ − partition . Therefore, by summing up these inequalities and using (4.3), (since only the verticesA of R can be counted k-times, from each of their k neighbors,) we get:

w(A) = w(X) w(N(X)) ≤ XX∈A XX∈A (k 1)w(B R)+ kw(R) (k 1)w(B)+ w(R) ≤ − \ ≤ − 2 < k 1+ w(B) .  − t  The proof is complete.

Combined methods, heuristics Chandra and Halld´orsson [36] showed a 2(l + 1)/3-approximation algorithm for the maxweight independent set problem in (l + 1)-claw free graphs by combining the above presented two methods. Their algorithm starts with an independent set obtained by the greedy algorithm. Then the solution I is improved by a special local search, where the new, added set X is chosen from the neighbors of a vertex from I, in such a way that the ratio of the weights of X and the removed set, N(X) I is always maximal. ∩ We remark, that this algorithm beats the two previously described local search methods for l 5. It is open, whether a better approximation can be achieved by starting with the≥ greedy (or with the mean-greedy) algorithm, and then always making the best t-local improvement (or t-augmenting path improvement). Such an algorithm might be useful as a heuristic for the original problem.

Approximability of maxcover l-way exchange For the approximability of maxcover l-way exchange, a general result of [54] leads to a polynomial time (l/2+ ε)-approximation algorithm (for any ε > 0) for any fixed l. In the special case of l = 3, this gives a (3/2+ ε)-approximation algorithm (for CHAPTER 4. EXCHANGE OF INDIVISIBLE GOODS 82 any fixed ε > 0). An approximation algorithm improving this ratio could be directly translated into an algorithm for NTP with a better approximation guarantee than the one known so far.

4.2.3 Exact algorithm for maxweight 3-way exchange The maxcover 3-way exchange problem is currently solved in the New England Program by integer programming methods as it is described in [91] and [95]. Recently, Abraham et al. [6] implemented such a special IP-heuristic for the maxweight 3-way exchange problem that is capable of handling the data of the USA (for approximately 10.000 couples) according to their simulations. In spite of these promising results, it is still an interesting question to construct an exact algorithm for this special NP-hard problem. Below, we present some ideas about this question that might be useful to improve heuristic algorithms. Fix a maxweight 3-way exchange problem in a digraph D, and an optimal ∗ solution π that contains some 3-way exchanges C ,C ,...,Cl . Suppose that some- { 1 2 } body tells us a list of arcs: one arc from each 3-way exchange, so let Y = a , a ,...al , { 1 2 } where ai Ci. We show that by this information we can efficiently find a maximum weight set∈ of 3-way exchanges. We transform the maxweight 3-way exchange problem to a maximum weight matching problem in an undirected graph GY in the following way. We denote by V (Y ) the set of vertices in D that are covered by Y . Let yi,j V (GY )if(vi, vj) Y , otherwise ∈ ∈ let xi V (GY ) if vi V (D) V (Y ). Let xi, xj E(GY ) if both (vi, vj) and (vj, vi) ∈ ∈ \ { } ∈ ∈ A(D), and let xk,yi,j E(GY ) if both (vk, vi) and (vj, vk) A(D). Considering the ′ { } ∈ ′ ∈ weights, w ( xi, xj ) := w(vi, vj)+w(vj, vi), and w ( xk,yi,j ) := w(vk, vi)+w(vi, vj)+ { } { } w(vj, vk). Obviously, a matching M in GY corresponds to a set of 3-way exchanges π in D, in such a way that xi, xj M if and only if π(vi) = vj and π(vj) = vi is a 2-way { } ∈ exchange in D, furthermore xk,yi,j M if and only if π(vk)=(vi), π(vi)=(vj) and { } ∈ π(vj)=(vk) is a 3-way exchange in D. By this, the weight of a matching M is equal to the weight of the corresponding set of exchanges π. So, if π∗ is an optimal solution in D, and Y is a set of arcs as it is described above, then by solving a maximum weight ∗ matching problem in GY we can find a matching that corresponds either to π or to an other maximum weight set of 3-way exchanges in D.

An exact algorithm can be constructed from the above idea: first we guess a set of arc Yi A(D) and then we find a maximum weight matching in GYi , that corresponds to a feasible⊂ solution in D. The question is how can we reduce the number of guesses.

As a trivial approach, we can try each of the set of arcs, that produce 2m rounds, where m is the number of arcs in D. But obviously, we should try only the independent subsets (i.e. that do not admit two incident arcs). CHAPTER 4. EXCHANGE OF INDIVISIBLE GOODS 83

One idea is to reduce the set of arcs to a subset T , such that by deleting T from D, the obtained subgraph does not contain any cycle with length 3. Since if ∗ C ,C ,...,Cl are the 3-way exchanges of an optimal solution π , then we can always { 1 2 } find a suitable subset YT = a1, a2,...,al from T , as required. If t = T , then the number of guesses is only 2t.{ We note, that} t m always holds, since every| | directed ≤ 2 graph can become acyclic by removing at most half of its arcs. Thus this approach m gives an O(2 2 ) time exact algorithm.

Another idea, is to consider a vertex set S, such that D S (the digraph, obtained by removing the vertices of S from D) does not contain any\ cycle with length 3. For a vertex v let ∆+(v) be the set of arcs with tail from v, and ∆−(v) the set of arcs with head to v. We denote by δ+(v) := ∆+(v) and δ−(v) := ∆−(v) , furthermore, let o(v) := min δ+, δ− and s = S . If we| choose| either ∆+(v) or| ∆−(v| ) for each vertex { } | | v S, (practically to one with less cardinality), that we denote by T ∗(v), then the ∈ ∗ s ∗ union of these sets of arcs: T := i=1T (vi) is a suitable candidate for T , as defined above. Moreover, if we guess an independent∪ set from this T ∗, then obviously it will contain at most one arc from each T ∗(v). This implies that the number of possible s s guesses is at most i=1(o(vi) + 1). Since D is a simple digraph, this gives an n upper bound for the numberQ of rounds.

Finally, we remark, that the latter approach can be useful, because the number of incompatible pairs, that are in fact ABO-compatible, is relatively small in the current pools (these pairs are in the “short side” of the market, see [91] for details). Obviously, without these pairs no 3-way exchange is possible.

4.3 Stable exchange problems

As a generalization of the houseswapping game, we study the question of stable ex- changes, where the length of the cycles in the exchange may be restricted, and the size of the blocking coalitions can also be bounded, independently. We consider the prob- lem of finding weakly, strongly and super-stable exchange in case ties are allowed in the preference lists. We recall the definition of L-preferences introduced in [32]. There, the preferences of the agents are lexicographic, the agents primarily care about the goods that they receive, secondarily they want to minimize the length of their trading cycle. Beside finding a stable solution, another natural goal is to maximize the number of agents involved in the exchange. Here, we describe well-known complexity results from a general point of view, and we present an inapproximability result published in [20] and two theorems on the NP-hardness of some basic 3-way stable 3-way exchange problems. CHAPTER 4. EXCHANGE OF INDIVISIBLE GOODS 84

4.3.1 Stable exchange with ties The stable exchange problem, as we defined it in the Preliminaries, is equivalent to the problem of finding an outcome in the core of the corresponding houseswapping game. In this study we consider the case of strict preferences and also the case of preferences with ties. Strict preference means linear ordering. If some goods are tied in a preference list of agent i, then agent i is indifferent between them. In the stable exchange problem (SE) we suppose that the preferences are strict. The stable exchange problem with ties is denoted by SE+T. Here, we recall again the three main stability concepts introduced in Subsection 1.1.4. for general NTU-games, and specified in Section 2.3 for stable matchings.

An exchange is weakly stable if there exists no blocking coalition B and permu- • tation σ of B, such that each agent i B strictly prefers σ to π. ∈ An exchange is strongly stable if there exists no blocking coalition B and permu- • tation σ of B, such that one of the agents from B strictly prefers σ to π, and each other agent i B either strictly prefers σ to π or is indifferent between them. ∈ An exchange is super-stable if there exists no blocking coalition B and permu- • tation σ of B, such that σ is not equal to π on B and each agent i B either strictly prefers σ to π or is indifferent between them. ∈

The following propositions are obvious. Proposition 4.3.1. Given an instance of SE+T.

4.3.1/a) If an exchange π is strongly stable, then it is also weakly stable.

4.3.1/b) If an exchange π is super-stable, then it is also strongly stable.

Given an instance I of SE+T. If an instance I′ of SE is obtainable from I by breaking the ties, then I′ is a derived instance from I. Proposition 4.3.2. Let I be an instance of SE+T.

4.3.2/a) An exchange π is weakly stable if it is weakly stable in at least one instance I′ of SE that can be derived from I.

4.3.2/b) An exchange π is super-stable if it is super-stable in every instance I′ of SE that can be derived from I. CHAPTER 4. EXCHANGE OF INDIVISIBLE GOODS 85

4.3.2 Stable exchange under L-preferences Under L-preferences, an agent i prefers a permutation π to another permutation σ if he either prefers π−1(i) to σ−1(i) or is indifferent between them, but the length of Cπ(i) is smaller than the length of Cσ(i). This notion was introduced by Cechl´arov´a et al. in [32]. They called the NTU-game related to the problem of SE under L-preferences the kidney exchange game. (To distinguish L-preferences and the original ones, the latter will be referred to as normal preferences hereafter.) We remark, that a similar ordering, the B-preference was defined earlier by Cechl´arov´aand Romero-Medina in [34]. There, an agent i prefers a coalition C to another coalition D, if either he prefers the best member of C to the best member of D, or he is indifferent between them, but the size of C is smaller than the size of D. The following proposition is obvious. Proposition 4.3.3. Given an instance of SE+T.

4.3.3/a) If an exchange π is (weakly) stable under L-preferences, then it is also (weakly) stable under normal preferences.

4.3.3/b) If an exchange π is super-stable under normal preferences, then it is also super-stable under L-preferences.

4.3.3 Restrictions on the lengths Considering an l-way exchange problem, the size of the blocking coalitions can also be restricted. We say that an exchange is b-way stable if there exist no blocking coalition of size at most b. Obviously, the most relevant problems are the ones with l =2, 3. If b = l then a stable exchange is actually a core-solution of the corresponding NTU-game, as it was described in the Preliminaries. The following observations can be easily verified. Proposition 4.3.4. Suppose that π is a b-way stable l-way exchange, then

4.3.4/a) it is also a (b 1)-way stable l-way exchange, and − 4.3.4/b) it is also a b-way stable (l + 1)-way exchange.

A 2-way exchange is called pairwise exchange, that is actually a matching of the agents. Proposition 4.3.5. Given an instance of SE+T.

4.3.5/a) If a pairwise exchange π is (weakly) stable under normal preferences, then it is also (weakly) stable under L-preferences.

4.3.5/b) If a pairwise exchange π is strongly stable under normal preferences, then it is also strongly stable under L-preferences. CHAPTER 4. EXCHANGE OF INDIVISIBLE GOODS 86

The weakest stability condition is the 2-way stability (or in other words, the pairwise stability), where no pair of agents can block a stable solution. Proposition 4.3.6. Given an instance of SE+T.

4.3.6/a) If an exchange π is pairwise super-stable under L-preferences, then it is also pairwise super-stable under normal preferences.

4.3.6/b) If an exchange π is pairwise strongly stable under L-preferences, then it is also pairwise strongly stable under normal preferences.

Corollary 4.3.7. Given an instance I of SE+T. A pairwise exchange π is pair- wise weakly, strongly, super- stable under L-preferences if and only if π is pairwise { } weakly, strongly, super- stable under normal preferences, respectively. { } If we consider strict preferences, then some further statements can be verified. Proposition 4.3.8. Given an instance of SE.

4.3.8/a) If an exchange π is strongly stable, then π is also super-stable.

4.3.8/b) If an exchange π is strongly stable under L-preferences, then π is also super- stable under L-preferences.

Proposition 4.3.9. Given an instance of SE.

4.3.9/a) If a pairwise exchange π is strongly stable under L-preferences, then π is also weakly stable under L-preferences.

4.3.9/b) If an exchange π is pairwise strongly stable under L-preferences, then π is also pairwise weakly stable under L-preferences.

Corollary 4.3.10. In an instance I of SE the same pairwise exchanges are weakly, strongly, super- stable under L-preferences, and strongly, super- stable under{ nor- mal preferences.} Moreover, the same exchanges are{ pairwise weakly,} strongly, super- { } stable under L-preferences, and weakly stable under normal preferences. Thus, in case of pairwise stable pairwise exchanges, these stability concepts are equivalent if the pref- erences are strict.

4.3.4 Maximum size stable exchange problems Beside finding a stable exchange, we may want to find such a stable solution, where the number of covered agents is maximal. We denote the problem of finding such a maximal solution for a stable exchange problem by

maxcover-se in the basic case, (i.e. normal preferences, no ties, no restrictions) • CHAPTER 4. EXCHANGE OF INDIVISIBLE GOODS 87

maxcover- w,su,st -se+t for weakly, strongly, super- stable exchanges • { } { } with ties,

maxcover-Lse under L-preferences, and •

maxcover-sbel for b-way stable l-way exchanges. • 4.3.5 Complexity results We present some complexity results on exchange problems, matching problems and 3-way exchange problems using the above definitions. Some results from Section 2.3 are recalled, and together with the results presented below, collected in a table at the end of this section, with reference indices [Ri].

Exchange problems Shapley and Scarf showed in [103], that there always exists a (weakly) stable exchange in an instance I of SE+T [R8]. Roth and Postlewaite [87] proved that the exchange obtained by the TTC algorithm is super-stable for instances of SE. Moreover, this is the only possible super-stable solution. We remark that this uniqueness holds also for strongly stable exchanges by Proposition 4.3.1/a, but obviously, not for the weakly stable exchanges. Thus here, the maxcover-se problem is nontrivial. In the case of L-preferences, Bir´oand Cechl´arov´a[20] proved recently the following theorem. Theorem 4.3.11. maxcover-Lse is not approximable within n1−ε for any ε > 0 unless P = NP . Sketch of the proof. The proof is based on a gap-introducing reduction starting from min-mm for a cubic graph G of size p with a positive integer K. We create a maxcover-Lse problem I of size n, that contains one directed cycle C of size Θ(n). Here, n >> p and p is fixed, so p can be considered as a constant relative to n. If C is part of an exchange π, then the number of covered vertices is Θ(n), whilst if C does not belong to π then the number of covered vertices is just a constant relative to n. In the proof it is verified that G admits a maximal matching of size at most K if and only if C is part of some stable exchange in I. Thus, an algorithm that could approximate maxcover-Lse in polynomial time within a factor less than Θ(n) would be able to decide min-mm for cubic graphs as well.

Matching problems As we already explained in Section 4.1, the pairwise stable pairwise exchange problem is equivalent to the stable roommates problem. Here, we note that the results, presented in Section 2.3 can be equivalently described by the above definitions as follows. The algorithm of Irving [56] finds a pairwise stable pairwise exchange if there exists one for CHAPTER 4. EXCHANGE OF INDIVISIBLE GOODS 88 the given stable exchange problem [R2]. Theorem 2.3.1 states that the decision problem of finding a (weakly) pairwise stable pairwise exchange in an instance of SE+T is NP- complete [R3]. By Theorem 2.3.2, the decision problem related to maxcover-s2e2+t is NP-complete, even for bipartite graphs [R4]. Recently, Irving [58] showed that the decision problem of finding a cycle stable matching in an instance of the cycle stable roommates problem (SCR) is NP-complete. Moreover, the length of each possible blocking cycle is at most 3 in his construction, so he proved the following: Theorem 4.3.12 (Irving). The problem of finding a stable pairwise exchange in an instance of SE is NP-complete [R9]. The same result holds for 3-way stable pairwise exchanges [R10].

Exchange with restricted lengths Assume now, that the 2-way and 3-way exchanges are also allowed. The following theorems were presented in [19]. Theorem 4.3.13. The 3-way stable 3-way exchange problem in an instance of SE is NP-complete [R11]. Proof. Clearly, the problem is in NP. To show NP-hardness, we give a transforma- tion from weakly srt. This problem is NP-complete [59], even if there is no edge between those vertices that have ties in their preference lists. Let G = (V, E) be the undirected graph in the instance of weakly srt. Without loss of generality, as- sume that v , v ,...,vt V (G) are the vertices that have no tie in their lists, and { 1 2 } ⊆ vt+1, vt+2,...,vn V (G) are the vertices that have preferences with ties. We denote { k } ⊆ by Ti the k-th tie in vi’s preference list. We construct an instance I of SE as follows: let U ′ U ′′ X Y be the set of ′ ∪ ′′ ∪ ∪ vertices of the digraph D. Here U = u ,u ,...,ut and U = ut ,ut ,...,un . { 1 2 } { +1 +2 } Let X correspond to the edges without ties, so xi,j X if vi, vj E(G) for some ∈ { } ∈ i < j and vi is not tied in the preference of vj. Let Y correspond to the ties in the k k lists, so y Y if T exists. We define A(G) in the following way: if vi, vj E(G) for i ∈ i { } ∈ some i < j such that vi is not tied in the preference of vj, then let (vj, vi), (vi, xi,j) and k k k (xi,j, vj) be in A(D). In the other case, if vi Tj , then let (vj, vi), (vi,yj ) and (yj , vj) ∈ ′ ′′ be in A(D). Let the preference list of each ui U U remain similar to vi’s list with some natural modifications: namely, we write∈ ∪ - uj instead of vj if i < j, - xi,j instead of vj if j < i and vj is not tied in vi’s list, and k k - yi instead of tie Ti . k Furthermore, let each yi ’s preference list be arbitrary. (We note that each xi,j has only one incoming arc.) There is no directed cycle with length 2 in D, so only 3-way cycles are possible in the exchange. Moreover, each 3-way cycle in D corresponds to an edge in G. Thus, there CHAPTER 4. EXCHANGE OF INDIVISIBLE GOODS 89 is a one-to-one correspondence between the matchings in G and the 3-way exchanges in D. So let M be a matching in G, we construct a 3-way exchange π in the following way: if vi, vj M for some i < j, where vi is not tied in the preference of vj, then { } ∈ k k let (vj, vi, xi,j) π, otherwise if vi, vj M for some vi T , then let (vj, vi,y ) π. ∈ { } ∈ ∈ j j ∈ Finally, we shall prove that a matching M in G is weakly stable if and only if the corresponding 3-way exchange π is 3-way stable in I. To verify this, it is enough to see that an edge vi, vj / M is blocking for M if and only if the corresponding 3-way cycle is blocking{ for π,} and∈ this is obvious. As a natural generalization of the SM problem, Knuth [67] defined the three-sided stable matching problem. In this special coalition formation game the possible coalitions are (m,w,c) triples (i.e. families) from M W C (i.e. men, women, cats), where M = W = C = n, and everybody prefers× being× in a family to remaining single. | | | | | | Alkan [8] showed that a stable solution may not exist if the preferences of the agents can be arbitrary over the pairs from the other two sides. Moreover, Ng and Hirschberg [79] proved that the problem of determining whether a stable solution exists is NP- complete. Boros et al. [29] showed that the core of this coalition formation game can be nonempty even if the preferences of the agents are lexicographically cyclic (i.e. men primarily care about women, women primarily care about cats, and cats primarily care about men). They raised the same question for purely cyclic preferences, in which the men only care about women, so a man is indifferent between two families if he has the same wife in both of them, (same conditions for women and cats). This problem is equivalent to the 3-way stable 3-way exchange problem for three-sided cyclic digraphs, (i.e. V (D) = M W C and every arc (i, j) A(D) is from either W M or C W or M C∪), in∪ that special case where the∈ sizes of the three sides× are the × × same, and the digraph contains all possible edges. Here, we prove that without the two latter restrictions, the general problem of finding a maximum size 3-way stable 3-way exchange for three-sided cyclic digraphs is NP-hard.

Theorem 4.3.14. The decision problem related to maxcover-S3E3 is NP-complete, even for three-sided cyclic digraphs [R12]. Proof. Clearly, the problem is in NP. To show NP-hardness, we give a transformation from max weakly srt. This problem is NP-complete [74], even if ties occur only in one side of the bipartite graph. The construction is similar to the above. If V (G)= A B, then the three sides of D are U ′ A, U ′′ B and X Y . We can find a weakly∪ stable matching M with ∼ ∼ ∪ M l if and only if for the corresponding 3-way stable 3-way exchange π the number |of covered| ≥ vertices is at least 3l. CHAPTER 4. EXCHANGE OF INDIVISIBLE GOODS 90

4.3.6 Summary, open questions We summarize the presented complexity results in the following table for (weakly) stable exchanges under normal preferences. (Here again, P denotes that the problem is polynomial time solvable, NPc denotes that the (related) problem is NP-complete, (NPh) denotes that the NP-hardness of the problem is obvious from the presented results.) Finally, ??? means that we think that these unsolved problems are relevant, the reasons are explained below. l = 2-way exchange 3-way exchange exchange b = (strict) ties (strict) ties (strict) ties 2-way existence P [R2] NPc [R3] ??? (Yes) (Yes) stable maxcover P NPc [R4] ??? 3-way existence NPc [R10] (NPh) NPc [R11] (NPh) (Yes) (Yes) stable maxcover (NPh) (NPh) NPc [R12] (NPh) (cycle) existence NPc [R9] (NPh) (NPh) (NPh) (Yes) Yes [R8] stable maxcover (NPh) (NPh) (NPh) (NPh) ??? In the current applications of kidney exchange, some programs allow three-way exchanges, and pairwise stability may become a natural expectation. This is why the problem of finding a pairwise stable 3-way exchange in an instance of SE is important. However, it is easy to construct an example to show that such a stable solution may not exist, but the complexity of this problem is unclear. Considering the exchanges without restriction on the cycle-lengths, the TTC algo- rithm always provides a stable exchange, that is also a pairwise stable exchange in an instance of SE. Here, maxcover-se and maxcover-s2e are two important problems to solve. Moreover, the problems of weakly, strongly, super- stable exchange with ties, { } under normal and L-preferences yield various interesting open questions. Bibliography

[1] Atila Abdulkadiro˘glu, Alvin E. Parag A. Pathak, Roth, and Tayfun S¨onmez. The Boston public school match. American Economic Review, Papers and Proceed- ings, 95(2):368–371, 2005.

[2] Atila Abdulkadiro˘glu, Parag A. Pathak, and Alvin E. Roth. The New York City high school match. American Economic Review, Papers and Proceedings, 95(2):364–367, 2005.

[3] Atila Abdulkadiro˘glu and Tayfun S¨onmez. School Choice: A approach. American Economic Review, 93(3):729–747, 2003.

[4] Hern´an Abeledo and Uriel G. Rothblum. Paths to marriage stability. Discrete Appl. Math., 63(1):1–12, 1995.

[5] David J. Abraham, P´eter Bir´o, and David F. Manlove. “Almost stable” matchings in the roommates problem. In Approximation and online algorithms, volume 3879 of Lecture Notes in Comput. Sci., pages 1–14. Springer, Berlin, 2006.

[6] David J. Abraham, Avrim Blum, and Tuomas Sandholm. Clearing algorithms for barter-exchange markets: Enabling nationwide kidney exchanges. To appear in ACM-EC 2007: the Eighth ACM Conference on Electronic Commerce, 2007.

[7] Ron Aharoni and Tam´as Fleiner. On a lemma of Scarf. J. Combin. Theory Ser. B, 87(1):72–80, 2003. Dedicated to Crispin St. J. A. Nash-Williams.

[8] Ahmet Alkan. Nonexistence of stable threesome matchings. Math. Social Sci., 16(2):207–209, 1988.

[9] Ahmet Alkan. A class of multipartner matching markets with a strong lattice structure. Econom. Theory, 19(4):737–746, 2002.

[10] Ahmet Alkan and David Gale. Stable schedule matching under revealed prefer- ence. J. Econom. Theory, 112(2):289–306, 2003.

[11] Nikolay Angelov. Modelling firm mergers as a roommate problem. (preprint).

91 BIBLIOGRAPHY 92

[12] Esther M. Arkin and Refael Hassin. On local search for weighted packing prob- lems. Math. Oper. Res., 23:640–648, 1998.

[13] G. Ausiello, P. Crescenzi, G. Gambosi, V. Kann, A. Marchetti-Spaccamela, and M. Protasi. Complexity and approximation. Springer-Verlag, Berlin, 1999. Com- binatorial optimization problems and their approximability properties, With 1 CD-ROM (Windows and UNIX).

[14] Mourad Ba¨ıou and Michel Balinski. The stable allocation (or ordinal transporta- tion) problem. Math. Oper. Res., 27(3):485–503, 2002.

[15] M. L. Balinski. Integer programming: Methods, uses, computation. Management Sci., 12:253–313, 1965.

[16] Michel Balinski and Tayfun S¨onmez. A tale of two mechanisms: student place- ment. J. Econom. Theory, 84(1):73–94, 1999.

[17] P´eter Bir´o. Stable b-matchings on graphs. 2003. Master’s thesis, Budapest University of Technology and Economics, (in Hungarian).

[18] P´eter Bir´o. Higher education admission in Hungary by a ”score-limit algorithm”. The 18th International Conference on Game Theory at Stony Brook University, 2007.

[19] P´eter Bir´o. Stable exchange of indivisible goods with restrictions. Proceedings of the 5th Japanese-Hungarian Symposium, pages 97–105, 2007.

[20] P´eter Bir´oand Katar´ına Cechl´arov´a. Inapproximability of the kidney exchange problem. Inf. Process. Lett., 101(5):199–202, 2007.

[21] P´eter Bir´o, Katar´ına Cechl´arov´a, and Tam´as Fleiner. The dynamics of stable matchings and half-matchings for the stable marriage and roommates problem. Internat. J. Game Theory, in print.

[22] P´eter Bir´oand Romeo Rizzi. Maximum weight directed cycle packing problem in optimal kidney exchange programs. (working paper), 2007.

[23] Charles Blair. The lattice structure of the set of stable matchings with multiple partners. Math. Oper. Res., 13(4):619–628, 1988.

[24] Yosef Blum, Alvin E. Roth, and Uriel G. Rothblum. Vacancy chains and equili- bration in senior-level labor markets. J. Econom. Theory, 76(2):362–411, 1997.

[25] Yosef Blum and Uriel G. Rothblum. “Timing is everything” and marital bliss. J. Econom. Theory, 103(2):429–443, 2002. BIBLIOGRAPHY 93

[26] O. N. Bondareva. Kernel theory in n-person games. Vestnik Leningrad. Univ., 17(13):141–142, 1962.

[27] O. N. Bondareva. Some applications of the methods of linear programming to the theory of cooperative games. Problemy Kibernet. No., 10:119–139, 1963.

[28] Endre Boros and Vladimir Gurvich. Perfect graphs are kernel solvable. Discrete Math., 159(1-3):35–55, 1996.

[29] Endre Boros, Vladimir Gurvich, Steven Jaslar, and Daniel Krasner. Stable match- ings in three-sided systems with cyclic preferences. Discrete Math., 289(1-3):1–10, 2004.

[30] Katar´ına Cechl´arov´a. Randomised matching mechanism revisited. (preprint), 2002.

[31] Katar´ına Cechl´arov´aand Tam´as Fleiner. On a generalization of the stable room- mates problem. ACM Trans. Algorithms, 1(1):143–156, 2005.

[32] Katar´ına Cechl´arov´a, Tam´as Fleiner, and David F. Manlove. The kidney ex- change game. Proc. SOR’05, Eds. L. Zadik-Stirn, S. Drobne:77–83, 2005.

[33] Katar´ına Cechl´arov´aand Vladimir Lacko. The kidney exchange game: How hard is to find a donor? IM Preprint, 4/2006, 2006.

[34] Katar´ına Cechl´arov´aand Antonio Romero-Medina. Stability in coalition forma- tion games. Internat. J. Game Theory, 29(4):487–494, 2000.

[35] Katar´ına Cechl´arov´aand Viera Valova. The stable multiple activities problem. (preprint), 2005.

[36] Barun Chandra and Magn´us M. Halld´orsson. Greedy local improvement and weighted set packing approximation. In Proceedings of the Tenth Annual ACM- SIAM Symposium on Discrete Algorithms (Baltimore, MD, 1999), pages 169–176, New York, 1999. ACM.

[37] Effrosyni Diamantoudi, Eiichi Miyagawa, and Licun Xue. Random paths to stability in the roommate problem. Games Econom. Behav., 48(1):18–28, 2004.

[38] Jack Edmonds. Maximum matching and a polyhedron with 0, 1-vertices. J. Res. Nat. Bur. Standards Sect. B, 69B:125–130, 1965.

[39] J. Egerv´ary. Matrixok kombinatorius tulajdons´agair´ol. Matematikai ´es Fizikai Lapok, 38:16–28, 1931. BIBLIOGRAPHY 94

[40] Akinobu Eguchi, Satoru Fujishige, and Akihisa Tamura. A generalized Gale- Shapley algorithm for a discrete-concave stable-marriage model. In Algorithms and computation, volume 2906 of Lecture Notes in Comput. Sci., pages 495–504. Springer, Berlin, 2003.

[41] Kimmo Eriksson and Johan Karlander. Stable outcomes of the roommate game with transferable utility. Internat. J. Game Theory, 29(4):555–569, 2000.

[42] Kimmo Eriksson and Jonas Sj¨ostrand. On two theorems of Quinzii and rent controlled housing allocation in Sweden. To appear in International Game Theory Review, 2007.

[43] Kimmo Eriksson and Pontus Strimling. How unstable are matchings from the decentralized mate search? (preprint).

[44] Tam´as Fleiner. Stable and crossing structures. Technische Universiteit Eind- hoven, Eindhoven, 2000. Dissertation, Technische Universiteit Eindhoven, Eind- hoven, 2000.

[45] Tam´as Fleiner. A matroid generalization of the stable matching polytope. In In- teger programming and combinatorial optimization (Utrecht, 2001), volume 2081 of Lecture Notes in Comput. Sci., pages 105–114. Springer, Berlin, 2001.

[46] Tam´as Fleiner. On the stable b-matching polytope. Math. Social Sci., 46(2):149– 158, 2003.

[47] Satoru Fujishige and Akihisa Tamura. A general two-sided matching market with discrete concave utility functions. Discrete Appl. Math., 154(6):950–970, 2006.

[48] D. Gale and L. S. Shapley. College Admissions and the Stability of Marriage. Amer. Math. Monthly, 69(1):9–15, 1962.

[49] David Gale and Marilda Sotomayor. Some remarks on the stable matching prob- lem. Discrete Appl. Math., 11(3):223–232, 1985.

[50] Michael R. Garey and David S. Johnson. Computers and intractability. W. H. Freeman and Co., San Francisco, Calif., 1979. A guide to the theory of NP- completeness, A Series of Books in the Mathematical Sciences.

[51] Donald B. Gillies. Solutions to general non-zero-sum games. In Contributions to the theory of games, Vol. IV, Annals of Mathematics Studies, no. 40, pages 47–85. Princeton University Press, Princeton, N.J., 1959.

[52] Dan Gusfield and Robert W. Irving. The stable marriage problem: structure and algorithms. Foundations of Computing Series. MIT Press, Cambridge, MA, 1989. BIBLIOGRAPHY 95

[53] J. D. Horton and K. Kilakos. Minimum edge dominating sets. SIAM J. Discrete Math., 6(3):375–387, 1993.

[54] C. A. J. Hurkens and A. Schrijver. On the size of systems of sets every t of which have an SDR, with an application to the worst-case ratio of heuristics for packing problems. SIAM J. Discrete Math., 2(1):68–72, 1989.

[55] Elena Inarra, Concepcion Larrea, and Elena Molis. Random path to p-stablility in the roommate problem. Internat. J. Game Theory, forthcoming.

[56] Robert W. Irving. An efficient algorithm for the “stable roommates” problem. J. Algorithms, 6(4):577–595, 1985.

[57] Robert W. Irving. Stable marriage and indifference. Discrete Appl. Math., 48(3):261–272, 1994. Combinatorial Optimization Conference (CO89) (Leeds, 1989).

[58] Robert W. Irving. The cycle roommates problem: a hard case of kidney exchange. Inf. Process. Lett., 103:1–7, 2007.

[59] Robert W. Irving and David F. Manlove. The stable roommates problem with ties. J. Algorithms, 43(1):85–105, 2002.

[60] Robert W. Irving and Sandy Scott. The stable fixtures problem: a many-to-many extension of stable roommates. (submitted).

[61] Matthew O. Jackson and Alison Watts. The evolution of social and economic networks. J. Econom. Theory, 106(2):265–295, 2002.

[62] Mamoru Kaneko. The central assignment game and the assignment markets. J. Math. Econom., 10(2-3):205–232, 1982.

[63] Mamoru Kaneko and Myrna Holtz Wooders. Cores of partitioning games. Math. Social Sci., 3(4):313–327, 1982.

[64] Viggo Kann. Maximum bounded 3-dimensional matching is MAX SNP-complete. Inform. Process. Lett., 37(1):27–35, 1991.

[65] K. M. Keizer, M. de Klerk, B. J. J. M. Haase-Kromwijk, and W. Weimar. The Dutch algorithm for allocation in living donor kidney exchange. Transplantation Proceedings, 37:589–591, 2005.

[66] Alexander S. Kelso and Vincent P. Crawford. Job matching, coalition formation, and gross substitutes. Econometrica, 50:1483–1504, 1982. BIBLIOGRAPHY 96

[67] Donald E. Knuth. Mariages stables et leurs relations avec d’autres probl`emes combinatoires. Les Presses de l’Universit´ede Montr´eal, Montreal, Que., 1976. Introduction `al’analyse math´ematique des algorithmes, Collection de la Chaire Aisenstadt.

[68] Jeroen Kuipers. Combinatorial methods in cooperative game theory. Maastricht University, 1994. PhD Thesis.

[69] M. Le Breton, G. Owen, and S. Weber. Strongly balanced cooperative games. Internat. J. Game Theory, 20(4):419–427, 1992.

[70] L. Lov´asz. Normal hypergraphs and the conjecture. Discrete Math., 2(3):253–267, 1972.

[71] M Lucan, P. Rotariu, D. Neculoiu, and G. Iacob. Kidney exchange program: a vi- able alternative in countries with low rate of cadaver harvesting. Transplantation Proceedings, 35:933–934, 2003.

[72] Jinpeng Ma. On randomised matching mechanism. Econ. Theory, 8(2):377–381, 1996.

[73] David F. Manlove. Stable marriage with ties and unacceptable partners. Tech- nical Report no. TR-0999-29 of the Computing Science Department of Glasgow University, 1999.

[74] David F. Manlove, Robert W. Irving, Kazuo Iwama, Shuichi Miyazaki, and Ya- sufumi Morita. Hard variants of stable marriage. Theoret. Comput. Sci., 276(1- 2):261–279, 2002.

[75] D. G. McVitie and L. B. Wilson. Stable marriage assignment for unequal sets. BIT, 10:295–309, 1970.

[76] Natinal Higher Education Information Centre. http://www.felvi.hu.

[77] National Resident Matching Program. http://www.nrmp.org.

[78] New England Program for Kidney Exchange. http://www.nepke.org.

[79] Cheng Ng and Daniel S. Hirschberg. Three-dimensional stable matching prob- lems. SIAM J. Discrete Math., 4(2):245–252, 1991.

[80] Boris G. Pittel and Robert W. Irving. An upper bound for the solvability prob- ability of a random stable roommates instance. Random Structures Algorithms, 5(3):465–486, 1994.

[81] Antonio Romero-Medina. Implementation of stable solutions in a restricted matching market. Review of Economic Design, 3(2):137–147, 1998. BIBLIOGRAPHY 97

[82] Eytan Ronn. NP-complete stable matching problems. J. Algorithms, 11(2):285– 304, 1990.

[83] Alvin E. Roth. The evolution of the labor market for medical interns and resi- dents: a case study in game theory. Journal of Political Economy, 6(4):991–1016, 1984.

[84] Alvin E. Roth. Stability and polarization of interests in job matching. Econo- metrica, 52(6):47–57, 1984.

[85] Alvin E. Roth. Conflict and coincidence of interest in job matching: some new results and open questions. Math. Oper. Res., 10(3):379–389, 1985.

[86] Alvin E. Roth and Elliott Peranson. The redesign of the matching market for American physicians: Some engineering aspects of economic design. American Economic Review, 89(4):748–780, 1999.

[87] Alvin E. Roth and Andrew Postlewaite. Weak versus strong domination in a market with indivisible goods. J. Math. Econom., 4(2):131–137, 1977.

[88] Alvin E. Roth, Tayfun S¨onmez, and M. Utku Unver.¨ Kidney exchange. J. Econom. Theory, 119:457–488, 2004.

[89] Alvin E. Roth, Tayfun S¨onmez, and M. Utku Unver.¨ A kidney exchange clear- inghouse in New England. American Economic Review, Papers and Proceedings, 95(2):376–380, 2005.

[90] Alvin E. Roth, Tayfun S¨onmez, and M. Utku Unver.¨ Pairwise kidney exchange. J. Econom. Theory, 125(2):151–188, 2005.

[91] Alvin E. Roth, Tayfun S¨onmez, and M. Utku Unver.¨ Coincidence of wants in mar- kets with compatibility based preferences. American Economic Review, (forth- coming).

[92] Alvin E. Roth and Marilda A. Oliveira Sotomayor. Two-sided matching, vol- ume 18 of Econometric Society Monographs. Cambridge University Press, Cam- bridge, 1990. A study in game-theoretic modeling and analysis, With a foreword by .

[93] Alvin E. Roth and John H. Vande Vate. Random paths to stability in two-sided matching. Econometrica, 58(6):1475–1480, 1990.

[94] S. L. Saidman, Alvin E. Roth, Tayfun S¨onmez, M. Utku Unver,¨ and S. L. Del- monico. Increasing the opportunity of live kidney donation by matching for two and three way exchanges. Transplantation, 81(5):773–782, 2006. BIBLIOGRAPHY 98

[95] S. L. Saidman, Alvin E. Roth, Tayfun S¨onmez, M. Utku Unver,¨ and S. L. Delmonico. Utilizing list exchange and undirected good samaritan donation through chain paired kidney exchanges. American Journal of Transplantation, 6(11):2694–2705, 2006.

[96] Herbert Scarf. The computation of economic equilibria. Yale University Press, New Haven, Conn., 1973. With the collaboration of Terje Hansen, Cowles Foun- dation Monograph, No. 24.

[97] Herbert E. Scarf. The core of an N person game. Econometrica, 35:50–69, 1967.

[98] Alexander Schrijver. Combinatorial optimization. Polyhedra and efficiency. Vol. A, volume 24 of Algorithms and . Springer-Verlag, Berlin, 2003. Paths, flows, matchings, Chapters 1–38.

[99] Sandy Scott. A study of stable marriage problems with ties. 2005. PhD Thesis, University of Glasgow.

[100] S. L. Segev, S. E. Gentry, D. S. Warren, B. Reeb, and R. A. Montgomery. Kidney paired donation and optimizing the use of live donor organs. J. Am. Med. Assoc., 293:1883–1890, 2005.

[101] L. S. Shapley. On balanced sets and cores. Naval. Res. Logist. Quart., 14:453–460, 1967.

[102] L. S. Shapley and M. Shubik. The assignment game. I. The core. Internat. J. Game Theory, 1(2):111–130, 1972.

[103] and Herbert Scarf. On cores and indivisibility. J. Math. Econom., 1(1):23–37, 1974.

[104] Jimmy J. M. Tan. A necessary and sufficient condition for the existence of a complete stable matching. J. Algorithms, 12(1):154–178, 1991.

[105] Jimmy J. M. Tan and Yuang Cheh Hsueh. A generalization of the stable matching problem. Discrete Appl. Math., 59(1):87–102, 1995.

[106] S. H. Tijs, T. Parthasarathy, J. A. M. Potters, and V. Rajendra Prasad. Permu- tation games: Another class of totally balanced games. OR Spectrum, 6:119–123, 1984.

[107] United Network for Organ Sharing. http://www.unos.org.

[108] A. A. Vasin and V. A. Gurviˇc. Reconcilable sets of coalitions. In Questions in applied mathematics (Russian), pages 20–30. Sibirsk. Energet.` Inst., Akad. Nauk SSSR Sibirsk. Otdel., Irkutsk, 1977. BIBLIOGRAPHY 99

[109] Y Yuan. Residence exchange wanted: A stable residence exchange problem. Eu- ropean Journal of Operational Research, 90:331–341, 1996.