Legal Assignments and fast EADAM with consent
via classical theory of stable matchings
Abstract
Gale and Shapley’s college admission problem and concept of stability [13] have been extensively studied, applied, and extended. In school choice problems, mechanisms often aim to obtain an assignment that is more favorable to students. We investigate two extensions introduced in this context – legal assignments [24] and the EADAM algorithm [18] – through the lens of classical theory of stable matchings. In any instance, the set of legal assignments is known to contain all stable assignments. We prove that is exactly the set of stable assignments in another instance, and that essentially any optimization problem over can be solved within the same time bound needed for solving them over the set of stable assignments. A key tool for these results is an algorithm that finds the studentoptimal legal assignment. We then generalize our algorithm to obtain the output of EADAM with any given set of consenting students without sacrificing the running time, hence improving over known algorithms in both theory and practice. Lastly, we investigate how larger the set can be compared to the set of stable matchings in the onetoone case, and connect legal matchings with certain concepts and open problems in the literature.
Keywords: stable matchings, distributive lattice, rotations, school choice problem, legal assignments, EADAM algorithm, Latin marriages.
1 Introduction
Stable matchings and stable assignments are fundamental paradigms in operations research and the design of matching markets. Since the seminal work of Gale and Shapley [13], these concepts have received widespread attention for their mathematical elegance and broad applicability (see e.g. [15, 28, 30]). Those two facets are tightly connected. A detailed understanding of the lattice structure of stable matchings led to many fast algorithms for e.g. enumerating all stable matchings [14] and finding a stable matching that maximizes some linear profit function [16]. In turns, these algorithmic results propel the application of stable matchings to many matching markets, such as college admission, assignment of residents to hospitals [27], and kidney transplant [29].
One of the most important applications, the school choice problem, considers the assignment of high school students to public schools. After the pioneering work of Abdulkadiroğlu and Sönmez [1], many school districts, such as New York City and Boston, subsequently adopted the studentoptimal stable mechanism for its fairness (no priority violation or stability) and strategyproofness (for students). The mechanism asks students to report their (strict) preferences of the schools and schools to report their priorities^{1}^{1}1Priorities are preferences with ties, as schools usually rank students based on categorical information such as demographics, test scores, etc. (preferences with ties) over the students. It then randomly breaks ties in the latter to obtain an instance of the stable assignment problem and performs the GaleShapley algorithm^{2}^{2}2In some literature, GaleShapley algorithm is referred to as Deferred acceptance. In this paper, we stick to GaleShapley. to obtain the studentoptimal stable assignment.
However, in this setting, schools are often perceived as commodities, and only students’ welfare matters. Hence, enforcing stability implies a loss of efficiency. Abdulkadiroğlu et al. [2] demonstrate the magnitude of such efficiency loss with empirical data from the New York City school system, where over 4,000 eigth graders in their sample could improved their assignments if stability constraints were relaxed. Striving to regain this loss in welfare for the students, many alternative concepts and mechanisms have therefore been introduced and extensively studied (see e.g. [3, 11, 18, 19, 24]).
Those mechanisms lead therefore to solutions outside the wellstructured set of stable matchings. As a consequence, adhoc structural studies and algorithms must be presented. Unfortunately, properties of the former and performance of the latter rarely match theory of and algorithms for stable matchings [18, 19, 31]. This harms the applicability of such mechanisms, especially if school districts were to address two of the major concerns economists have regarding the current school choice design. One concern is that the way ties are broken in priorities affects the quality of the outcome [11]. The other concern is that the constraint on the number of schools a student can rank [26] puts mechanisms at risk of manipulation [7]. Hence, if school districts were to remove the capping on the number of choices and/or were to test different tiebreakers, fast algorithms for those alternative mechanisms and an improved understanding of the structure of feasible solutions would be useful in applications.
This paper focuses on two concepts introduced to regain the loss of welfare in the school choice problem: legal assignments [24] and EADAM with consent [18]. Legal assignments form a superclass of stable assignments. They share many interesting properties with stable assignments, e.g. lattice structure and consequently the existence of a studentoptimal legal assignment. EADAM operates by iteratively asking for students’ consent to “waive” their priority at certain schools and rerun the GaleShapley algorithm. The output of EADAM is constrained efficient [31]. That is, the assignment does not violate any nonconsenting students’ priorities, but any other assignment that is weakly preferred by all students does. Hence, when all students consent, the output of EADAM is Pareto efficient for students, and it is known to coincide with the studentoptimal legal assignment [24].
The goal of our paper is to use classical theory of stable matchings to achieve a better structural and algorithmic understanding of these two extensions. In fact, although both EADAM and legal assignments have been further analyzed and extended by several authors (see e.g. [8, 10, 19, 4, 32]), our knowledge of those two concepts is far from complete. In particular, the knowledge of a lattice structure alone gives little information on how to exploit it for algorithmic purposes, e.g. how to find the legal assignment that maximizes some linear profit function^{3}^{3}3A typical example are strongly stable matchings, which have been known for a long time to form a distributive lattice [22], but only recently was this structure exploited for algorithmic purposes [21].. Moreover, little is known on how to exploit the structure of legal assignments to obtain the output of EADAM when not all students consent, since the output assignment may not be legal.
1.1 Our Contribution
Our first contribution deals with the structure of legal assignments. We prove in Section 3 that the set of legal assignments coincide with that of stable assignments in a subinstance of the original one. Hence, legal assignments inherit all structural properties of stable assignments. This result, in particular, greatly simplifies the treatment from [24], where the lattice structure is proved from scratch.
As our second contribution, in Section 6 we show how to obtain the aforementioned subinstance in time linear in the number of edges of the input. Hence, in order to solve an optimization problem over the set of legal assignments (e.g. to find the already mentioned schooloptimal, or other assignments of interest as the egalitarian, profitoptimal, minimum regret), one can resort to the broad literature on algorithms developed for the same problem on the set of stable assignments (see e.g. [23] for a collection of those results). Since the worstcase running time of those algorithm is at least linear in the number of the edges, the complexity of those problems over the set of legal assignments does not exceed their complexity over the set of stable assignments. To achieve this second contribution, we first extend classical concepts of rotations and rotation digraphs in Section 4; we then developed a pair of algorithms in Section 5, which we name rotateremove (Algorithm 1) and reverse rotateremove (Algorithm 2), that respectively find the schooloptimal and studentoptimal legal assignments.
Our third contribution is a fast algorithm for EADAM with consent. Algorithmic results above imply that, when all students consent, EADAM can be implemented as to run with the same time complexity as that of GaleShapley’s. However, when only some students consent, the output of EADAM may no longer be legal (see Example 7.3). We show in Section 7 how to modify reverse rotateremove to produce the output of EADAM again within the same time bound as GaleShapley’s. Computational tests performed in Section 7.5 confirm that our algorithms run significantly faster in practice.
As last contribution, we show that relaxing the stability condition to legality can greatly increase the size of the set of feasible matchings. We provide instances with one stable matching and exponentially many (in the number of men and women) legal matchings. This is achieved by an exploration of the connection between legal matchings and Latin marriages, introduced by [6] in relationship with a classical, longstanding open question of Knuth [20] on the maximum number of stable matchings an instance can have. We defer details to Section 8.
Our algorithm implementation for (1) finding studentoptimal and schooloptimal legal assignments and for obtaining the legal subinstance; and for (2) EADAM with consent can be found online^{4}^{4}4(1). https://github.com/xz2569/LegalAssignments. (2).https://github.com/xz2569/FastEADAM. .
1.2 Literature Review
There is a vast amount of literature on mechanism design for the school choice problem, balancing their focus among strategyproofness, efficiency and stability. From a theoretical prospective, Ergin [12] shows that under certain acyclicity conditions on the priority structure, the studentoptimal stable assignment is also Pareto efficient for the students. Kesten [18] interprets these cycles as the existence of interrupting pairs and proposes the EADAM mechanism, which improves efficiency while simultaneously maintaining stability by obtaining students’ consent to waive their priorities.
Extending upon Kesten’s framework, many researchers offer new perspectives. Tang and Yu [31] propose a simplified algorithm for EADAM, which repeatedly runs GaleShapley algorithm after fixing the assignments of underdemanded schools. Bando [5] shows an algorithm which iteratively runs GaleShapley algorithm after fixing the assignments of the set of last proposers. Bando [5] also shows that when restricting to onetoone setting, his algorithm finds the studentoptimal von NeumannMorgenstern (vNM) stable matching. vNM stable set is a concept proposed by Von Neumann and Morgenstern [33] for cooperative games. In the college admission problem, the definition of legal assignments by Morrill [24] corresponds to vNM stable set. In onetoone setting, results from [9] and [34] show existence and uniqueness of the vNM stable set. Morrill [24] further proves the existence and uniqueness result in the onetomany setting, as well as the fact that they have a lattice structure. Wako [34] presents an algorithm that finds the man and womanoptimal vNM stable matchings, and show that vNM stable matchings coincide with stable matchings in another instance. However, Wako [34] points out that his algorithm does not directly apply to the onetomany setting, and he poses as an open question to find one such algorithm.
Our results answer this open question. We remark that, although there is a standard reduction of onetomany instances to onetoone instances [15, 28] such that the set of stable assignments of the former and the set of stable matchings of the latter correspond, such onetoone mapping fails for the set of legal assignments (see Example 3.2). So we need to directly tackle the onetomany setting.
2 Basic Mathematical Models
We introduce here basic notions and facts. We point readers to the book by Gusfield and Irving [15] for a more comprehensive introduction on stable marriage and stable assignment problems.
For , we denote by the set . All (di)graphs in this paper are simple. All paths and cycles in (di)graphs are therefore uniquely determined by the sequence of nodes they traverse, and are denoted using this sequence, e.g. . We call a sequence of distinct nodes a chain of a digraph if for each , is an arc of . The edge connecting two nodes in an undirected graph is denoted by . For a graph and , we denote by . A singleton of a graph is a node of degree . For sets , denotes their symmetric difference.
2.1 Stable Marriage Problem
An instance of the stable marriage problem is a pair where is a bipartite graph with bipartition and denotes , with being a strict ordering of the neighbors of in . Elements of are referred to as men, and elements of as women. For , , we say strictly prefers to if , and we say that prefers to and write if or . Similar definitions are employed for and . If and are matched in matching , we say that and are partners in and we write and . If is not matched in , we write . If (resp. ), we say that strictly prefers (resp. prefers) to and similarly for . A pair is said to block a matching , or to be a blocking pair for , if and . In particular, a blocking pair is an edge of . Hence, we often drop the brackets and simply write , also omitting to specify each time that and . Similarly, we say that any matching containing blocks . A matching is stable for if there is no edge of that blocks . We denote by the set of matchings of , and as the set of stable matchings of .
2.2 Stable Assignment Problem
An instance of the stable assignment problem, also know as the college assignment problem, is a triple where and are defined as in the stable marriage problem, and denotes the maximum number of vertices in that can be assigned to each . is called the quota of . Elements of are referred to as students and elements of as schools. The definition of prefers to , or and of the symmetric concepts for are immediate extension of the equivalent concepts in the marriage case.
An assignment for an instance is a collection of edges of such that: at most one edge of is incident to for each ; at most edges of are incident to for each . We write . We call a blocking pair for if , and either for some or . In this case, we say that blocks , and similarly, we say that blocks for every assignment containing edge . An assignment is stable if it is not blocked by any edge of . Extending the notations from the stable marriage problem, let be the set of assignments of , and let be the set of stable assignments of . For a subgraph of , we denote by the stable assignment instance whose preference lists are those induced by on and quotas are those obtained by restricting to nodes in .
Asssignments output by GaleShapley’s algorithm(s) play a special role. We refer e.g. to [15] for details on those algorithms.
Theorem 2.1.
The studentproposing (resp. schoolproposing) GaleShapley algorithm outputs a stable assignment (resp. ) such that (resp. ) for any and stable assignment .
2.3 Reduction: Stable Marriages to Stable Assignments
A stable assignment instance can be transformed into a stable marriage problem via the following wellknown reduction [15, 28]. For each school , create copies of , say , and replace in the preference list of each adjacent by the copies in exactly this order. The preference list of each is identical to the preference list of . We call these copies seats of the schools and denote their collection by . With this reduction, we can construct a map that induces a bijection between and . Given , assume for some , and . Define for and for . For the sake of shortness, we often abbreviate .
3 Legal Assignments are Stable Assignments in Disguise
Throughout the section, we fix an instance of the stable assignment problem and let , . For a set , define as the set of assignments that are blocked by some assignment and define as the set of assignments that are not blocked by any assignment in . That is, . We say a set has the legal property if . We devote this section to the proof of the following theorem.
Theorem 3.1.
Let be an instance of the stable assignment problem. There exists a unique set that has the legal property. We call the set of legal assignments. This set coincides with the set of stable assignments in , where is a subgraph of . Moreover, .
As introduced in Section 2, there is a onetoone correspondence between stable assignments in and stable matchings in the reduced instance . One could think of proving Theorem 3.1 by showing the (simpler) results for the stable marriage instance , and then deducing the set of legal assignments of from the set of legal matchings of . Unfortunately, the bijection between stable assignments and stable matchings does not extend to the legal setting, as next example shows.
Example 3.2.
Consider an instance with students and schools, each with seats. Let , , represent students, schools, and seats respectively. The preference lists are given as follows. In this and all following examples, when it is clear whose preference list we are referring to, the subscript in is dropped.
Since all preference lists are complete, we can restrict our attention to the assignments where all students are matched. One can easily verify that is the only stable assignment, and all other assignments are blocked by some pair in , hence they are all illegal. Thus, . Now, consider the reduction to the stable marriage problem. The preference lists can be expanded:
The corresponding matchings and their blocking pairs are:
is the only stable matching. All other matchings except for are blocked by some edge in (underlined). Hence, one easily verifies that , but .
Before proving Theorem 3.1, we show some preliminary results. The proof of Lemma 3.5 is immediate from Lemma 4.3. However, the proof of the latter requires concepts and machinery developed later in Section 4 – hence, we postpone the proof of Lemma 3.5 to that section.
Lemma 3.3.
Consider an instance of stable marriage problem with . Let . Call an edge irregular if both and strictly prefer to or both strictly prefer to . Suppose does not block and does not block . Then:

