Fairness and Efficiency in Two-Sided Matching Markets
Abstract
We propose a new fairness notion, motivated by the practical challenge of allocating teaching assistants (TAs) to courses in a department. Each course requires a certain number of TAs and each TA has preferences over the courses they want to assist. Similarly, each course instructor has preferences over the TAs who applied for their course. We demand fairness and efficiency for both sides separately, giving rise to the following criteria: (i) every course gets the required number of TAs and the average utility of the assigned TAs meets a threshold; (ii) the allocation of courses to TAs is envy-free, where a TA envies another TA if the former prefers the latter’s course and has a higher or equal grade in that course. Note that the definition of envy-freeness here differs from the one in the literature, and we call it merit-based envy-freeness. We show that the problem of finding a merit-based envy-free and efficient matching is NP-hard even for very restricted settings, such as two courses and uniform valuations; constant degree, constant capacity of TAs for every course, valuations in the range , identical valuations from TAs, and even more. To find tractable results, we consider some restricted instances, such as, strict valuation of TAs for courses, the difference between the number of positively valued TAs for a course and the capacity, the number of positively valued TAs/courses, types of valuation functions, and obtained some polynomial-time solvable cases, showing the contrast with intractable results. We further studied the problem in the paradigm of parameterized algorithms and designed some exact and approximation algorithms.
Keywords and phrases:
Fair Matching, Envy-Freeness, EfficiencyCopyright and License:
2012 ACM Subject Classification:
Theory of computation Algorithmic game theory and mechanism designEditors:
C. Aiswarya, Ruta Mehta, and Subhajit RoySeries and Publisher:
Leibniz International Proceedings in Informatics, Schloss Dagstuhl – Leibniz-Zentrum für Informatik
1 Introduction
Assigning teaching assistants (TAs) to courses is a practical challenge faced by many academic departments. The allocation should be fair for both instructors and TAs, taking into account their preferences and qualifications. For example, if a TA is willing to assist in a systems course, it is not desirable to assign them a theory course. On the contrary, it may also happen that a TA might like to assist in a course (maybe because their friends are assisting in that course or course is less loaded), however he does not have enough knowledge in that course. Considering some of these critical requirements of instructors and TAs, our department follows the following protocol: we ask TAs to submit their preferences over the courses they would like to assist with and their grades in those courses, and then instructors are asked to submit their preferences over the TAs who are interested in their courses. We try to ensure that every course gets the required number of TAs (at least some of the choice of instructor) and prioritise the choice of the TAs with higher grades. However, finding a satisfactory allocation that meets the requirements of both sides is not trivial. In this paper, we address this problem from a theoretical perspective, using tools from algorithms and computational social choice theory.
1.1 Mathematical Formulation
We have a set of courses and a set of TAs . Every TA has a utility for every course, i.e., for every , we have a utility function . Furthermore, every TA has a grade function . For simplicity, we assumed that every TA has done all the courses (grade can be considered if a TA has not credited a course). Every course has a capacity (that captures the required number of TAs), and a utility function . If a TA has utility for the course , then , otherwise . This is a valid assumption, as we would like to respect the choices of a TA. A matching is feasible if for every course , , i.e., TAs are assigned to the course , and no TA is assigned to a zero-valued course. We call that a matching is fair if it is feasible and for a given , it satisfies the following two conditions.
-
Satisfaction of Courses.111This is efficiency criteria. But, we include it in the definition of fair matching for brevity. For every course , is at least .
-
Merit-based envy-freeness between TAs. A TA envies another TA on merit basis if and , i.e., grade of in the course allocated to is at least the grade of in that course and values the course allocated to more than their own allocated course. In the matching , there should not be any pair of merit-based envious TAs.
We call this fair matching as merit-based envy-free egalitarian (MEFE) matching, and the problem of finding such a matching as MEFE-Matching.
Highest grade vs highest utility in a course.
It seems desirable to assume that the highest grader in a course will have the highest utility. However, this need not be the case. There might be other responsible factors for course utilities. For example, if a TA applicant has previously done a relevant course or project under the course instructor who trusts the TA’s expertise in the area and soft skills, the instructor would probably assign a higher utility for that TA. A TA applicant with prior experience at TAship or a recommendation from other instructors might also be assigned higher utility due to their experience. While TAs might have done the course previously, they may have done it in different universities. In such a case, it is hard to gauge a TA accurately just based on their grades. Thus, we demand utility functions from the courses separately.
1.2 Significance of our Fairness Notions
The deferred-acceptance algorithm (commonly-used algorithm in two-sided markets) is biased towards one side of the agents [14], which is not desirable for our application. Thus, we move our attention to some of the well-studied fairness criterion used in the field of fair allocation.
On the course side, we considered criteria similar to egalitarian welfare, but we take the average for the following reason: suppose that there is a course with capacity and a course with capacity . Now, if we require a threshold for satisfaction, say , then the course gets a very good TA; however, course may get TAs each with utility . To avoid such a predicament, we considered average. Since we require good TAs in all the courses, we think egalitarian type criteria is a better choice over other welfare functions such as utilitarian or Nash. We believe that envy-freeness (the most popular fairness criteria in fair allocation) is not suitable here for the following reason: what if everybody gets a bad set of TAs? Nobody may envy anybody, but this is a disastrous situation for everyone. We also believe that instructors care more about their TAs instead of comparing them with the TAs of other courses.
On the TAs side, we considered envy-freeness type fairness. As discussed earlier, it is important to consider grades as well. Indeed if a matching is envy-free, then it is also merit-based envy-free. However, it is possible that there exists a merit-based envy-free matching even if envy-free matching does not exist. Consider a classical example of non-existence of envy-free solution, when there is only one course with capacity , and two TAs , both value positively. This does not have envy-free solution (irrespective of actual valuations). But, if values (say ) more than and the grade of is more than , then we match with , and it is a merit-based envy-free solution. As discussed earlier, conceptually also, it is crucial to consider grades.
Since grades need to be considered, egalitarian criteria is not interesting for TAs.
Interestingly, MEFE matching is also a weakly stable matching when course satisfaction is not under consideration or utility of course for TA is same as the grade of in the course , however the converse need not be true. For contradiction, we assume that the MEFE-Matching solution is not weakly stable. Let the blocking pair be . Then prefers over and has a higher grade in than . Hence envies , a contradiction. The converse may not be true. For example, consider an instance with 1 course and 2 TAs both having the same grade in the course, with the course having capacity 1. Any assignment will be weakly stable as the course is indifferent between the two TAs but the unassigned TA will always envy the assigned TA. Additionally, if the course values both TAs less than , no assignment would lead to satisfaction of the course.
It can be seen that merit-based envy-freeness exactly aligns with justified envy-freeness (as, for instance, characterized by Yokoi in [39]) when course utility for a TA equals the grade of the TA in that course, with equalling 0, all TAs assign distinct utilities to courses, and no two TAs have the same grade in a course. Therefore, MEFE-Matching serves as a generalization of the justified envy-freeness model.
Indeed, there are several notions of fairness in the fair allocation literature, which will be interesting to consider, and some are already considered (see Related Work).
1.3 Broader applications of MEFE-Matching
We discuss two other practical applications of MEFE-Matching. The MEFE-Matching model might be applied in a job market with a mediator company. Job applicants (analogous to TAs in our model) hold utilities over the firms (analogous to courses in our model) that the mediator company has ties with. Each of these firms might hold tests (grades in a course) specific to them, conducted by the mediator company. However, the firms assign utilities to applicants based on resume shortlisting, HR rounds, and test scores. Here, applicants might envy each other based on their preferences (utilities assigned by TAs) and test scores for companies. And firms would want to ensure that they are satisfied with the applicants that are allocated to them.
We could also use MEFE-Matching in Medical Residency Matching. Residency applicants (TAs) hold utilities over residencies (courses). Additionally, applicants might have grades in related areas to the residencies they are applying to. Residencies hold utility over applicants based on performance in relevant areas, clinical experience, and interviews.
1.4 Our Contribution
Our model considers a fairness criterion for TAs and an efficiency criterion for courses. This is motivated by the fact that the requirements of both sides in matching under two-sided preferences need not be the same. This is our first conceptual contribution.
Next, we move to our technical contribution. Table 1 summarises our complexity results. Some of the technical highlights of our work are discussed below. Throughout the paper, by degree of a course, we mean the number of TAs positively valued by the course. Similarly, we define the degree of a TA, as the number of courses positively valued by a TA.
| courses | Capacity | Degree | Types of valuations | Result | Theorem |
| 2 | - | of TA = 2 | by TA = 1 | NP-hard | [1] |
| - | 1 | of TA / course | by course = 1 | NP-hard | [2] |
| - | 1 | - | - | polynomial | [7] |
| - | 2 | of TA , course | by course = 3,by TA = 1 | NP-hard | [4] |
| - | c | of course | - | polynomial | [5] |
| - | - | of TA = 1 | - | polynomial | [8] |
| - | - | - | by course = 2 | polynomial | [11] |
| constant | constant | - | - | polynomial | [10] |
| - | constant | - | by course = constant | [13] | |
| - | - | - | - | [12] | |
| - | constant | - | - | - approximation in | [14] |
Hardness Results
Unsurprisingly, similar to many problems in Fair Allocation, the problem is NP-complete for two courses (Theorem 1), due to a reduction from the Equal-Cardinality Partition problem. In this reduction, the degree of courses is “large”, however the degree of TAs is two. Furthermore both the courses have same valuation functions and all the TAs equally value all the courses, in fact, their grade is also same in all the courses. We next ask the question: does the large degree of courses lead to intractability? Surprisingly, the problem is NP-complete even when the degree of courses is three (Theorem 2). In the same reduction, the degree of TAs is also constant, in particular, three. In fact, the capacity of all the courses is one and each course values all positively valued TAs equally (refer to the theorem statement for more restrictions). In light of Theorem 2, we next ask: do the different valuations of TAs lead to intractability? Theorem 4 answers this question negatively. The next set of results, highlights more about the inherent nature of instance that leads to intractability.
Polynomial Time Algorithms
We observe that the large degree of courses is not responsible for the intractability; rather, the difference between degree and capacity is one of the responsible factors. In Theorem 2, the difference between degree and capacity is two. In Theorem 5, we show that the problem is polynomial-time solvable when this difference is at most one (the actual value of degree and capacity does not matter). This result also resolves the complexity when the degree of courses is two (Corollary 6), contrasting Theorem 2. We further observed that when the capacity of each course is one, then the same valuations of a TA for multiple courses lead to intractability, which is easy to avoid, but if all TAs value positively valued courses differently, then it leads to tractability (Theorem 7). Due to Theorem 1, we have hardness when the number of courses is two and the degree of TAs is two. When we relax one of these constraints, i.e., the degree of TAs is one or there is only one course, it leads to tractability (Theorem 8 and Corollary 9). In all our hardness results, either the capacity of courses is constant, or the number of courses is constant. When both are constant, then it leads to a tractability result (Theorem 10). Contrasting Theorem 4, Theorem 11 shows that the problem is polynomial-time solvable when every course has at most two distinct positive valuations for all TAs, but, here we require that for a course no two TAs have the same grade (which is not a very strict restriction if we consider actual marks).
Parameterized (Approximation) Algorithms
MEFE-Matching has some natural parameters to consider: the number of TAs (), then number of courses (), the maximum degree of courses/TAs (), maximum capacity of a course (), the number of distinct valuation/grade functions (), maximum value that a valuation/grade functions can take (). Theorem 12 shows positive results with respect to . Due to Theorem 2, we have paraNP-hardness with respect to . Thus, we cannot hope for a fixed-parameter tractable(FPT) algorithm with respect to the combination of these parameters. We design an FPT algorithm with respect to when and are constant for courses, no TA values two courses equally and no course has same grade for two TAs (Theorem 13). When we relax the constraint of constant (i.e., it is no longer constant) and is a function of , then we obtain a -approximation algorithm that approximates satisfaction of every course and runs in (Theorem 14). Note that due to Theorem 1, we cannot hope for an FPT algorithm with respect to .
Existence of Solution
In Section 7, we identify two yes-instances and some no-instances of the problem.
1.5 Related Work
The literature on matching under two-sided preferences is vast. It originated from the seminal work of [14] on the stable matching problem. The unfairness of the deferred-acceptance algorithm, together with the immense practical applicability of stable matchings, has generated considerable interest in developing algorithms for finding fair stable matchings. Several fairness concepts have been studied in conjunction with stability, including strong and super stability [21], minimum regret [28], egalitarian [33, 22],222In the stable matching literature, the term egalitarian matching has been used for matchings that maximize the total satisfaction of the agents by minimizing the sum of ranks of the matched partners [33, 22]. This objective is different from egalitarian welfare, which maximizes the utility of the least-happy agent, which we considered. median [38, 37], sex-equal [19], balanced [11, 18], leximin [35], and Nash [25].
For the related work on matching on one-sided preferences (a field of Fair Allocation), we refer the reader to recent surveys [1, 31, 34]. For two-sided preferences, we refer the reader to the following literature [6, 2, 32].
Freeman et al. [13] consider envy-freeness up to one good and maximin share guarantee under two sided-preferences. But, in their model, the fairness criteria are the same on both sides. However, this is the first work (to the best of our knowledge) that borrows fairness notions from the fair division literature to the two-sided preferences, conceptually closer to our work. Bu et al. [5] extended this work and considered the fairness criterion envy-freeness up to -good and proportionality up to -good. They also considered the same fairness criteria on both the sides. Patro et al. [36] considered envy-freeness up to one individual on one side and maximin share on the other side. Gollapudi et al. [16] also considered envy-freeness up to one individual on both the sides along with the maximum weight of the matching in case of repeated matchings. Igarashi et al. [20] considered stability condition along with envy-free up to one individual for one side of the agents. Recently, Sung-Ho Cho [7] studied the problem from a mechanism design perspective and considered envy-freeness up to -peers. There are several other papers that study fairness in two-sided preferences (not directly related to our work) [27, 10, 26, 3, 17, 29]. Indeed the list is not exhaustive.
Bredereck et al. [4] also studied local envy-freeness in house allocation problems where each agent receives only one item. Our model generalizes local envy-freeness as follows. We create a directed graph for each course, where TA has an arc to TA if has a grade at least as high as in that course. We seek an envy-free allocation from the TAs’ perspective that meets this condition: if course is assigned to , let be the set of courses values more than . We then check the local envy-free condition for in all graphs corresponding to the courses in .
2 Preliminaries
Throughout the paper, denotes an instance of MEFE-Matching, where and . In general, we assume that , since each course has capacity at least 1. If , we will have a trivial no-instance. When referring to an element , without a subscript, we may use grade function , and utility function , both with subscript . Similarly, when referring to a course , without a subscript, we may use utility function . By degree of a course, we mean the number of TAs positively valued by the course. Similarly, we define the degree of a TA, as the number of courses positively valued by the TA. We denote the degree of course/TA by . For a course , is the set of all TAs positively valued by . Similarly, for a TA , is the set of all courses positively valued by . We define a similar notion for (or ) as follows: .
By types of valuations of a course/TA , we mean the number of distinct positive values assigned by to TAs/courses. The functions and are identical, if for all , . A function whose range is is called binary. For , we also use the notation for the utility or grade function of .
Let be a matching. If a course (TA) is not matched to a TA (course) in (), then we call it unassigned or unsaturated with respect to ; otherwise it is called assigned or saturated.
For an instance of MEFE-Matching, let be a bipartite graph such that . Note that can be a disconnected graph. We skip the subscript , if the instance is clear from the context.
In parameterized algorithms, given an instance of the problem , and an integer (called a parameter), the goal is to design an algorithm that runs in time, where is an arbitrary computable function depending on the parameter . Such algorithms are known as FPT algorithms. If there exists an FPT algorithm with respect to the parameter for the problem , we say that “ can be solved in ”.
3 Hardness Results
In this section, we prove the intractability of the problem even for very restricted cases. Given a matching , checking whether the feasibility constraint is satisfied can be done in polynomial time. Verifying the satisfaction constraint for a course takes time. Finally, to check the merit-based envy-freeness condition for a TA , we compare the grades of all TAs matched to courses preferred by over its assignment, which can be done in polynomial time. Thus, the problem is in NP.
Our first intractability result is for two courses with identical valuations, where degree of TAs is two, contrasting Theorem 8 and Corollary 9.
The result is due to the polynomial-time reduction from the Equal-Cardinality Partition problem, in which given a multiset of positive integers, the goal is to partition into two subsets of the same size that have the same sum. This problem is known to be NP-complete [15].
Theorem 1 ().
333Proof of all the theorems/lemmas/claims marked with can be found in the full version of the paper [24].MEFE-Matching is NP-complete even when there are two courses with identical valuation functions; grades and valuations from TA side are .
Note that if we constraint the types of valuation by the courses to be a constant, (order ), in addition to the constraints in Theorem 1, the problem becomes polytime. Indeed, since each course can assign TAs according to only one of valuation types, with grades and valuations from TA side being , we can simply enumerate all possible combinations of assignments of TAs to the 2 courses in time given by . We can then check whether any of these assignments leads to a MEFE matching in polynomial time.
Next, we show that the problem is NP-complete even when the degree of courses and TAs is three, and capacity of each course is one. The result is due to a polynomial-time reduction from (3-3)-com smti, which is known to be NP-complete [23, Theorem 5].
Theorem 2.
MEFE-Matching is NP-complete even when for all , i.e., utility function is derived from grades and the capacity of each course is one; each TA has degree at most three, valuations and grades are in , and no TA has same grade for any two courses. It is also NP-hard when each course has binary valuation function, with all other constraints remaining the same.
Proof.
We give a polynomial-time reduction from the (3-3)-com smti problem. In (3-3)-com smti, we have sets of men and women. For , let denote the preference list of . We assume that without loss of generality (i.e., the following constraints hold for the preference lists of each woman in (3-3)-com smti as well). The list is an ordered sequence of disjoint subsets of women which represents a partial order over the women, where women in earlier subsets are preferred over women in later subsets, and women in the same subsets are tied. We define as the total number of women appearing in , and (3-3)-com smti requires that . Women which do not appear in are considered unacceptable by . In (3-3)-com smti, the goal is to find a weakly stable matching of men and women, given the above constraints.
Let be an instance of (3-3)-com smti such that the ties are only on the women’s side. We construct an instance of MEFE-Matching as follows. Let and , i.e., for each man , we have a course , and for each woman , we have a TA . For every course , , if man ranks woman at position ; otherwise . We next define a set of valuation functions of TAs. It is according to the preference list of women. If woman ranks man at position , then the utility of TA for the course is , if is not in the preference list of woman , then . Next, we define a grade function for every course based the preference list of men, which is strict. If man ranks woman at position , then the grade of TA for the course is , if is not in the preference list of woman , then . The capacity of each course is one and . Next, we prove the correctness. In particular, we prove the following.
Lemma 3.
is a yes-instance of (3-3)-com smti if and only if is a yes-instance of MEFE-Matching.
Proof.
In the forward direction, let be a solution to . We claim that is also a solution to . Clearly, is a feasible matching as every course is matched to one TA. Furthermore, for every course , as for all who are in preference list of and if a woman is matched to a man then must be in the preference list of . Next, we argue that is merit-based envy-free. Note that is a perfect matching. Thus, every TA is matched to a course. Furthermore, every TA is matched to a course with non-zero utility due to the construction and the fact that is a solution to (3-3)-com smti. Suppose that TA envies TA , then we have . Due to construction and the fact that ties belong to only women side, equality is not possible. Hence, . Also, which means and , which contradicts the fact that is a stable matching.
In the reverse direction, let be a solution to . We claim that is a solution to . Recall that the capacity of every course is one in . Thus, saturates all men. Since, the number of courses and TAs is same and every course is matched to only one TA, every TA is matched to a course in . Thus, is a perfect matching. Moreover, for every course , as we have for matched pair (). Each man is matched with a woman who is in his preference list and hence, each woman also is matched with a man in her preference list due to construction. Next, we claim that is weakly stable. Towards the contradiction, suppose that there is a pair such that and
. Thus, due to the construction of the instance , , and . Thus, TA envies TA , which contradicts that is a solution to .
The transformation can be carried out in polynomial time since, for each pair , the values , , and can be computed by scanning the preference lists of and , each of which has length at most . Thus, the total time required to construct the instance is . This completes the NP-hardness proof when course utilities are derived from grades. The binary case is similar. Here, the course valuation would be defined as follows: for every course , if woman is in the preference list of man , otherwise . The proof remains same for binary valuation function.
Our next intractability result is when TAs have binary valuations and grades in the range , other than the constraints on degrees and capacities. The result is due to a polynomial-time reduction from the -dimensional Perfect Matching problem.
Theorem 4 ().
MEFE-Matching is NP-complete even when each course has capacity two, degree six, and valuations in ; each TA has binary valuation function, and grades in .
4 Polynomial Time Tractable Cases
In this section, we identify some instances that can be solved in polynomial time. We first consider the case when the difference of the degree and capacity of each course is at most one.
Theorem 5.
MEFE-Matching can be solved in when the difference between the degree and capacity of each course is at most one.
Proof.
We visualize an instance of MEFE-Matching as a bipartite graph and note that can be a disconnected graph. However, it is sufficient to solve each component separately, as we do not assign -valued TAs to a course. Let be a maximal connected subgraph of . For the ease of notation, we reuse as the bipartiton of as well, where is the set of courses and TAs, respectively, in . Let and . We find an MEFE matching, if it exists, for . We design the algorithm based on the structure of the graph. We first consider the case the graph has a course with degree equalling capacity. If not, then we further consider other cases: whether it is acyclic, or contains one cycle, or contains at least two cycles. In the case of two cycles, we argue that it is no-instance. In the other cases, for a yes-instance, the intuitive idea is that there exists a TA/course whose assignment or decision that it is unassigned dictates the whole matching. Note that such a TA/course should be chosen carefully as every choice does not fix the matching.
Case 1: There exists a course such that .
Let be the set of courses in such that , where . We construct a matching as follows: for each , . If and are not disjoint, for any , then we return NO. Otherwise, we call (Algorithm 1) and find a matching . The intuition is that we consider a course whom we did not assign TAs yet, such that one of the positively valued TAs it has an edge with has already been assigned to a course. Thus, all the remaining TAs positively valued by this course must be assigned to it (we will argue in the correctness proof that for a yes-instance, only one of its TA is assigned to another course). If is a solution to , we return it; otherwise, we return NO.
Input: a connected graph , a matching , a set of TAs , a set of courses
Output: a matching
Case 2: For all the courses , .
Case 2.1: is acyclic, i.e., a tree.
In this case, . Furthermore, since is a bipartite graph, . Thus,
This implies that Since , we have that
Hence, there is only one TA that is unassigned in any feasible solution to . We guess this TA, say . Now, we need to assign all TAs in to the courses in . The intuitive idea is that since is unassigned, for all the courses that have positive valuations to , we only have capacity many choices. Thus, the allocation of all these courses is fixed. Since the graph is connected, this eventually fixes the allocation of all the courses. Algorithm 2 describes the algorithm formally.
Input: a connected graph
Output: either a matching , or NO.
Case 2.2: contains only one cycle.
Let be the cycle in . Clearly, there exists an edge in whose deletion makes the graph acyclic. Thus, in this case, . Furthermore, . Thus, by equating the above two expressions just as we did in Case 2.1, we get . Therefore, all TAs need to be assigned in a feasible matching for this case. Let denote the set of courses and TAs, respectively, in . We guess whether or is assigned to (one of them has to be assigned as ). After this guess, an allocation for all the courses gets “fixed”, i.e., there is a unique choice of allocation. Algorithm 3 describes the algorithm formally.
Input: a connected graph
Output: either a matching , or NO.
Case 2.3: contains more than one cycle.
The algorithm returns NO in this case.
The detailed proof of correctness and running time analysis can be found in the full version [24].
Due to Theorem 5, we have the following result, which is in contrast to Theorem 2 when considering the degree of courses.
Corollary 6.
MEFE-Matching can be solved in polynomial time when the degree of courses is at most two.
Our next tractability result is in contrast to Theorem 2, as it reduces the problem to Weighted Strongly Stable Matching with Ties and Incomplete Lists (WSSMTI) in polynomial time, which can be solved in polynomial time [30].
Theorem 7 ().
MEFE-Matching can be solved in when the capacity of each course is one, and each TA has distinct valuations for positively valued courses.
Our next result is in contrast to Theorem 1. The result is due to the observation that a TA with high grade needs to be prioritised over low grade TAs in a solution. Thus, we sort the TAs based on their grades and match the top capacity many TAs to the course. We also observe that an instance can be partitioned into distinct sub-instances, where each sub-instance has only one course.
Theorem 8 ().
MEFE-Matching can be solved in when the degree for each TA is one.
Corollary 9.
MEFE-Matching can be solved in polynomial time when the number of courses is one.
Proof.
The degree of every TA is 1 when the number of courses is one. Hence Theorem 8 is applicable.
Another restricted instance we analyze is one in which the capacities of all courses are constant, and the number of courses is also constant. In this case, the total number of possible solutions are polynomial which can be enumerated in polynomial time. Hence, we have the following result.
Theorem 10 ().
MEFE-Matching can be solved in when the number of courses and capacity of each course is constant.
Next, we consider the case when every course has only two positive distinct values for TAs, and obtain the tractability, with some restrictions on valuations and grades of TAs.
Theorem 11.
MEFE-Matching can be solved in when every course has only two distinct positive valuations, and for a course no two TAs have the same grade. Furthermore, each TA has distinct valuations for positively valued courses.
Proof.
Let be an instance of MEFE-Matching such that , where are positive integers, and for any pair of TAs , , for any course . Without loss of generality, let . Next, we find the number of and valued items assigned to in a solution. Let be the number of and valued items assigned to , respectively. If , then . Otherwise, we find the following equations for each course independently. Due to our feasibility and satisfaction constraints for courses, we know that for each ,
| (1) | ||||
| (2) |
If the set of the above two equations does not have a solution, then clearly, is a no-instance of MEFE-Matching. Suppose that there is a solution of the set of Equation 1 and 2 for every course. If we solve these two equations, we obtain that and . Note that if is negative, then , which violates the feasibility of a matching. Thus, if , it is a no-instance. So next we assume that . We choose and . We next give a polynomial time reduction from MEFE-Matching to the Stable Matching problem for bipartite graphs, in which given a set of men, say , and women, say , a preference list of women over men, a preference list of men over woman, (preference lists might be incomplete); the goal is to decide whether there exists a matching such there is no pair of man and woman such that (i) is unmatched or prefers over his matched partner, and (ii) is unmatched or prefers over her matched partner. Such a pair of is called a blocking pair, and a matching without blocking pairs is called a stable matching.
We create an instance of the Stable Matching problem as follows. The set of men is , i.e., corresponding to every TA in , we have a man in . Corresponding to every course , we have women, say . If , let , and if , let . Next, we define the preference list of every woman , say , as follows. For every , man is in if and only if the valuation of course for the TA is . For every woman , man is in the preference list of if and only if the valuation of course for TA is positive. Recall that in an instance of the Stable Matching problem a man is on the preference list of a woman if and only if is in the preference list of . Next, we define the ordering of men in the preference list of every woman, which is based on the grades. Since no two TAs have the same grade for a course, for men in , woman prefers more than if and only if . Next, we define the ordering of women in the preference list of every man. Let be the set of women in the preference list of the man . Consider a man . If , where , then man prefers women in more than woman , where . Furthermore, if and , then prefers more than . If , then order them arbitrarily; similarly women in are ordered arbitrarily. This completes the construction of .
Proof of correctness and running time analysis can be found in the full version [24].
5 Parameterized (Approximation) Algorithms
In this section, we consider the problem in the realm of parameterized algorithms to cope with the intractability. We first consider the parameter (the number of TAs.). The following result is due to trying all possible partitions of TAs.
Theorem 12 ().
MEFE-Matching can be be solved in , where is the number of TAs.
Next, we move our attention to the parameter , the number of course. The next algorithm is similar to the one in Theorem 11. But, here we have constant number of distinct positive valuations for each course, rather than just two. So, we guess the number of TAs of each value assigned to a course in a solution. Note that we also consider constant capacity for each course. The rest of the algorithm is similar. In the algorithm in Theorem 11, we know the upper bound for , but here, we know the exact values, and hence add the edges accordingly in the Stable Matching instance.
Theorem 13.
MEFE-Matching can be solved in when every course has constant number of distinct positive valuations and capacity, and for a course no two TAs have the same grade. Furthermore, each TA has distinct valuations for positively valued courses.
Proof.
Let be an instance of MEFE-Matching that satisfies the constraints in the theorem statement. Let , where is a constant. Let be the number of TAs of value assigned to the course in a solution, where . We guess the values of , for all , that satisfies the following two constraints.
| (3) | ||||
| (4) |
Note that we have choices for vector for every course . A vector is called valid, if it satisfies Equation 3 and 4. Since the capacity of each course and is constant, we have constant choices for every course. Hence, we have total choices, where is a constant.
For each combination of valid vectors (one for each course) , we create an instance of the Stable Matching problem as follows. The set of men is , i.e., corresponding to every TA in , we have a man in . Corresponding to every course , we have a set of women that contains many women. If any of these sets are empty we ignore those sets. Let be set of all women corresponding to course . Due to the validity of the vector, corresponding to every course , we have women. Next, we define the preference list of every woman , say , as follows. For every , man is in if the valuation of course for the TA is . Recall that in an instance the Stable Matching problem a man is in the preference list of a woman if and only if is in the preference list of . Thus, woman is in , the preference list of , if and only if is in . Next, we define the ordering of men in the preference list of every woman, which is based on the grades. Let be a women corresponding to the course . Since no two TAs have the same grade for a course, for men in , prefers more than if and only if . Next, we define the ordering of women in the preference list of every man. Consider a man . If , where , then man prefers women in more than woman in , where . If , then we first note that there exists unique such that , due to the construction. In this case, man orders them arbitrarily. This completes the construction of . If any of the constructed instance of Stable Matching returns a women-saturating stable matching, then we return “yes”, otherwise “no”.
The proof of correctness can be found in the full version [24].
Next, we design a parameterized approximation scheme with respect to the parameter , and , where is maximum value assigned to a TA by a course. Our basic idea is that for appropriately chosen , we guess the number of TAs assigned to course that have valuations in the range , for every course . Then, we create the number of copies of a course accordingly and reduce to the Stable Matching problem as in Theorem 13.
Theorem 14 ().
MEFE-Matching admits an algorithm that given a yes-instance outputs a matching in which for every course , , where , when the capacity of each course is constant, no two TAs have the same grade for a course, and each TA assigns distinct utilities to each course, and runs in , where is the maximum capacity of a course and is the maximum valuation of a course for a TA, .
6 Relevance and Tractability of Results
In this section, we discuss the relevance of our results with respect to the constraints they require and their computational efficiency. We first contrast the results with a brute-force approach.
The brute-force algorithm is to try all possible allocations of TAs to faculty. Thus, the running time is ( for the case that a TA might not be assigned to any course). Theorem 12 is this brute-force algorithm that leads to as for a yes-instance because every course has capacity at least one. Theorem 13 establishes a running time bound of , where is a constant. The number of TAs is usually larger than the number of courses; thus, this algorithm is faster than the brute-force algorithm. Note that the constraints in Theorem 13 do not change the running time of the brute-force algorithm. Similarly, the FPT-AS algorithm of Theorem 14 achieves a running time that improves upon the brute-force approach. We also believe that the constraints in Theorem 13 and 14 are natural. E.g., using TAs’ course marks, which are likely distinct and can serve as grades. We can also ask TAs to submit distinct utilities for distinct courses. It is realistic to assume that a course’s TA requirement remains constant (required in Theorems 13, 14) and that courses consistently split TAs into a constant number of utility brackets (e.g., good, average, bad) (required in Theorem 13).
We now move on to other results with practical constraints and polynomial running times. Theorem 11 considers bi-valued functions from the side of courses, capturing scenarios where instructors rank TAs as “like” or “dislike”, a generalization of the binary case. For computationally hard problems, binary or bi-valued valuations are well-studied in Fair Allocation. Theorem 7, meanwhile, relies on the assumption that each course requires only one TA, which models contexts where only a few students opt for advanced electives and simplifies the assignment process.
7 Existence Results
In this section, we identify some yes and no instances of the problem.
7.1 Yes-instances of MEFE-Matching.
We begin by identifying instances where the solution is guaranteed to exist. Before presenting our first result, we define some notation.
Let be a rank function such that has th lowest grade in the course , for each . Here, denotes the size of the set . Let . We denote where . Note that if the number of TAs, , is smaller than , then will be undefined. However, we can easily identify such a case as a trivial non-instance since no feasible matching exists that meets each course’s capacity constraint .
Now, we are ready to present our first existential result.
Theorem 15 ().
Let be an instance of MEFE-Matching such that
-
(i)
every TA has the following valuation function for courses, given by , for each ;
-
(ii)
for every course and TA , , i.e., the utility of course for TA is the same as her grade in course ;
-
(iii)
for every subset , .
-
(iv)
for every course , there should not be two distinct TAs such that but , i.e., no two TAs positively valuing a course should have the same grade for that course.
Then, for , a MEFE matching always exists.
Our next positive existence result is because MEFE-Matching instance satisfying constraints in Theorem 16 can be reduced to Hospitals Residents problem (HR).
Theorem 16 ().
Let be an instance of MEFE-Matching such that all TAs and courses positively value each other and each TA must assign distinct valuation to courses and all the TAs have distinct grades/marks in a course. Then, MEFE always exist for .
7.2 No-instances of MEFE-Matching.
Each yes-instance discussed in the previous section has multiple constraints. In this section, we discuss that none of the constraints mentioned for positive existence results are by themselves sufficient for the existence of a MEFE matching. If course utilities are grades, i.e., for all , with no other constraints, the answer to the existence question is NO. For example, in an instance with a single course having capacity 1 and 2 TAs having the same grade, the unassigned TA will always envy the other, so no MEFE matching exists. If , with no other conditions, the answer is again NO, as the above example is a NO instance for this case. If all TAs and courses positively value each other, without further restrictions, the answer remains NO. For example, we take an instance with a single course having capacity 1 and 2 TAs, where both TAs positively value the course and the course positively values both TAs, and courses assign utilities less than to both TAs. For this instance, no MEFE matching exists, since the course satisfaction criteria cannot be met. If TAs assign valuation functions having the range to courses given that a feasible matching exists, the answer to the existence question remains NO as the previous example is a NO instance.
8 Conclusion
In this paper, we considered many-to-one matching problem under two-sided preferences, and inspired from the TA allocation problem to the courses, we used welfare function on one side and envy-freeness type fairness criteria on the other side. Indeed, the application of problem is not limited to the TA allocation problem. We next list some of our specific open questions. Most of our algorithms require that “in a course, no two TAs have the same grade”. Is this essential to derive those polynomial-time algorithms? In our algorithm, we require capacity and types of valuations of a course to be constant. What is the complexity with respect to , when only one of them is constant?
References
- [1] Georgios Amanatidis, Haris Aziz, Georgios Birmpas, Aris Filos-Ratsikas, Bo Li, Hervé Moulin, Alexandros A. Voudouris, and Xiaowei Wu. Fair division of indivisible goods: Recent progress and open questions. Artif. Intell., 322:103965, 2023. doi:10.1016/j.artint.2023.103965.
- [2] Keisuke Bando, Ryo Kawasaki, and Shigeo Muto. Two-sided matching with externalities: A survey. Journal of the Operations Research Society of Japan, 59(1):35–71, 2016.
- [3] Sayan Bandyapadhyay, Fedor V Fomin, Tanmay Inamdar, and Kirill Simonov. Proportionally fair matching with multiple groups. In International Workshop on Graph-Theoretic Concepts in Computer Science, pages 1–15, 2023. doi:10.1007/978-3-031-43380-1_1.
- [4] Robert Bredereck, Andrzej Kaczmarczyk, and Rolf Niedermeier. Envy-free allocations respecting social networks. In AAMAS 2018, pages 283–291, 2018. doi:10.1016/j.artint.2022.103664.
- [5] Xiaolin Bu, Zihao Li, Shengxin Liu, Jiaxin Song, and Biaoshuai Tao. Fair division with allocator’s preference. In International Conference on Web and Internet Economics, pages 77–94, 2023. doi:10.1007/978-3-031-48974-7_5.
- [6] Jiehua Chen. Computational complexity of stable marriage and stable roommates and their variants. CoRR, abs/1904.08196, 2019. arXiv:1904.08196.
- [7] Sung-Ho Cho, Kei Kimura, Kiki Liu, Kwei-guu Liu, Zhengjie Liu, Zhaohong Sun, Kentaro Yahiro, and Makoto Yokoo. Fairness and efficiency trade-off in two-sided matching. In AAMAS 2024, pages 372–380, 2024. doi:10.5555/3635637.3662886.
- [8] M. Cygan, F. Fomin, L. Kowalik, D. Lokshtanov, D. Marx, M. Pilipczuk, M. Pilipczuk, and S. Saurabh. Parameterized Algorithms. Springer, 2015.
- [9] R. G. Downey and M. R. Fellows. Fundamentals of Parameterized Complexity. Springer-Verlag, 2013.
- [10] Cynthia Dwork, Moritz Hardt, Toniann Pitassi, Omer Reingold, and Richard S. Zemel. Fairness through awareness. In Innovations in Theoretical Computer Science 2012, Cambridge, MA, USA, January 8-10, 2012, pages 214–226. ACM, 2012. doi:10.1145/2090236.2090255.
- [11] Tomás Feder. Stable Networks and Product Graphs, volume 555. American Mathematical Soc., 1995.
- [12] J. Flum and M. Grohe. Parameterized Complexity Theory. Springer-Verlag, 2006.
- [13] Rupert Freeman, Evi Micha, and Nisarg Shah. Two-sided matching meets fair division. In Zhi-Hua Zhou, editor, IJCAI 2021, pages 203–209. ijcai.org, 2021. doi:10.24963/IJCAI.2021/29.
- [14] David Gale and Lloyd S Shapley. College Admissions and the Stability of Marriage. The American Mathematical Monthly, 69(1):9–15, 1962.
- [15] M. R. Garey and David S. Johnson. Computers and Intractability: A Guide to the Theory of NP-Completeness. W. H. Freeman & Co., 1979.
- [16] Sreenivas Gollapudi, Kostas Kollias, and Benjamin Plaut. Almost envy-free repeated matching in two-sided markets. In WINE 2020, pages 3–16, 2020. doi:10.1007/978-3-030-64946-3_1.
- [17] Anjali Gupta, Shreyans J Nagori, Abhijnan Chakraborty, Rohit Vaish, Sayan Ranu, Prajit Prashant Nadkarni, Narendra Varma Dasararaju, and Muthusamy Chelliah. Towards fair allocation in social commerce platforms. In WWW 2023, pages 3744–3754, 2023. doi:10.1145/3543507.3583398.
- [18] Sushmita Gupta, Sanjukta Roy, Saket Saurabh, and Meirav Zehavi. Balanced Stable Marriage: How Close is Close Enough? Theoretical Computer Science, 883:19–43, 2021. doi:10.1016/j.tcs.2021.05.015.
- [19] Dan Gusfield and Robert W Irving. The Stable Marriage Problem: Structure and Algorithms. MIT press, 1989.
- [20] Ayumi Igarashi, Yasushi Kawase, Warut Suksompong, and Hanna Sumita. Fair division with two-sided preferences. In IJCAI 2023, pages 2756–2764, 2023. doi:10.1016/j.geb.2024.07.008.
- [21] Robert W. Irving. Stable marriage and indifference. Discrete Applied Mathematics, 48(3):261–272, 1994. doi:10.1016/0166-218X(92)00179-P.
- [22] Robert W Irving, Paul Leather, and Dan Gusfield. An Efficient Algorithm for the “Optimal” Stable Marriage. Journal of the ACM, 34(3):532–543, 1987. doi:10.1145/28869.28871.
- [23] Robert W. Irving, David F. Manlove, and Gregg O’Malley. Stable marriage with ties and bounded length preference lists. Journal of Discrete Algorithms, 2009. doi:10.1016/j.jda.2008.09.003.
- [24] Pallavi Jain, Palash Jha, and Shubham Solanki. Fairness and efficiency in two-sided matching markets, 2025. doi:10.48550/arXiv.2504.10232.
- [25] Pallavi Jain and Rohit Vaish. Maximizing nash social welfare under two-sided preferences. In AAAI 2024, volume 38, pages 9798–9806, 2024. doi:10.1609/aaai.v38i9.28839.
- [26] Gili Karni, Guy N. Rothblum, and Gal Yona. On fairness and stability in two-sided matchings. In ITCS 2022, volume 215, pages 92:1–92:17, 2022. doi:10.4230/LIPIcs.ITCS.2022.92.
- [27] Michael P. Kim, Aleksandra Korolova, Guy N. Rothblum, and Gal Yona. Preference-informed fairness. In ITCS 2020, volume 151 of LIPIcs, pages 16:1–16:23. Schloss Dagstuhl – Leibniz-Zentrum für Informatik, 2020. doi:10.1145/3351095.3373155.
- [28] Donald Ervin Knuth. Stable Marriage and its Relation to Other Combinatorial Problems: An Introduction to the Mathematical Analysis of Algorithms, volume 10. American Mathematical Soc., 1997.
- [29] Fuhito Kojima, Akihisa Tamura, and Makoto Yokoo. Designing matching mechanisms under constraints: An approach from discrete convex analysis. Journal of Economic Theory, 176:803–833, 2018. doi:10.1016/j.jet.2018.05.004.
- [30] Adam Kunysz. An algorithm for the maximum weight strongly stable matching problem. In ISAAC, volume 123 of LIPIcs, pages 42:1–42:13, 2018. doi:10.4230/LIPIcs.ISAAC.2018.42.
- [31] Shengxin Liu, Xinhang Lu, Mashbat Suzuki, and Toby Walsh. Mixed fair division: A survey. In Michael J. Wooldridge, Jennifer G. Dy, and Sriraam Natarajan, editors, AAAI 2024, pages 22641–22649. AAAI Press, 2024. doi:10.1609/aaai.v38i20.30274.
- [32] David F. Manlove. Algorithmics of matching under preferences. World Scientific, 2013. doi:10.1142/8591.
- [33] David G McVitie and Leslie B Wilson. The Stable Marriage Problem. Communications of the ACM, 14(7):486–490, 1971. doi:10.1145/362619.362631.
- [34] Shaily Mishra, Manisha Padala, and Sujit Gujar. Fair allocation of goods and chores - tutorial and survey of recent results. CoRR, abs/2307.10985, 2023. doi:10.48550/arXiv.2307.10985.
- [35] Shivika Narang, Arpita Biswas, and Yadati Narahari. On Achieving Leximin Fairness and Stability in Many-to-One Matchings. In AAMAS 2022, pages 1705–1707, 2022. doi:10.5555/3535850.3536083.
- [36] Gourab K Patro, Arpita Biswas, Niloy Ganguly, Krishna P Gummadi, and Abhijnan Chakraborty. Fairrec: Two-sided fairness for personalized recommendations in two-sided platforms. In Proceedings of the web conference 2020, pages 1194–1204, 2020. doi:10.1145/3366423.3380196.
- [37] Jay Sethuraman, Chung-Piaw Teo, and Liwen Qian. Many-To-One Stable Matching: Geometry and Fairness. Mathematics of Operations Research, 31(3):581–596, 2006. doi:10.1287/moor.1060.0207.
- [38] Chung-Piaw Teo and Jay Sethuraman. The Geometry of Fractional Stable Matchings and its Applications. Mathematics of Operations Research, 23(4):874–891, 1998. doi:10.1287/moor.23.4.874.
- [39] Yu Yokoi. Envy-free matchings with lower quotas. Algorithmica, 82(2):188–211, 2020. doi:10.1007/s00453-018-0493-7.