there are no irregular edges;

is a disjoint union of singletons and cycles;

a node is matched in if and only if it is matched in .
Proof. 1) Assume is an irregular edge and assume wlog both endpoints strictly prefer to . Then , because otherwise blocks . Starting from , iteratively define and . Repeatedly using the assumption that and do not block each other, we deduce that, for all , strictly prefers to , and vice versa strictly prefers to . Moreover, and . Since , are matchings, there exists such that . Hence, strictly prefers to , a contradiction.
2) Note that the degree of each node in is at most . Suppose the thesis does not hold, then contains a path, say wlog , whose endpoints have degree 1 in . Assume wlog that . Since is unmatched in , strictly prefers to . In addition, since does not block , strictly prefers to . We can iterate and conclude, similarly to part , that all nodes strictly prefer to , and vice versa all nodes strictly prefer to . Suppose first that is the last edge of the path. Then strictly prefers to as and , a contradiction. Similarly, if the last edge is , strictly prefers as is unmatched in , again a contradiction.
3) Immediately from 2).
Lemma 3.4.
Let be an instance of the stable assignment problem. Let be such that does not block , and does not block . Fix that is matched in . Then is matched in . Let therefore , . If , then there exists such that and .
Proof. We first claim that does not block , and does not block , where and is the mapping defined in Section 2. It then follows from Lemma 3.3, part 3) and the definition of mapping that is matched in . It is enough to show that does not block . Assume by contradiction that there exists that blocks . That means and . If where , then , for some , and thus blocks , a contradiction. So assume for some . Since , we have by construction of . Then by the definition of , , a contradiction.
Let and . By Lemma 3.3, part 2), there exists a cycle in , and this cycle has no irregular edges. Since , (i) all nodes from strictly prefer to , and viceversa (ii) all nodes from strictly prefer to . Recall that is the collection of seats in the reduced instance . Let be such that all nodes of that precede in are not seats of , while all nodes that follow in are seats of . Note that is welldefined, since terminates with (hence possibly ). Let , i.e. . By (i) above, , hence , as required. Moreover, (where the strict preference follows from (ii) and the nonstrict one from the definition of mapping ), hence , as required.
Lemma 3.5.
Let be an instance of the stable assignment problem. Let be an edge of that is not in any stable assignment. Assume that there exist stable assignments and such that and . Then, there exists a stable assignment such that and for all .
The previous facts on stable assignments will prove useful for the proof of Theorem 3.1. Lemmas 3.6 and 3.10 mirror similar ones that already appeared in [24], but we prove them here within our framework to make our treatment selfcontained. Define and iteratively for .
Lemma 3.6.
There exists such that .
Proof. For , let . We show by induction on that , which concludes the proof. Clearly . Now fix . Since , we deduce . Hence,
where in the containment relation we use and therefore .
For that satisfies Lemma 3.6, we let . For , let and .
Lemma 3.7.
Assume satisfies . Then , where .
Proof. Suppose . Then there is a matching and an edge that blocks . But then . Hence, . Conversely, suppose . If , then is blocked by some . This means a matching in blocks , implying . If , then contains an edge that is not in . This implies and thus .
Lemma 3.8.
, where .
Proof. The containment relationship is clear from definition. So it suffices to show . Assume by contradiction that there exists an edge . Let be an assignment such that . Let (resp. ) be the stable assignment output by the students (resp. schools) proposing GaleShapley algorithm in . Since , we have by Lemma 3.7. By construction, . In the following, when talking about a specific execution of the GaleShapley algorithm, we say that rejects if during the execution, rejects the proposal by , possibly after having temporarily accepted it. We distinguish three cases.
Case a): . By the choice of , we know that and do not block each other. Note that this case contains all and only the edges that have been rejected by some (equivalently, any) execution of the studentproposing GaleShapley algorithm on . Among all those edges, pick the one that is last rejected by some execution of the algorithm. Apply Lemma 3.4 (with and ) and conclude that there exists such that and . implies that rejected during the execution of GaleShapley in consideration. Hence, when proposes to , either still has to be rejected by , or it has been rejected before. In the latter case, has her quota filled and rejects some other student when proposes. Hence the following events happen in this order during the execution of GaleShapley: is rejected by ; proposes to ; rejects a student. This contradicts our assumption that is the last rejected edge.
Case b): . By Lemma 3.5, there exists a stable assignment such that and for all . Again by choice of , and do not block each other. We can therefore apply Lemma 3.4 (with the roles of and inverted) and conclude that there exists with , a contradiction.
Case c): . Using Lemma 3.4 (with and ) we deduce that there exists such that and . Hence, in some (equivalently, any) iteration of the schoolproposing GaleShapley algorithm, rejects . Since this is the last case that still needs to be considered, we may assume edges are exactly those rejected by some execution of the schoolproposing GaleShapley algorithm. Among all such edges, take that is the last rejected by some execution. Applying Lemma 3.4 again (with , , ), we know for some . This implies that rejected during the execution of GaleShapley in consideration. Hence, when proposes to , either still has to be rejected by , or it has been rejected before. In the latter case, when proposes to , rejects the school it temporarily accepted. Hence, the following events happen during the considered execution in this order: rejects ; proposes to ; rejects a school, contradicting the choice of .
Lemma 3.9.
has the legal property. That is, .
Proof. Clearly . Now take . Then . Hence, is an assignment of not blocked by any assignment from , where the last equality holds by Lemma 3.7. By Lemma 3.8, is not blocked by any edge in , and we conclude that .
Because of Lemma 3.9, we say that is a legal partition of .
Lemma 3.10.
is the unique subset of with the legal property.
Proof. Assume by contradiction that there exists a set , with the legal property. Let . If , we must have . Take any , it must be blocked by some assignment in . But we also have , which contradicts the assumption that has the legal property. Similarly, we cannot have . Thus, sets and are both nonempty. In addition, let . It is also nonempty because all stable assignments are contained in any set with the legal property. In particular, . Note that every assignment in is blocked by some assignment from . Moreover, () no assignments from can be blocked by any assignments from . Now take the first such that , and note that . Let . All assignments blocking must be contained in . Thus, we can pick . Hence, is blocked by some assignment in (containment relation due to the choice of ), contradicting ().
Since a graph may have exponentially many assignments, we cannot efficiently deduce graph by explicitly keeping track of , etc. In Section 6, we will show an algorithm for computing . Some machinery for this algorithm is developed in Section 4 and Section 5.
We then introduce the classical concept of rotations in stable marriages and investigate its extension to stable assignments.
4 Lattice and Rotations
In this section, we first present the known lattice structure associated to stable assignments. We then introduce and investigate an extension of the classical concept of rotations from stable marriage (see e.g. [15]) to stable assignment. Due to the natural asymmetry of the problem, we distinguish between school and studentrotations, treated in Section 4.1 and 4.2, respectively. For the sake of readability, we keep technical details to the minimum, postponing most of them to the appendix, which also includes a treatment of rotations in the marriage case. Even though definitions we introduce do not explicitly rely on the latter, proofs do so extensively, and are therefore also deferred to the appendix. The main takehome message of this section is the following. Informally speaking, a rotation exposed in a stable matching is a certain alternating cycle such that is a stable matching. We show in this section that rotations in the stable marriage instance associated to a stable assignment instance (see Section 2.3) behave in a very structured manner. Indeed, constructing from will have the following effect on : each school will either not change its assigned students, or replace its least preferred student only. This allows us to define an extension of rotations directly on , and show that it inherits many properties of rotations in the marriage setting.
Throughout the section, fix a stable assignment instance , with . We say a pair is stable if there exists a stable assignment where is assigned to . Given , we say dominates (and write ) if for every student , . If moreover , we say that strictly dominates and write . The following fact is wellknown (see e.g. [15]).
Theorem 4.1.
endowed with the dominance relation forms a distributive lattice. The stable assignment (resp. ) such that (resp. ) for all is called the studentoptimal (resp. schooloptimal) stable assignment. Moreover, if and , then for every school , for all and .
Note that the studentoptimal (resp. schooloptimal) stable assignment coincides with the one output by the GaleShapley algorithm with students (resp. schools) proposing, as described in Theorem 2.1 (hence, the notation describing those assignments coincide).
4.1 Studentrotations
Let . For a student , define to be the first school on ’s preference list such that for some . Note that if , we must have . Also note that such might not exist. If exists, define as the least preferred student is assigned to in , i.e. and for all , . Note that if has no assigned students then .
Given distinct and , a cycle of is a studentrotation exposed in if , and for all (hence – indices are taken modulo ). Note that studentrotations exposed in are in onetoone correspondence with directed cycles in the studentrotation digraph , with vertex set and arcs