Manuscript Offprint
arXiv:2611.05037Matchings under One-Sided Preferences with Soft Quotas
Open access. PaperVantage converted this article to text, so layout and figures may differ from the original.
Abstract
Assigning applicants to posts in the presence of applicant preferences and quotas associated with posts is extensively investigated. For a post, a lower quota guarantees, and an upper quota limits the number of applicants assigned to it. Typically, quotas are assumed to be fixed, which need not be the case in practice. We address this by introducing a soft quota setting, in which every post is associated with two values – lower target and upper target – which together denote a range for the intended number of applicants in any assignment. Unlike the fixed quota setting, we allow the number of applicants assigned to a post to fall outside the range. This leads to assignments with deviation. Here, we study the problem of computing an assignment that has two orthogonal optimization objectives – minimizing the deviation (maximum or total) with respect to soft quotas and ensuring optimality with respect to preferences of applicants (rank-maximality or fairness). The order in which these objectives are considered, the different possibilities to optimize deviation combined with the well-studied notions of optimality with respect to preferences open up a range of optimization problems of practical importance. We present efficient algorithms based on flow networks to solve these optimization problems. We also consider a generalization of the soft quota setting, where every deviation is associated with a cost. We show extensions of our algorithms for solving the problems in this setting.
Keywords: Soft quotas, Matchings under preferences, Rank-maximality, Fairness, Network flows
1. Introduction
We study the many-to-one bipartite matching problem, where we have a bipartite graph of applicants and posts , in the presence of preferences of applicants over the posts. Typically, every post is associated with an input upper quota that limits the maximum number of applicants assigned to in any allocation. Every applicant ranks all the posts in its neighbourhood, and this ranking can involve ties between the posts. We assume that there are no gaps in the preference list of an applicant. A matching is a collection of edges where an applicant has at most one edge incident to it in , and a post has at most many edges incident on it in . In the literature, this setting is termed the house allocation setting [2] or the one-sided preference list setting, and can be used to model different problems such as
*A preliminary version [1] of this work appeared in Thirty-Second International Joint Conference on Artificial Intelligence (IJCAI 2023). Part of this work was done when the first author was a doctoral student and the second author was an undergraduate student at the Department of Computer Science and Engineering, IIT Madras
Email addresses: santhini@cse.iitm.ac.in (Santhini K A), raravi@student.ethz.ch (Raghu Raman Ravi), meghana@cse.iitm.ac.in (Meghana Nasre)
Preprint submitted to arXiv
November 4, 2026
(i) applicants
(ii) posts
(iii)
Figure 1: Example instance with . Applicants along with their preferences are given. Preference list of an applicant can be read as: is the rank 1 post of , is the rank 2 post of and so on. Each post has two values – a lower value and an upper value. In the fixed quota setting these numbers represent rigid lower and upper quotas. In the soft quota setting these numbers are the lower and the upper targets, respectively. Matching shown in Figure 1(iii) is an infeasible matching in the fixed quota setting since the posts and marked with red circles are not assigned their lower quota many applicants. The same matching is a valid assignment in the soft quota setting introduced in this paper.
assigning applicants to jobs, students to courses [3], papers to referees [4], students to schools [5], and rental inventories to customers [6].
In certain applications, such as allocating students to courses or projects [7, 8, 9], a course may require a minimum number of students to be assigned in order to be operational. This can be readily captured by associating a lower quota with a course or post, which denotes the minimum number of applicants that need to be assigned to a post in any feasible allocation. That is, for a post , in addition to the upper quota , a lower quota is associated with it. For a matching and a post , denotes the set of applicants assigned to in . In this setting, a matching is feasible if for every post , . We refer to this setting as the fixed quota setting throughout the paper. In the presence of lower quotas, there are simple instances where no feasible matching exists. For example, consider the matching shown in Figure 1. In , the posts and , marked with red circles, are not assigned any applicants and thus do not meet their lower quotas, and is an infeasible matching in the fixed quota setting.
In many practical applications, quotas need not be as rigid as assumed in the fixed quota setting, and relaxing lower quotas and augmenting upper quotas have been considered in the literature. Lower quotas have been extensively investigated in the two-sided preference list setting called the Hospital Residents problem [10, 11, 12, 13, 14, 15, 16, 17]. Here, the lower quota of a hospital denotes the minimum number of residents (doctors) needed for the smooth functioning of the hospital. As mentioned earlier, in the presence of lower quotas, a feasible matching may not always exist. Therefore, relaxing these lower quotas has been considered as a solution. For instance, instead of hospitals closing down due to the lack of a minimum number of doctors, they may simply reduce their service levels, as described in the work of Goko et al. [10]. Similarly, in the context of school choice, capacity planning to augment the number of available seats has recently been considered in multiple works [18, 19, 20]. Motivated by such applications, we relax the fixed quota assumption by proposing and studying a soft quota setting for the assignment problem in the one-sided preferences model.
Our goal in the soft quota setting is to compute an assignment that has two orthogonal optimization objectives:
(i) Minimizing deviation. For a matching , we define the total deviation and maximum deviation as below, and our goal is to minimize one of them.
(ii) Optimality with respect to preferences. Two well-studied notions of optimality in the fixed quota setting for the one-sided preference list model are rank-maximality [21, 22, 23, 24], and fairness [25]. A rank-maximal matching matches the maximum number of applicants to rank 1 posts, subject to that, the maximum number of applicants to rank 2 posts, and so on. A fair matching minimizes the number of unmatched applicants, subject to that, minimizes the number of applicants matched to the last rank posts, and so on. The signature of a matching allows us to formalize these notions. Let be the maximum rank used by any applicant to order any post in its neighbourhood. The signature of a matching , denoted as , is an tuple where denotes the number of applicants matched to their rank post in for and denotes the number of unmatched applicants in .
Definition 1 (Rank-maximality). For two matchings and with signatures
we say that ( is more rank-maximal than ) if there exists an for such that and, for , we have . A matching that has a maximal signature under the ordering is a rank-maximal matching.
Definition 2 (Fairness). For two matchings and in with signatures
we say that ( is fairer than ) if there exists an for such that and, for , we have . A matching that has a maximal signature under the ordering is a fair matching.
In the fixed quota setting, where the lower quota of every post is zero, optimal matchings under both these notions are guaranteed to exist and can be efficiently computed using the algorithms given in Irving et al. [21], Paluch [22] and Huang et al. [25]. Even in the presence of lower quotas, an optimal matching among all feasible matchings can be efficiently computed by extending the algorithm given in Huang et al. [25].
By definition, rank-maximality and fairness optimize the head and tail end of the signature, respectively, and one may perform poorly on the other criterion. Given an input signature , a matching may have a signature that satisfies the optimality requirement with respect to rank-maximality, that is, ; however, this does not guarantee that . A way of comparing two signatures that achieve a trade-off between these extreme notions of optimality is called weak dominance, and was introduced and studied in Santhini et al. [26, 27].
Definition 3 (Weak dominance). For two matchings and in with signatures
we say that ( weakly dominates ) if
In the fixed quota setting, for a given signature, deciding whether the instance admits a matching that weakly dominates the signature is NP-hard [26, 27].
2.1. Our Problems
In our soft quota setting, there is no restriction on the number of applicants that can be assigned to a post. Thus, we care about deviation as well as preference optimality and this defines our problems.
Deviation first, preference optimality next. There exist applications where having as low deviation as possible is required and, subject to that, optimality with respect to preferences needs to be respected. For example, in allocating projects to students [28] or dividing political representatives to seats [29, 30, 31] it is desirable to minimize the difference between input values and the assigned numbers. In a similar spirit, we consider minimizing the deviation from target values. Let be the set of all matchings in the instance of the soft quota setting. Let denote the set of matchings that have the minimum value of total deviation (respectively, the minimum value of maximum deviation). This is depicted in Figure 2(i). We define our first set of problems for the notions of rank-maximality and fairness:
-
OPT-MIN-TOT: The goal is to compute a matching that satisfies the notion OPT with respect to preferences in the set . For instance, if the notion OPT is rank-maximality, then the problem RMM-MIN-TOT outputs a rank-maximal matching in the set .
-
OPT-MIN-MAX: The goal is to compute a matching that satisfies the notion OPT in the set .
Preference optimality first, deviation next. Analogously, there exist applications where preference optimality has to be respected first, and subject to that, we would like to minimize a deviation parameter of interest. Since, in the soft quota setting, there is no bound on the upper quota of a post, it is not immediate how to determine the set of matchings in which we wish to compute a rank-maximal or fair matching. To address this, we first introduce an additional input to our problem – a signature requirement, , for the output matching. We consider all matchings

(i) OPT-MIN-Y

(ii) OPT-SIGN-MIN-Y
Figure 2: OPT-MIN-Y and OPT-SIGN-MIN-Y illustration, where , and OPT
| Input | Optimality notion | Matching | Parameters of matching | ||
|---|---|---|---|---|---|
| Signature | Max dev | Total dev | |||
| RMM-MIN-TOT | (2, 2, 1, 2) | 1 | 2 | ||
| RMM-MIN-MAX | (3, 3, 1, 0) | 1 | 4 | ||
| RMM-SIGN-MIN-TOT | (4, 2, 1, 0) | 2 | 4 | ||
| RMM-SIGN-MIN-MAX | (4, 3, 0, 0) | 2 | 5 | ||
Table 1: Optimal matchings in the instance given in Figure 1 corresponding to our problems. For the preference optimality first type problems, we consider the input signature as . We consider preference optimality as rank-maximality.
in the soft quota setting that respect the signature requirement with respect to the preference optimality under consideration. Having a signature as a part of the input has been considered earlier in Santhini et al. [26, 27], in the context of a different notion of preference optimality, namely weak dominance.
For a fixed notion of preference optimality, a matching meets the signature requirement if , and let denote the set of all matchings that meet the signature requirement, as shown in Figure 2(ii). Let denote the set of matchings that have minimum value of total deviation (respectively, the minimum value of maximum deviation) in . We consider the following two problems for the notions of rank-maximality, fairness and weak dominance:
-
OPT-SIGN-MIN-TOT: The goal is to output any matching in .
-
OPT-SIGN-MIN-MAX: The goal is to output any matching in .
The order in which we consider the two orthogonal parameters for optimization provides a trade-off between deviation and preference optimality. As expected, when the deviation is optimized first, the output matching has a weak signature. In contrast, when preference optimality is given precedence, a higher deviation is incurred. Thus, our problems offer a trade-off based on the user requirement. To illustrate the optimal solutions for the different problems considered, we use our example instance given in Figure 1.
2.2. Illustrative example
We consider the example instance with seven applicants and seven posts, along with the preferences of applicants over posts, as shown in Figure 1(i). For each post, two values – a lower value and an upper value – are given, as in Figure 1(ii). In the soft quota setting, these values represent the lower and the upper targets, respectively. First, we illustrate our problems for the optimality notion of rank-maximality.
Table 1 shows the optimal solutions for each of the problems, along with parameters of the matching. We begin by considering the problems of the type deviation first, preference optimality next. See the first two rows of Table 1. Note that, in the example instance given in Figure 1, the posts and appear only in the preference list of applicant . Therefore, any matching in the instance must leave one of or unmatched. Similarly, any matching must leave one of or unmatched. Thus, we make the following useful observation.
Observation 1. Any matching in the example instance given in Figure 1 must have a maximum deviation of at least one and a total deviation of at least two.
It can be verified that the matchings and shown in Table 1 are optimal for the problems RMM-MIN-TOT and RMM-MIN-MAX respectively.
Now we turn to problems where preference optimality is considered first and, subject to that, deviation is minimized. For concreteness, we fix the requirement for signature as . In order to meet the signature requirement, we must violate the upper target of the post by 2, and hence the maximum deviation of any matching in is at least 2. From Observation 1, the sum of lower deviations over all posts (the total lower deviation) of any matching in the instance must be at least 2, and therefore the total deviation of any matching in is at least 4. Furthermore, it can be verified that the matchings and shown in Table 1 are optimal for the problems RMM-SIGN-MIN-TOT and RMM-SIGN-MIN-MAX respectively.
| Input | Optimality notion | Matching | Parameters of matching | ||
|---|---|---|---|---|---|
| Signature | Max dev | Total dev | |||
| FAIR-MIN-TOT | (1, 4, 0, 2) | 1 | 2 | ||
| FAIR-MIN-MAX | (2, 5, 0, 0) | 1 | 4 | ||
| FAIR-SIGN-MIN-TOT | (3, 4, 0, 0) | 2 | 4 | ||
| FAIR-SIGN-MIN-MAX | (2, 5, 0, 0) | 1 | 4 | ||
Table 2: Optimal matchings in the instance given in Figure 1 corresponding to our problems. For the preference optimality first type problems, we consider the input signature as . We consider preference optimality as fairness.
Note that the signatures of the matchings and weakly dominate the input signature, and hence both these matchings are candidate solutions for the problems DOM-SIGN-MIN-TOT and DOM-SIGN-MIN-MAX respectively, where DOM represents the optimality notion of weak dominance.
Next, we illustrate our problems and their solutions for the notion of fairness using the example instance given in Figure 1. Table 2 shows the optimal solutions for each of the problems, along with the parameters of the matching. Note that these matchings are different from the matchings given in Table 1. We first consider the problems of the type deviation first, preference optimality next. From Observation 1, any matching in must have a maximum deviation of at least one and a total deviation of at least two. It can be verified that the matchings and shown in Table 2 are optimal for the problems FAIR-MIN-TOT and FAIR-MIN-MAX respectively.
Now, we turn to problems where preference optimality is considered first and subject to that deviation is minimized. For concreteness, we fix the signature as . The input signature can be interpreted as follows: the value of 0 in the last component indicates that the required matching must assign all applicants, while the value 3 specifies that at most 3 applicants can be matched to a rank 3 post. Any matching whose signature is fairer than the input signature is a candidate solution. Observe that in order to match all applicants, any matching must either violate the upper target of post by 2 or violate the upper targets of the post and one of or by 1 each. Thus, the maximum deviation of any matching in must be at least 1. From Observation 1, the total lower deviation of any matching in the instance must be at least 2, making the total deviation of any matching in at least 4. Furthermore, it can be verified that matchings and , shown in Table 2, are optimal for the FAIR-SIGN-MIN-TOT and FAIR-SIGN-MIN-MAX problems, respectively.
2.3. Our Results
We show the following new results in our paper.
Theorem 4. OPT-SIGN-MIN-MAX and OPT-SIGN-MIN-TOT admit polynomial time algorithms, where OPT can be one of rank-maximality (RMM) or fairness (FAIR).
Theorem 5. OPT-MIN-MAX and OPT-MIN-TOT admit polynomial time algorithms, where OPT can be one of rank-maximality or fairness.
Proposition 1. DOM-SIGN-MIN-MAX and DOM-SIGN-MIN-TOT are NP-hard even when all applicants have strict preferences, the total deviation , and for every post , the lower target , and the upper target .
The above hardness is obtained from the hardness of DOM-Q problem considered in [27] by viewing quotas as targets.
Our Techniques. The algorithms for computing minimum total deviation matchings are based on a flow network that we design. Flow networks are used to compute Pareto-optimal matchings [32, 33, 9], rank-maximal matchings [34] and weakly dominant matchings [27, 26] in the literature. For computing matchings with minimum value of maximum deviation we reduce the problem to an appropriate problem in the fixed quota setting, which can be solved efficiently.
Generalized soft quota setting. Given our positive results for the problems in the soft quota setting for the optimality notions rank-maximality and fairness, it is natural to consider a generalization of our setting, where every deviation is associated with a cost. That is, every post in the generalized soft quota setting is associated with a lower deviation cost and an upper deviation cost that indicate the cost associated with deviating 1 unit from the lower target and upper target, respectively. We show extensions of our algorithms in Section 7.
2.4. Related Works
Biproportional apportionment. Our soft quota setting is similar to the biproportional apportionment problem [29, 30, 31], which deals with the fair division of political representatives among states. Political representatives correspond to applicants, and states correspond to posts in our model. Many methods [30, 31] for the biproportional apportionment problem reduce the problem to a flow network to minimize the absolute or relative min-max error. Note that the min-max error in the biproportional apportionment problem considered in the works of Pukelsheim et al. [30] and Serafini and Simeone [31] corresponds to the min-max deviation in our model. However, the biproportional apportionment problem does not involve any preferences, whereas in our setting we have preferences associated with edges.
Soft bounds. The recent works [35, 36, 37, 38, 39] in the two-sided preferences model allow soft bounds on the capacity constraints. These works focus on the controlled school choice problem, in which students are associated with types and schools have soft bounds on the quota of each type. However, there are hard constraints on the number of students that can be assigned to each school or type. In the work by Aziz et al. [38] and Echenique and Yenmez [36], lower-side deviation (or relaxation) from the target quotas or reserves is allowed. Our model has no hard capacity constraints, and target soft quotas are allowed to deviate on both sides. In the work by Ehlers et al. [35], students are associated with a single type, and for each type, there is a lower violation and upper violation w.r.t. an allocation, and these are analogous to the lower deviation and upper deviation in our model. Gonczarowski et al. [37] considered a matching problem in the two-sided matching market with soft diversity constraints that allocate candidates to Pre-Military Academics programs (PMA). Here, each PMA defines a set of populations (or types) that they are interested, and specifies a soft minimum target and hard maximum quota for such populations. For more information, refer to the survey paper by Aziz et al. [40].
Other models of flexibility. In the context of school choice problem, capacity planning is studied in [41, 42, 19, 18, 43]. In the work by Gajulapalli et al. [41], flexible quotas are used to increase the capacity of some schools. In the work by Rios et al. [42], flexible quotas are used as a tie-breaker. In the work by Bobbio et al. [19], the authors study the school choice problem in an expanded market, where some schools can increase their capacity to either allocate students who are previously unassigned or to improve the assignment of the previously assigned students. The budget used for capacity expansion in the work by Bobbio et al. [19] is analogous to the total upper deviation of posts in our model. In Abe et al. [18], Monte Carlo tree search based solutions for the capacity expansion problem are studied. In the work of Limaye and Nasre [44] and Santhini et al. [27, 26], programs have costs instead of quotas, which allows flexibility. In all these works, the flexibility of upper quotas is considered, whereas in our work, we allow posts to deviate on both upper and lower targets.
To the best of our knowledge, this is the first work that investigates soft quotas in the one-sided preference list model.
Our problems consider optimizing two objective functions – deviation and preference optimality – and hence can be regarded as a special case of a multi-objective optimization problem [45, 46, 47]. These works differ from our work in terms of the problem setup and the objectives considered.
Organization of the paper. Throughout the paper, we present the results with OPT set to rank-maximality (RMM). Analogous results for fairness can be obtained with minor modifications to our algorithms, as outlined in the relevant sections. In Section 3 and Section 4, we focus on problems where the objective is to minimize the total deviation. The former section addresses preference-optimality-first type problems (the MIN-TOT variant in Theorem 4), while the latter discusses deviation-first type problems (the MIN-TOT variant in Theorem 5). In Section 5, we present results for the MIN-MAX problems by exploiting the connection between the fixed quota setting and the soft quota setting. Section 6 explores the simultaneous optimization of total deviation and maximum deviation. Results for the generalized soft quota setting are described in Section 7, and we conclude with a discussion in Section 8.
3. Minimizing Total Deviation: Preference Optimality First
In this section, we present the results for minimizing total deviation for the preference optimality first, deviation next type of problems. As mentioned earlier, apart from the input instance

Figure 3: Flow network for solving RMM-SIGN-MIN-TOT, where
these problems have a signature as part of the input. Recall that OPT can be instantiated with either rank-maximality or fairness. We present the results for rank-maximality in detail and state the necessary modifications required for fairness.
An instance of RMM-SIGN-MIN-TOT problem consists of a graph with applicant preferences, soft quotas for posts, and an input signature . Let denote the set of matchings such that, for every , we have . Our goal is to output a matching that has minimum total deviation in the set . We present a flow-network based algorithm to solve the RMM-SIGN-MIN-TOT problem.
Overall idea. Consider an optimal matching for the RMM-SIGN-MIN-TOT problem. Let the total deviation of be . In , a subset of posts incur deviation with respect to the lower target, whereas another subset of posts, disjoint from the previous set, incur deviation with respect to the upper target. Let denote the sum of the deviation of posts that deviate with respect to the lower target (respectively, with respect to the upper target). Note that . Our algorithm considers all possible values of and such that . We show that there exists a flow network such that the matching has a feasible flow in . For a fixed value of and a split of as , we construct a flow network with properties as specified below.
3.1. Construction of the network
For a given instance , and a fixed value of , which can be split as the sum of two non-negative integers and , we construct the flow network with costs, demands and capacities on the edges. The vertices of are:
For every applicant in , we have a node in . For every post in , we have two nodes in , namely, (termed the original copy) and (termed the extended copy). In addition, we have a source , a sink , and two special nodes and .
Demand and capacity of the edges in . Every edge has a demand and a capacity associated with it, and we use a vector to denote these values. The edge set is the union of the following sets:
Cost of the edges in . All the edges in , except the edges in , have a cost of 0. For an edge in of rank , the corresponding two edges and in have a cost of , where .
As in standard reductions, there is a natural correspondence between edges in carrying non-zero flow and a matching. With this, we complete the description of the flow network. See Figure 3 for an illustration. A flow in is said to be a feasible flow if it meets the demands on every edge . The cost of a feasible flow , denoted by is defined as , where and denotes the flow across the edge and cost assigned on the edge , respectively. For a matching with signature , we define the cost of , denoted by as . We have the following lemma regarding the cost assignment.
Lemma 1. Let be matchings such that . Then, , where each rank edge has a cost of .
PROOF: Let , and . Let be the first rank at which and differ. Thus, for all , and .
The cost difference between the matchings M and is
Now, since , we have
Additionally, using the fact that , we conclude that
We have the following remark regarding the cost assignment.
Remark 1. Let be the set of matchings corresponding to feasible flows in the network. Then, a min-cost flow in corresponds to a rank-maximal matching in .
PROOF: Let be a min-cost feasible flow in , and let be the corresponding matching in . Suppose, for contradiction, that is not a rank-maximal matching in . Then there exists another matching such that . By Lemma 1, . Since , there exists a feasible flow corresponding to , with , contradicting the minimality of .
It is worth noting that our reductions apply to any notion of optimality that can be encoded as a maximum weight matching problem.
3.2. Total deviation of a flow versus total deviation of the corresponding matching
The flow network has demands on its edges, and thus it may not admit a feasible flow. Assume that admits a feasible flow, say . There is a natural correspondence between the flow in and a matching in as follows:
For any applicant , the edge has unit capacity, and hence the incoming flow, if any, is routed either via the node or via , but not both. For a feasible flow , we define the deviation of a flow as follows. For the node , we define the lower deviation of with respect to the flow as , and the upper deviation is undefined for this node. For the node , we define the upper deviation of with respect to as , and the lower deviation is undefined for this node. For a post , we define the total deviation of with respect to as
Similar to the definition of total deviation of a matching, we define total deviation of the flow in as follows.
Definition 6 (Total deviation of a flow). The total deviation of a flow in is defined as
By the construction of the network , and by the definition of total deviation of a feasible flow in , it is easy to verify that .
Some pathological cases. Having defined the correspondence between a flow in and a matching, it would be ideal to have a correspondence between the total deviation of a flow in and that of the matching. However, even for a single post, the total deviation of the post with respect to the flow need not be the same as the total deviation of the post with respect to the corresponding matching. This is illustrated by three scenarios presented below. For all the three scenarios, we consider an input graph that has a single edge , and the post has and .

(i) Scenario 1: Total deviation of the flow (marked in red) is 2 and that of the corresponding matching is 0. The example illustrates the violation of Property 1.(i) in the network and thus is not a good flow.

(ii) An -correcting flow (marked in green) in which is feasible in the network and fixes the violation of Property 1.(i). Note that the total deviation of is 0 and that of the corresponding matching is 0.
Figure 4: Scenario 1 where and the -correcting flow .
-
Scenario 1: Consider the flow network for . The network admits a feasible flow with value 2 that routes 1 unit of flow through the path and 1 unit of flow through the path , and has a total deviation (see Figure 4(i) for an illustration). Since , the post has a lower deviation with respect to the flow . Similarly, has an upper deviation due to the non-zero flow across the edge . Thus, the flow has a total deviation , as mentioned earlier. The matching corresponding to contains a single edge and has a total deviation of 0. Thus, there is a mismatch between the total deviation of the flow and the total deviation of the corresponding matching. We remark that this issue arises because, for the same post , both the edge corresponding to its original copy and the edge corresponding to its extended copy carry non-zero flow. This issue can be avoided by ensuring that, for every post , at most one of the edges and carries non-zero flow in .
-
Scenario 2: Consider the flow network for . The network admits a feasible flow with value 1 that routes 1 unit of flow through the path and has a total deviation . However, the matching corresponding to contains a single edge and has a total deviation of 0. Note that here and . For a feasible flow , when , the post has an upper deviation, and we expect the flow across the edge to be saturated. However, this need not be true, as illustrated in the example. This situation can be avoided if the edge is saturated in whenever .
-
Scenario 3: Consider the flow network for . The network admits a feasible flow with value 1 that routes 1 unit of flow through the path and has a total deviation . Note that here and . The matching corresponding to is an empty matching and has a total deviation of 0. When we route flow along the edge , we expect the flow across the edge to be exactly equal to its demand . However, this need not be true, as illustrated in the example. This situation can be avoided if the flow across the edge in is exactly equal to its demand whenever .
3.3. Good flow and correcting flow
To address the discrepancies as illustrated in the pathological cases and ensure that the total deviation of the flow corresponds to the total deviation of the matching, a feasible flow in our flow network should satisfy additional properties, which are listed below as Property 1.
Property 1. Let be a feasible flow in . The flow is good if, for every post , all of the following hold.
(i) at most one of the edges and has a non-zero flow in
(ii) if then
(iii) if then
We note a useful observation below about good flows.
Observation 2. Let be a good flow in , and let be the corresponding matching in . Then, for every post , . Therefore, .
PROOF: Let be a good flow in , and thus satisfies Property 1. By Property 1(i), for a post , at most one of the edges in and has a non-zero flow. Now consider the matching corresponding to . Observe that, for a post , the number of applicants that are matched to in is . Recall that the deviation of in is . We consider the following cases.
-
Case 1: . Observe that, in this case, . Since , the node does not have any non-zero flow into it in , which implies that . Since , all the flow along the edge comes from applicants in (true applicants), and because is a feasible flow, . Therefore, .
-
Case 2: , and . Observe that . In this case, by Property 1(ii), , and since , all the flow along the edge is via the true applicants. Thus, , and this implies that .
-
Case 3: , and . Observe that . In this case, by Property 1(iii), . Since, , . This implies that .
Thus, for every post, the deviation with respect to a good flow and the deviation with respect to the corresponding matching are the same. This immediately implies that the total deviation of a good flow and that of the corresponding matching are the same.
It is not immediate how to compute a good flow in a flow network. However, given a feasible flow in , we show that it is possible to construct a good flow in a different flow network. We need the following notation. For an edge in , we call the path in the network the true path, and the path the extended path. For a post in , we call the path the dummy path. Note that, corresponding to an applicant and a post in , we have a true path and an extended path, and using either one of them, we can route a maximum of 1 unit of flow in the network. Corresponding to a post in , we have a unique dummy path, and the maximum flow that can be routed along this path is . Let be a feasible flow in . We say that the status of a post is good with respect to if the corresponding pair of nodes in the network satisfies the conditions given in Property 1; otherwise, the status of is bad with respect to the flow .
Suppose we have a bad post in with respect to the flow . We reroute the flow in a certain way to turn the post into a good post without changing the status of any other post. We now describe the different cases under which can be a bad post and the rerouting required to turn it into a good post.
Definition 7 (correcting flow). Let be a feasible flow in the network that has a bad post with respect to , and let be another flow in that differs only in the flow across some of the paths corresponding to the post . Then is called a correcting flow for if it satisfies the following conditions.
(i) There exists a network such that is feasible in the network , where .
(ii) The matchings corresponding to and are the same.
(iii) Status of any post remains the same in and .
We describe the types of a correcting flow .
-
-correcting flow. Assume that the post violates Property 1(i). Thus, and . We reduce the flow along the dummy path corresponding to by 1. Following this, we select an arbitrary extended path carrying unit flow corresponding to the post , say and reroute the flow along the path . Note that the resulting flow is feasible in the network , where and .
-
-correcting flow. Assume that the post violates Property 1(ii). Thus, and . We select an arbitrary extended path carrying unit flow corresponding to the post , say and reroute the flow along the path . Note that the resulting flow is feasible in a network where, and .
-
-correcting flow. Assume that violates Property 1(iii). Thus, and . We reduce the flow along the dummy path corresponding to by 1. Note that the resulting flow is feasible in a network , where and .
Note that in each of the above cases, if applicant is matched to the post prior to the rerouting, then it continues to remain matched to after the rerouting. Since we have not changed the flow with respect to any post , the status of the post remains unchanged. Thus is a correcting flow. For illustration, the correcting flow for the scenario 1 is given in Figure 4(ii).
Lemma 2. If is a feasible flow in that does not satisfy Property 1, then there exists a correcting flow for in that satisfies Property 1.
PROOF: Let be a bad post with respect to . We apply a sequence of correcting flows to change the status of the post from bad to good. Assume that the pair of nodes corresponding to violates Property 1(i), and thus and . Let
We apply many -correcting flows. Let the resulting flow be . After the above changes, at least one of the edges or has a zero flow in . That is, the nodes and satisfy Property 1(i) with respect to . However, the nodes and may still violate either Property 1(ii) or Property 1(iii), but not both. Depending on which property is violated, we consider the following two cases.
Case 1: . In this case, because , the pair of nodes trivially satisfies Property 1(ii). Now suppose and , which implies that the pair of nodes violates Property 1(iii). Let
In this case, we apply many -correcting flows.
Case 2: . In this case, because , the pair of nodes trivially satisfies Property 1(iii). Now suppose and , which implies that the pair of nodes violates Property 1(ii). Let
In this case, we apply many ud-correcting flows.
Let be the resulting flow. Observe that the pair of nodes satisfies all the conditions in Property 1, and thus the post p is a good post with respect to the flow .
Recall that, by applying correcting flows, the status of the other posts remains unchanged. Therefore, we can apply these corrections independently. For all the bad posts with respect to , we apply a sequence of correcting flows as described above. Observe that the resulting flow is a feasible flow that satisfies Property 1 in another network , where .
We are ready to design our flow network based algorithm, which employs linear search over a specific range to compute an optimal matching. For an optimal matching in G, we have the following claims.
Claim 1. The total deviation of is at least .
PROOF: Let be the total lower deviation of the matching . For every matched applicant, it may contribute to satisfying the lower target of one post. Thus, . Since the total deviation of , is at least , and , it is clear that is at least .
Claim 2. The total deviation of is at most .
PROOF: Observe that for any matching, the maximum value possible for upper deviation is , and the maximum possible value for lower deviation is . Thus, the total deviation of is at most .
Thus, it is enough to search for the value of total deviation in the range . Note that, even if for a particular value of , and a split of as and , we find a feasible flow in , it is required to ensure that the signature of the corresponding matching satisfies the signature requirement. We now present the algorithm.
To compute RMM-SIGN-MIN-TOT, we use linear search to find the optimum value of . Note that, for a fixed value of , there are ways to split the total deviation as sum of lower
Algorithm 1: Algorithm for RMM-SIGN-MIN-TOT
1 set low= max{0, }, high= ,
2 while do
3 | set found=0
4 | for each of the ways to split as ld and ud where do
5 | construct
6 | if admits a feasible flow then
7 | compute a min-cost flow f and corresponding matching M
8 | if then
9 | set found=1
10 | if found==0 then
11 | set
12 | else
13 | return and
deviation ld and upper deviation ud. For each of these values, we construct the network and compute a min-cost flow f in the network. Let M be the matching corresponding to the flow f. If M has a signature , then the optimal value of total deviation is at most . The pseudocode is presented as Algorithm 1.
Correctness of the Algorithm for RMM-SIGN-MIN-TOT. Given the lower and upper bound for the deviation of the optimal matching , it is clear that a linear search over the range works. Now, we will show that, at Algorithm 1 of our algorithm, if , then we can discard the split , and this is described in Claim 3.
Claim 3. If at Algorithm 1, , then there does not exist any matching with total lower deviation ld and total upper deviation ud such that .
PROOF: Note that any matching in with a total lower deviation and total upper deviation has a feasible flow in the network . In Algorithm 1 of our algorithm, we compute a matching corresponding to a min-cost flow in the network. By the cost assignment of edges in , the matching is a rank-maximal matching among all matchings with total lower deviation and total upper deviation . Thus if at Algorithm 1, , then the signature of any matching with total lower deviation and total upper deviation is strictly less rank-maximal than the signature requirement .
Now assume that our algorithm outputs a solution. Let be the value of for which our algorithm stops, and let and be the corresponding split for lower deviation and upper deviation, respectively. Our flow network computes a min-cost flow, say , which has a total deviation of . We have the following claim.
Claim 4. The flow is a good flow in .
PROOF: If this is not the case, then violates at least one of the conditions of Property 1. Corresponding to the violated condition, we have a correcting flow in , and after applying it, we get a good flow in another network , where . Further, the matchings corresponding to and are the same. This contradicts the fact that is the smallest value such that we obtain a matching satisfying the signature requirement.
Since is a good flow in , the corresponding matching is an optimal solution to the RMM-SIGN-MIN-TOT problem.
Time complexity of Algorithm 1. For a flow network , the running time required to compute a min-cost flow is using the enhanced capacity scaling algorithm [48]. Given an optimal total deviation value , the number of calls to the min-cost flow network is . To compute , we apply linear search within the range [low, high], where low= , and high= . Therefore, the time complexity of Algorithm 1 is . Note that the running time depends on the value of . For a post with , we can preprocess and adjust its value before applying Algorithm 1 to the modified network. The minimum total deviation value in the modified network can be translated back to the original network, thereby eliminating dependency on the term . This ensures that the time complexity of our Algorithm 1 is polynomial in the size of the network. In the remaining sections of the paper, we assume that for any post , .
Illustration of algorithm for RMM-SIGN-MIN-TOT. Given the instance in Figure 1 and an input signature , we perform linear search over the range [low, high], where low = 0, and high = 12. For and , the network constructed in Algorithm 1 of Algorithm 1 does not admit any feasible flow. For , none of the splits gives a feasible solution. Although, corresponding to the splits and , the network admits feasible flows, their corresponding matchings fail to meet the signature requirement.
For , we construct the network for each pair such that . For the network , consider the flow defined below. For the pairs , , , , and , the flow routes 1 unit of flow through the corresponding true path path). It also routes 1 unit of flow along extended paths for pairs and , and along dummy paths for posts and .
Observe that is a min-cost feasible flow in and satisfies Property 1. Corresponding to the flow , we have a matching listed in Table 1. Since , the matching is a feasible solution for the problem RMM-SIGN-MIN-TOT. It is easy to verify that any matching that meets the signature requirement has a total deviation of at least 4, and thus the matching is an optimal solution for the RMM-SIGN-MIN-TOT problem.
3.4. Modification for Fairness
For solving the problem FAIR-SIGN-MIN-TOT, we construct the same network as in Figure 3, where . The network for FAIR-SIGN-MIN-TOT differs from that of RMM-SIGN-MIN-TOT in the assignment of cost of the edges in .
• For an edge or in , if the corresponding edge in is of rank , then we set cost of that edge as .
We have the following lemma regarding the above cost assignment.
Lemma 3. Let be matchings such that . Then, , where each rank edge has a cost of , and every unmatched applicant is treated as being matched to a dummy post of rank with cost .
Note that our algorithm and proofs can be easily modified with respect to the notion of fairness.
4. Minimizing Total Deviation: Deviation First
In this section, we present the results for minimizing total deviation for the deviation first, preference optimality next type of problems.
4.1. Algorithm for RMM-MIN-TOT
Given an instance of the soft quota setting, our goal is to compute a matching that is rank-maximal among all matchings that have a minimum value of total deviation. First, we consider the simpler problem of computing a minimum total deviation matching in ignoring applicant preferences.
Given an instance of the soft quota setting, we denote the same instance viewed as an instance of the fixed quota setting by . Recall that in the fixed quota setting, for a post , we have a fixed lower quota and a fixed upper quota associated with it. A matching is feasible in the fixed quota setting if, for every post , . We note that with respect to the problem of minimizing total deviation, there is a useful connection between matchings in and . If the fixed quota setting instance admits a feasible matching , then has a total deviation of 0 in the soft quota setting instance . Thus, is an optimal matching in as far as deviation is concerned. However, if does not admit a feasible matching, any minimum total deviation matching in has a positive value for the total deviation.
We observe that in an optimal matching in , no post incurs a violation on the upper target. To see this, suppose that for a post , we have more than applicants matched to it in . Then, we can remove the excess number of applicants, namely , matched to from and obtain a matching with a smaller value of total deviation. We use the above observation and the connection between and to compute a matching with minimum total deviation without applicant preferences.
Minimizing total deviation. Given the instance , we construct an instance of the soft quota setting, where for every post , . Consider the fixed quota setting instance , where we set and for every post . We show a connection between a maximum matching in and a minimum total deviation matching in , as stated in Lemma 4.
Lemma 4. Any maximum matching in is a minimum total deviation matching in .
PROOF: Let be an arbitrary maximum matching in . Using the maximality of in the instance , we show that is a minimum total deviation matching in . Suppose not. Let be a minimum total deviation matching in . That is, in is less than in . Since is an optimal matching in , for every post , , and thus it is a valid matching in . Now we compare the cardinalities of and . Since for every post , , and . This implies that , which is a contradiction to the fact that is a maximum matching in .
Now we establish an interesting connection between the minimum value of total deviation in the soft quota instance and that of the original soft quota setting instance , as stated in Lemma 5.
Lemma 5. The minimum value of total deviation of and are the same.
PROOF: Let be the total deviation of a minimum total deviation matching in . Note that is the sum of the lower deviations of all posts in . Since , the minimum value of the total deviation in , denoted by , satisfies . Suppose that . Let be a matching that achieves the minimum value of total deviation in . Note that is the sum of lower deviations of all posts in .
In the soft quota setting instance , with respect to the matching , some posts may incur violation on the upper target. This is because, in , the upper target of a post is which is at most the corresponding upper target in . Now we construct the matching in , where for every post , we remove number of applicants which are matched to . Note that in , with respect to the matching , no post incurs a violation on the upper target. Thus, the total deviation of the matching in is , which is the total deviation of in . This contradicts the fact that is the minimum value of total deviation in .
By Lemma 4 and Lemma 5, any maximum matching in is also a minimum total deviation matching in the original soft quota setting instance . However, need not be a maximum matching among all matchings with minimum value of total deviation in . To obtain such a matching, we use the instance (recall that every post in has ) and augment the matching in . We remark that augmenting a matching never decreases the number of applicants matched to any post. Thus, augmenting in increases the size of the matching while preserving its total deviation.
For an illustration, consider the soft quota instance given in Figure 1. We construct the soft quota instance , and let be the corresponding fixed quota instance. Consider the maximum matching in . We augment the matching in to obtain a matching . Note that is a maximum matching in , and it has a total deviation of 2 in , which is the optimum value of total deviation.
Since we disregarded preferences, the above procedure does not guarantee a matching that is optimal with respect to the preferences. For example, the matching computed above is not a solution of RMM-MIN-TOT problem in , since the matching (illustrated in Table 1) is more rank-maximal than . In the rest of the section, we refine the above ideas to compute an RMM-MIN-TOT matching in .
-
We construct the instance from as discussed above. We compute an RMM-MIN-TOT matching in using the procedure given in Step (A) below.
-
We augment the matching in to obtain an RMM-MIN-TOT matching in . The procedure for computing is given in Step (B).
Step (A): Computing RMM-MIN-TOT in . Given the instance , we reduce the problem to computing a min-cost flow in a suitably designed flow network . We show that a matching corresponding to a min-cost flow in has the following properties:
-
is a minimum total deviation matching in and also in .
-
is a rank-maximal matching among all minimum total deviation matchings in . Note that need not be a solution to RMM-MIN-TOT in .
We construct the flow network as follows. For every post , we introduce many dummy applicants and denote this set by . Let . The vertex set of is defined as below:
The edge set is the union of the following sets:
Cost of the edges in . For an edge in having rank , we set cost of the corresponding edge in as . For all the other edges in , we set the cost as 0.
Capacity of the edges in . For an edge in , we set its capacity as . All other edges in have a unit capacity.
Consider the cut , and observe that the capacity of this cut is . Thus, by max-flow min-cut theorem, the value of any flow is at most . Note that for every post , we can send 1 unit of flow via the path , where , which implies that the value of a max-flow is at least . Thus, any max-flow in has a value of . We define the deviation of a max-flow in as follows.
Definition 8 (Total deviation of a max-flow). The total deviation of a max-flow f in H is defined as
where is the incoming flow to the vertex p through the dummy applicants.
There is a natural correspondence between a flow f in H and a matching M in as follows:
Cost of a max-flow in and total deviation of a matching in . For a max-flow in , we define the total cost of the flow, denoted by , as follows:
where and represent the flow and the cost on the edge , respectively. By the design of our network , we ensure that the cost of a max-flow in corresponds to the total deviation of the corresponding matching in . This is proved using Lemma 6.
Lemma 6. Let be two flows in , and let be the corresponding matchings in . If , then
PROOF: For a post , the incoming flow is via edges in , and . In , only the edges in have a non-zero cost, and recall the cost of an edge in . Observe that cost of the flow can be upper bounded by
where the equality is achieved when all edges are of rank r. Similarly, the cost of the flow can be lower bounded by
and the equality is achieved when all edges are of rank 1. To show that , we show the equivalent statement
Since and ,
Thus, .
Lemma 7. Let f be a min-cost flow in H and let be the corresponding matching in . Then is a minimum total deviation matching in .
PROOF: Suppose not, let be a minimum total deviation matching in , and let be the corresponding flow. Recall that in , every post has , and thus is a maximum cardinality matching. Since , by Lemma 6, we have , which is a contradiction.
Given the connection between the total deviations of and established in Lemma 5, which is independent of the preferences, we know that the minimum total deviation in is equal to that in . This leads to the following corollary.
Corollary 1. Any min-cost flow in H corresponds to a minimum total deviation matching in G.
We now prove the preference optimality of the matching obtained in Step (A).
Lemma 8. Any min-cost flow in H corresponds to a solution to RMM-MIN-TOT in .
PROOF: Let be a min-cost flow in , and let be the corresponding matching in . By Corollary 1, is a minimum total deviation matching in . Suppose is not an RMM-MIN-TOT matching in . Then there exists another matching that is an RMM-MIN-TOT matching in , and let be the corresponding flow in . Since is a minimum total deviation matching, .
Since , by the definition of rank-maximality, there exists an index such that and for . Recall that, corresponding to a rank edge in , we have an edge in with a cost of in .
Since , both flows have the same contribution from the term . By Lemma 1, the rank-dependent contribution to is smaller than that of . Thus, , which is a contradiction.
We observe that every minimum total deviation matching in has cardinality of at least .
Lemma 9. Let be a matching in such that . Then .
PROOF: Since is a maximum matching in the restricted instance , we have . Now let be a matching in . Observe that . Since , we obtain , which implies .
In Step (A), we compute a matching that is an RMM-MIN-TOT matching in . In Step (B), we show how to compute a matching that is an RMM-MIN-TOT matching in by augmenting the matching in the fixed quota setting instance . We augment the matching such that, in the -th augmentation, we obtain a rank-maximal matching among all matchings of cardinality in such that .
Step (B): Computing a solution for RMM-MIN-TOT in by augmenting in . Our algorithm is iterative, and we begin with the matching . Suppose that after the iteration , we have computed a matching having cardinality , and total deviation . In iteration , we augment in by computing an -t path in a directed graph with costs as defined below. We show that the resulting matching is a rank-maximal matching among all matchings having cardinality and total deviation . Since a rank-maximal matching among all minimum total deviation matchings need not have maximum cardinality, we retain the most rank-maximal matching obtained during the augmentation procedure. That is, initially we set . After computing a matching , if , we update . The augmentation procedure continues until the graph does not admit an -t path. At the end of Step (B), we return .
We now describe the construction of the directed graph . The vertices of are defined as follows:
Let denote the set of applicants that are unmatched in , and let denote the set of posts with . Note that every post satisfies , and is exactly the set of posts to which one additional applicant can be matched without increasing the total deviation. We claim that it is sufficient to restrict our attention to posts in because:
(i) For any iteration , if we have a post with , then all the applicants in the neighbourhood of must be matched in . Suppose not. Let be an unmatched applicant in the neighbourhood of with respect to the matching . Then, by adding the edge to , we could reduce the deviation of , and thus reduce the total deviation. For , this would contradict the fact that the matching is a matching with minimum total deviation in both and .
(ii) In an optimal matching, no post incurs a deviation from the upper target.
Now, we define our edge set as follows:
Cost of the edges in . For an edge of rank ,
• if , cost of the edge is
• if , cost of the edge is
All other edges in have a cost of 0.
The following observation establishes the correspondence between the alternating components in the symmetric difference of two matchings and the directed graph .
Observation 3. Let be a matching in having cardinality and total deviation . Then every alternating cycle in corresponds to a directed cycle in , and every augmenting path in corresponds to a directed s-t path in .
We now prove an important property of the directed graph .
Claim 5. There are no negative cost directed cycles in .
PROOF: We prove the claim by induction on the number of iterations. Base case is trivial as the initial matching is a rank-maximal matching among all matchings having cardinality and total deviation . Assume inductively that is a rank-maximal matching among all matchings having cardinality and total deviation . Suppose, for contradiction, that contains a negative cost directed cycle . By the construction of , the directed cycle corresponds to an alternating cycle with respect to .
Let . Since is an alternating cycle, . Further, switching along an alternating cycle does not change the number of applicants assigned to any post. Hence, . Since has negative cost, . By Lemma 1, , contradicting the induction hypothesis. Hence, does not contain any negative cost directed cycle.
Now we describe our augmentation process. Let denote a min-cost -t path in , and let be the underlying undirected path in . From the construction of the directed graph , it is easy to see that is an augmenting path with respect to . We augment the matching using , and the resulting matching is .
For a set , let denote the number of rank edges in . We require Definition 9 to prove correctness.
Definition 9 (Signature of a path ). We define the signature of a path with respect to the matching as an -tuple denoted by , where
Note that, unlike the signature of a matching, which contains non-negative values, may contain negative values. It is useful to note the connection between the signature of a path and the cost of the path .
We observe the following:
Observation 4. .
Since is an augmenting path, the number of unmatched edges in is one more than the number of matched edges in . Thus, we have Observation 4. Let . For any , the value of cannot be greater than the number of matched rank edges in . This is stated as Observation 5.
Observation 5. For any , .
Since , it is easy to observe that .
Observation 6. Every component in is non-negative.
Observation 6 follows from Observation 5. We state a series of claims to prove the correctness of Step (B). We ensure that our augmentations do not change the value of total deviation of the resulting matching, and this is stated in Claim 6.
Claim 6. If , then .
PROOF: We need to show that at each iteration , the augmentation preserves the value of total deviation. We use induction to prove the claim. The base case is trivial, that is, when , the initial matching has a total deviation of . We assume that the total deviation of matching computed in iteration is . Let be a minimum cost path in , and let be the corresponding augmenting path in iteration . The path starts at an unmatched applicant in and ends at a post with . After augmenting with , a post in has , and thus the deviation of this post remains unchanged. For the post , and since , the deviation of post remains 0. Hence, the total deviation . Thus, a matching computed in any iteration of Step (B) has a total deviation of .
Next, we show that as the cost of path decreases, signature of the path with respect to rank-maximality also decreases.
Claim 7. Let and be two s-t paths in , and let , and . If , then, . Equivalently, .
PROOF: By our cost assignment, , and . Therefore, implies . Since and are matchings, by Lemma 1, . Since, , and , is equivalent to .
To prove the correctness of the augmentation step, we assume inductively that is a rank-maximal matching among all matchings having cardinality and total deviation , and establish the following lemma.
Lemma 10. Let be a matching in such that , and . Then there exists an augmenting path in , corresponding to a directed s-t path in , such that .
PROOF: The symmetric difference can be decomposed into alternating path, alternating cycle and augmenting path components. Since, , the decomposition contains at least one augmenting path. Let Q be such an augmenting path, terminating at a post . Augmenting along increases the number of applicants matched to by exactly one and does not change the number of applicants matched to any other post. The post must be unsaturated in and cannot be undersubscribed in ; otherwise augmenting along would decrease the total deviation, contradicting the minimum total deviation of . Thus, , and . By Observation 3, corresponds to a directed -t path in .
Let . Consider the graph obtained by augmenting along . Note that augmenting further by would give . Thus, it must be the case that and . Consequently, by the optimality of , it must be the case that . By rearranging, we obtain .
Now we prove the following property about the matching computed in iteration .
Lemma 11. The matching computed in iteration is rank-maximal among all matchings with cardinality and total deviation .
PROOF: We prove this by induction on the number of iterations. The base case follows from Step (A). Assume that is a rank-maximal matching among all matchings having cardinality and total deviation . Now consider the graph . By Claim 5, there are no negative cost directed cycles in . Let be the minimum cost directed -t augmenting path in with respect to and let . The cardinality of is . By Claim 6, . Consider any matching such that , and .
By Lemma 10, there exists an augmenting path in , corresponding to a directed -t path , and by Lemma 10,
Since, is a minimum cost directed -t path, . Therefore,
Thus, . By Lemma 1, . Since the choice of was arbitrary, is rank-maximal among all matchings with cardinality and total deviation .
Our iterative procedure halts in iteration if the graph does not admit any -t path. Recall that we begin by setting , and in the iteration , after computing , if , we set . We return the matching at the end of Step (B).
Lemma 12. The matching returned by Step (B) is a solution to RMM-MIN-TOT in G.
PROOF: From Claim 6, every matching computed in Step (B) has minimum total deviation. Let be a minimum total deviation matching in . By Lemma 9, there exists an integer such that . By Lemma 11, the matching is rank-maximal among all minimum total deviation matchings of cardinality . Thus, . The algorithm retains a matching whose signature is at least as good as that of every matching computed in Step (B). Thus, . Since, is an arbitrary minimum total deviation matching in , the matching is rank-maximal among all minimum total deviation matchings in .
Illustration of algorithm for RMM-MIN-TOT. For an illustration, consider the soft quota setting instance given in Figure 1, and consider the instance . The matching obtained by invoking Step (A) is with (here we omit the number of unmatched applicants) and , which is a solution to RMM-MIN-TOT in . To compute a solution to RMM-MIN-TOT in , we apply our iterative algorithm as described in Step (B). Observe that there are two -t paths in , and we select the min-cost -t path such that and . After the first augmentation, we get a matching, that has a signature of . Observe that is a rank-maximal matching among all matchings with cardinality 4 in . In the next iteration, we select the -t path such that and . After the second augmentation, we get a matching that has a signature of . Observe that, in the next iteration, the directed graph does not admit any -t path, and thus is a solution to RMM-MIN-TOT problem in . Note that the matching is the same as the matching listed in Table 1.
4.2. Modification for Fairness
For the total deviation variant of the problem FAIR-MIN-TOT, we begin by constructing the network H in Step (A) as described in Section 4.1. We modify the cost assignment on the edges in H as follows.
Cost of the edges in H.
• For every edge with rank , we set a cost of .
• For all the other edges in H, we set the cost as 0.
Due to the cost assignment, any min-cost flow in corresponds to a matching , which is a solution to FAIR-MIN-TOT problem in the restricted instance .
In Step (B), we augment the matching in to compute a solution to FAIR-MIN-TOT problem in . We construct a directed graph with costs on edges as described in Step (B). However, we modify the cost assignment as follows.
Cost of the edges in . For an edge of rank ,
• if cost of the edge is
• if cost of the edge is
The procedure of augmentation is the same as that described in Step (B).
5. MIN-MAX Variants
To solve the MIN-MAX type problems in the soft quota setting, namely, OPT-SIGN-MIN-MAX and OPT-MIN-MAX, we exploit their connection to related problems in the fixed quota setting. In particular, to obtain our solutions, we compute optimal matchings (with respect to preferences) among all the matchings that are feasible in the fixed quota setting instance.
We consider an instance of fixed quota setting , where each post has an associated lower quota and an upper quota . For clarity, we denote the lower quota and upper quota of a post in by , and , respectively. When the instance is clear from the context, we omit the subscript .
Assuming that a feasible matching exists in the instance, we first investigate the problem OPT-LQ, which aims to compute a matching that is optimal with respect to the notion of OPT among all feasible matchings of the instance. Note that here, OPT can be set to either rank-maximality or fairness. Recall that in the fixed quota setting, where the lower quota of every post is zero, both these notions are guaranteed to exist, and optimal matchings are efficiently computable by the algorithms given in [21, 22, 25]. Now, we extend these algorithms to compute an optimal matching among all feasible matchings by adapting the algorithm in [25]. Assuming that feasible matchings exist in , we present the algorithm for RMM-LQ.
Given an instance of the RMM-LQ problem, we construct a fixed quota setting instance , where the lower quota of every post is set to 0. For an instance of the fixed quota setting, where the lower quota of every post is 0, we denote by MAX-CARD-RMM the problem of computing a rank-maximal matching among all maximum matchings in the instance. We reduce the problem of computing RMM-LQ in to the problem of computing MAX-CARD-RMM in .
5.1. Reduction from RMM-LQ to MAX-CARD-RMM
Given an instance of RMM-LQ, we construct an instance of the fixed quota setting, where the lower quota of every post is 0, as follows. In the instance , we retain the applicants , posts , and the preferences of applicants over posts from the instance . For every post , we set the lower quota , and upper quota . For a post , we introduce many dummy applicants and add a rank edge incident to for each such applicant. Let . We show a one-to-one correspondence between a matching with cardinality in and a feasible matching in , as stated in Claim 8.
Claim 8. admits a matching of cardinality if and only if admits a feasible matching.
PROOF: Suppose that admits a feasible matching, say . We construct a matching in from such that . In the matching , we retain all the edges from . For every post , we match as many dummy applicants as possible so that the post becomes fully-subscribed in with respect to its upper quota . Observe that .
On the other hand, suppose that admits a matching such that . We construct a matching in by removing all the dummy applicants matched to a post in . Note that, for a post , the number of dummy applicants matched to in is at most . Hence, the number of true applicants matched to in is at least . Thus, for every post , we have , and therefore is a feasible matching in . We state the following claim about a feasible matching in and maximum matchings in with cardinality .
Claim 9. Let and be the instances as defined above. Then,
(i) For any feasible matching in with and cardinality , there exists a corresponding maximum matching in with .
(ii) For a maximum matching in with , and , there exists a corresponding feasible matching in with .
The proof of the above claim follows directly from the proof of Claim 8.
Lemma 13. Let be a solution to MAX-CARD-RMM problem in such that , and let be the corresponding matching in . Then is a solution to RMM-LQ problem in .
PROOF: Since , it follows from Claim 8 that admits a feasible matching. Let the signature of be . Then, by Claim 9(ii), the signature of the corresponding matching in is . Suppose for the sake of contradiction, that is not a solution to RMM-LQ problem in . Then there exists another matching, say , which is a solution to RMM-LQ problem in . Let . Now, consider the matching in that corresponds to in . By Claim 9(i), , where . Observe that, since in , it follows that in , which contradicts the fact that is a solution to MAX-CARD-RMM problem in .
Modifications for fairness. Given an instance of FAIR-LQ, we construct the same instance as described above. But instead of MAX-CARD-RMM, we reduce the problem of computing FAIR-LQ to a problem of computing fair matching on . By applying the techniques used in [25], both problems RMM-LQ and FAIR-LQ admit an algorithm.
5.2. Minimizing maximum deviation in the soft quota setting
Having described the algorithms for the problems RMM-LQ and FAIR-LQ in the fixed quota setting, we now go back to our original problem of minimizing maximum deviation in the soft quota setting. To solve the MIN-MAX type problems in the soft quota setting, namely OPT-MIN-MAX and OPT-SIGN-MIN-MAX, we use a reduction to problems in the fixed quota setting and apply the algorithms for the problems RMM-LQ and FAIR-LQ. We describe our algorithms for the preference optimality as rank-maximality. Analogously, we can solve the problems for the notion of fairness.
We begin by presenting a useful observation about an optimal solution to the problem RMM-MIN-MAX.
Observation 7. Let be an optimal solution to RMM-MIN-MAX, and let be the optimal maximum deviation. Then, there is a post in , which has a lower deviation exactly equal to .
PROOF: Suppose not. Then the lower deviation of all posts with respect to is strictly less than . Let the maximum lower deviation of any post with respect to be . Since , there exists at least one post whose upper deviation is . Let be the set of posts that deviate from their upper target with respect to , such that .
We construct a matching from as follows. For every post , we arbitrarily select matched edges incident on and delete them. We retain all other matched edges in . Let the resulting matching be . Observe that for any post , the upper deviation with respect to is upper bounded by . Since we retained the matched edges corresponding to any post in , the lower deviation of with respect to is also upper bounded by . Thus, , which contradicts the fact that is a matching with minimum maximum deviation.
Next, we describe the reduction from soft quota setting to the fixed quota setting.
Reduction from soft quota setting to the fixed quota setting. Given an instance of the soft quota setting, and a fixed value of maximum deviation , we construct a fixed quota setting instance as follows. In , the applicants, posts, and applicant preferences remain the same as those in . For a post , we set the lower quota as , and the upper quota as . Note that if admits a feasible matching, then the same matching is feasible for a fixed quota setting instance for any deviation . This is because an increase in the deviation widens the range of acceptable numbers of applicants for a post.
Next, we present the algorithms for the RMM-MIN-MAX and RMM-SIGN-MIN-MAX problems.
5.3. Algorithm for RMM-MIN-MAX
Given an instance of the soft quota setting, our goal is to compute a rank-maximal matching among all matchings that have a minimum value of maximum deviation. Under our assumption on , the maximum deviation of any post is upper bounded by . From Observation 7, the maximum deviation value of any matching is also upper bounded by . Therefore, the maximum deviation of any matching lies in the range . To compute the minimum value of maximum deviation, we start by guessing the maximum deviation value and checking whether the corresponding fixed quota setting instance admits a feasible matching. To check feasibility, we can ignore the preferences and use the standard flow network for the bipartite matching with demands on the edges. We perform a binary search on in the range to compute the smallest such that there exists a feasible solution. Let be the minimum value of obtained. Then, corresponding to , we compute a rank-maximal matching among all feasible matchings (RMM-LQ) in the fixed quota setting instance . By the definition of RMM-LQ, the resulting matching has the best possible signature with respect to the notion of rank-maximality while achieving the minimum value for the maximum deviation.
5.4. Algorithm for RMM-SIGN-MIN-MAX
Given an instance of the soft quota setting, and an input signature , our goal is to compute a matching in (recall that is the set of matchings whose signatures are at least as good as with respect to rank-maximality) that has a minimum value of maximum deviation. Under the assumption about , lower deviation of any post is upper bounded by . Similarly, the upper deviation of any post is upper bounded by . Therefore, the maximum deviation of any matching lies in the range . To compute the minimum value of maximum deviation for a matching in , we start by guessing the maximum deviation value and checking whether the corresponding fixed quota setting instance admits a feasible matching. If the instance admits a feasible matching, we compute a rank-maximal matching (RMM-LQ) among all feasible matchings in . If , then satisfies the signature requirement with respect to rank-maximality. We perform a binary search on in the range to compute the smallest such that there exists a matching that meets the signature requirement.
Below, we illustrate the execution of our algorithms for RMM-MIN-MAX and RMM-SIGN-MIN-MAX for the example instance in Figure 1.
Illustration of algorithm for RMM-MIN-MAX. Given the instance , for a given , we construct the corresponding fixed quota setting instance as described in our algorithm. Using binary search, we obtain the minimum value of the maximum deviation as . We then compute an RMM-LQ in the fixed quota setting instance . It is easy to verify that , listed in Table 1 is a solution to the RMM-LQ problem in , and hence a solution to RMM-MIN-MAX problem in .

Figure 5: Optimizing both total deviation and maximum deviation for the problem RMM-SIGN-MIN-Y, where .
Illustration of algorithm for RMM-SIGN-MIN-MAX. Given the instance , for a fixed value of , we construct the corresponding fixed quota setting instance as described in our algorithm. We then apply binary search on the maximum deviation value and solve the RMM-LQ problem in the fixed quota setting instance . For , we construct fixed quota setting instance , and solve the RMM-LQ problem. It is easy to verify that , listed in Table 1, is a solution to the RMM-LQ problem in . Since , the matching is a feasible solution for the problem RMM-SIGN-MIN-MAX. It is easy to verify that any matching that meets the signature requirement has a maximum deviation of at least 2, and thus the matching is an optimal solution for the RMM-SIGN-MIN-MAX problem.
5.5. Modification for Fairness in the soft quota setting
In this section, we state the necessary modifications required to solve the problems FAIR-MIN-MAX and FAIR-SIGN-MIN-MAX.
Algorithm for FAIR-MIN-MAX. Given an instance of the soft quota setting, our goal is to compute a fair matching among all matchings that have a minimum value of maximum deviation. As in the algorithm for the RMM-MIN-MAX problem given in Section 5.3, we first compute the minimum value of maximum deviation, say . Then, corresponding to , we compute a fair matching among all feasible matchings (FAIR-LQ) in the fixed quota setting instance . By the definition of FAIR-LQ, the resulting matching has the best possible signature with respect to the notion of fairness while achieving the minimum value for the maximum deviation.
Algorithm for FAIR-SIGN-MIN-MAX. Given an instance of the soft quota setting, and an input signature , our goal is to compute a matching in (recall that is the set of matchings whose signatures are at least as good as with respect to fairness) that has a minimum value of maximum deviation. As in the algorithm for the problem RMM-SIGN-MIN-MAX given in Section 5.4, we guess a maximum deviation value and check whether the corresponding fixed quota setting instance admits a feasible matching. If the instance admits a feasible matching, we compute a fair matching (FAIR-LQ) among all feasible matchings in . If , then satisfies the signature requirement with respect to fairness. We perform a binary search on in the range to compute the smallest such that there exists a matching that meets the signature requirement.
6. Optimizing both total deviation and maximum deviation
Our problems so far have been defined to optimize either the total deviation or the maximum deviation, but not both simultaneously. A natural question is whether there exists a matching that optimizes both the total deviation and the maximum deviation. To define our problems concretely, we fix the optimality notion as rank-maximality. In Section 6.1, we consider preference optimality first type of problems followed by deviation first type of problems in Section 6.2.
6.1. Preference optimality first
Recall that, in the preference optimality first type of the problem, we are given an instance of the soft quota setting along with a signature. The goal is to compute a matching that satisfies the signature with respect to rank-maximality while optimizing either the total deviation or the maximum deviation. The set of matchings that meet the signature requirement with respect to rank-maximality is denoted by . Within , the set of matchings that minimize the total deviation is denoted by , while the set of matchings that minimize the maximum deviation is denoted by . In the RMM-SIGN-MIN-TOT problem, the goal is to output any matching from , whereas in the RMM-SIGN-MIN-MAX problem, the goal is to output any matching from (see Figure 2).
Having seen efficient algorithms for the RMM-SIGN-MIN-TOT and RMM-SIGN-MIN-MAX problems, we now define a problem that aims to optimize both total deviation and maximum deviation simultaneously. That is, given an instance of the soft quota setting and an input signature , our goal is to decide whether the intersection of and is non-empty, and, if so, computing a matching from this intersection. This problem is denoted by RMM-SIGN-MIN-TM (marked as in Figure 5), where the TM in the name indicates that our goal is to optimize both total and maximum deviations simultaneously. If the intersection of and is empty, we consider the following two optimization problems:
-
RMM-SIGN-MIN-T: compute a matching that has minimum value of maximum deviation from the set . This problem is denoted by RMM-SIGN-MIN-T (marked as in Figure 5), where the T indicates that the primary objective is to minimize the total deviation. Within the set of matchings having minimum total deviation, denoted by , the secondary objective is to minimize the maximum deviation.
-
RMM-SIGN-MIN-M: compute a matching that has minimum value of total deviation from the set . This problem is denoted by RMM-SIGN-MIN-M (marked as in Figure 5), where the M indicates that the primary objective is to minimize the maximum deviation. Within the set of matchings having minimum value of maximum deviation, denoted by , the secondary objective is to minimize the total deviation.
We solve the above problems in polynomial time by adapting our algorithm for the problem RMM-SIGN-MIN-TOT. Recall that, for a given total deviation and a split such that , if the network (shown in Figure 3) admits a feasible flow, then the total deviation of the corresponding matching is at most . However, there are no guarantees on the maximum deviation of the computed matching. In the network depicted in Figure 3, the lower deviation for a post is controlled by the capacity of the edge , while the upper deviation is constrained by the capacity of the edge . By modifying the capacities of these edges, we can bound the maximum deviation. To solve our problems, we modify the network so that we can restrict our attention to matchings with specific values of total deviation and maximum deviation.
Suppose that, for a given instance and an input signature , the optimal values of the total deviation and the maximum deviation are and , respectively. That is, every matching in has total deviation , whereas every matching in has maximum deviation . We now describe our algorithms.
Algorithm for RMM-SIGN-MIN-TM. To determine whether the set is non-empty we make use of our network in Figure 3. We note that, since the optimal value of total deviation is , the network for a particular split as admits a feasible flow, and the corresponding matching satisfies the signature requirement. To restrict our attention to matchings with maximum deviation , we apply the following modifications to the network.
-
For every post , we set the capacities of the edges and to instead of and , respectively.
-
We retain the demands and capacities of all other edges as they are in the original network given in Figure 3.
Let the modified network be . For each split of , we compute a min-cost flow in the network , and check whether the corresponding matching satisfies the signature requirement. As in the algorithm for RMM-SIGN-MIN-TOT, we consider all possible splits of . If for any split, say , the matching corresponding to the min-cost flow, say meets the signature requirement, then the intersection of and is non-empty and we have found the required matching. If none of the splits lead to a matching that satisfies the signature requirement, then the intersection of and is empty.
Algorithm for RMM-SIGN-MIN-T. In the problem RMM-SIGN-MIN-T, the goal is to compute a matching that minimizes the maximum deviation from the set . Observe that any matching in the set has a maximum deviation of at least and at most . Therefore, we perform a linear search within this range to find the optimal value of the maximum deviation. For a specific value of maximum deviation, say , we apply the following modifications to the network given in Figure 3.
-
Fix the value of total deviation as . Thus, we restrict our attention to matchings with total deviation (matchings in the set ).
-
For every post , we set the capacities of the edges and to instead of and , respectively, where .
-
We retain the demands and capacities of all other edges as they are in the original network given in Figure 3.
Let the modified network be . For each split of , we compute a min-cost flow in the network , and check whether the corresponding matching satisfies the signature requirement. If for any split, say , the matching corresponding to the min-cost flow, say meets the signature requirement, then is a candidate value for the maximum deviation. We perform a linear search on to compute a matching in having the smallest value of maximum deviation. With O(\Delta'_t^2) flow computations in the modified network , we can compute a solution for the problem. Since the value of is polynomial in , the algorithm runs in polynomial time.
Algorithm for RMM-SIGN-MIN-M. In the problem RMM-SIGN-MIN-M, the goal is to compute a matching that minimizes total deviation from the set . Observe that any matching in the set has a total deviation of at least and at most . Therefore, we perform a linear search within this range to find the optimal value of total deviation. We apply the following modifications to the network given in Figure 3.

Figure 6: Optimizing both total deviation and maximum deviation for the problem RMM-MIN-Y, where .
-
For every post , we set the capacities of the edges and to instead of and , respectively.
-
We retain the demands and capacities of all other edges as they are in the original network given in Figure 3.
Let the modified network be . Now, we apply our algorithm for RMM-SIGN-MIN-TOT on the modified network. For a given value of , we consider all possible splits corresponding to . If for any split, say , the matching corresponding to the min-cost flow, say meets the signature requirement, then is a candidate value for the total deviation. We perform a linear search on to compute a matching in having the smallest value of total deviation. Note that the time complexity of the above algorithm is same as that of the algorithm for RMM-SIGN-MIN-TOT.
6.2. Deviation first
Now, we consider analogous problems in the deviation first variant. Recall that, in the deviation first type of the problem, we are given an instance of the soft quota setting, and our goal is to compute a rank-maximal matching among all matchings that optimize either the total deviation or the maximum deviation. We denote the set of matchings that minimize total deviation (or max deviation respectively) by (respectively, ). In the RMM-MIN-TOT problem, the goal is to output a rank-maximal matching from the set , while in the RMM-MIN-MAX problem the goal is to output a rank-maximal matching from the set .
We define analogous problems to optimize the total deviation and maximum deviation simultaneously as described in Section 6.1. Given an instance of the soft quota setting, our goal is to decide whether the intersection of and is non-empty, and if so, compute a matching from the intersection. We denote this problem by RMM-MIN-TM (marked as in Figure 6), where the TM in the problem name indicates that our goal is to optimize both the total and the maximum deviation simultaneously. If the intersection of and is empty, we focus on the following two optimization problems:
-
RMM-MIN-T: compute a matching that has minimum value of maximum deviation from the set . This problem is denoted by RMM-MIN-T (marked as in Figure 6), where the indicates that the primary objective is to minimize the total deviation. Within the set of matchings that have minimum value of total deviation, denoted by , the secondary objective is to minimize the maximum deviation.
-
RMM-MIN-M: compute a matching that has minimum value of total deviation from the set . This problem is denoted by RMM-MIN-M (marked as in Figure 6), where indicates that the primary objective is to minimize the maximum deviation. Within the set of matchings that have minimum value of maximum deviation, denoted by , the secondary objective is to minimize the total deviation.
We solve the above problems in polynomial time by adapting our algorithm for the problem RMM-SIGN-MIN-TOT. Suppose that, for a given instance , the optimal values of the total deviation and the maximum deviation are and , respectively. That is, every matching in has total deviation , whereas every matching in has maximum deviation . Now we describe our algorithms.
Algorithm for RMM-MIN-TM. Recall that, in an optimal matching for the RMM-MIN-TOT problem, no post incurs a deviation with respect to the upper target. This implies that any matching in the intersection of and if it exists, has an upper deviation of 0. As described in Section 6.1, we restrict the maximum deviation of a post to . To solve the RMM-MIN-TM problem, we modify the network given in Figure 3 as follows.
-
We set and . Thus, we restrict our attention to matchings with total deviation (matchings in the set ).
-
For every post , we set the capacity of the edge as instead of .
-
We retain the demands and capacities of all other edges as they are in the original network given in Figure 3.
Let the modified network be . If the network admits a feasible flow, we compute a matching corresponding to a min-cost flow. By the correctness of our algorithm for RMM-SIGN-MIN-TOT, is a rank-maximal matching among all matchings with total deviation . By the construction of the network , it follows that , and . Thus, is a solution to the problem RMM-MIN-TM. If the network does not admit any feasible flow, then and are disjoint.
Algorithm for RMM-MIN-T. In the problem RMM-MIN-T, the goal is to compute a matching that minimizes the maximum deviation from the set . Observe that any matching in the set has a maximum deviation of at least and at most . Therefore, we perform a linear search in this range to find the optimal value of maximum deviation. For a given value of maximum deviation, say , we apply the following modification to the network given in Figure 3.
-
We set and . Thus, we restrict our attention to matchings with total deviation (matchings in the set ).
-
For every post , we set the capacity of the edge as instead of , where .
-
We retain the demands and capacities of all other edges as they are in the original network given in Figure 3.
Let the modified network be . For a particular value of , if the network admits a feasible flow, then is a candidate value for the maximum deviation. We perform a linear search on to compute a matching in having the smallest value of maximum deviation. With flow computations in the modified network , we can compute a solution to the problem. Since the value of is polynomial in , the algorithm runs in polynomial time.
Algorithm for RMM-MIN-M. In the problem RMM-MIN-M, the goal is to compute a matching that has the minimum value of total deviation from the set . Observe that any matching in the set has a total deviation of at least and at most . Therefore, we perform a linear search within this range to find the optimal value of total deviation. We apply the following modification to the network given in Figure 3.
-
We set and .
-
For every post , we set the capacity of the edge to instead of .
-
We retain the demands and capacities of all other edges as they are in the original network given in Figure 3.
Let the modified network be . We now apply our algorithm for RMM-SIGN-MIN-TOT on the modified network. For a given value of , if the network admits a feasible flow, then is a candidate value for the total deviation. We perform a linear search on to compute a matching in having the smallest value of total deviation. Note that the time complexity of the above algorithm is same as that of the algorithm for RMM-SIGN-MIN-TOT.
7. Generalized Soft Quota Setting
Having considered the problems in the soft quota setting, we now generalize our framework. In the soft quota setting, deviating by one unit from the given targets incurs a uniform deviation cost across all the posts. A natural generalization of the soft quota setting involves associating costs with these deviations. In an instance of the generalized soft quota setting, every post is associated with two non-zero integral costs – a lower deviation cost , and an upper deviation cost . These values represent the cost of deviating by one unit from the lower target and the upper target, respectively.
As in the soft quota setting, our goal in the generalized soft quota setting is to compute an assignment that has two orthogonal optimization objectives:
(i) Minimizing deviation cost. For a matching , we define the total deviation cost , and the maximum deviation cost as below, and our goal is to minimize one of them. Let and denote the posts that deviate from their lower targets and upper targets, respectively, in . Recall that a post can deviate either from the lower target or from the upper target, but not both. Thus, the sets and are disjoint.
and
(ii) Optimality with respect to preferences. As done earlier, we use rank-maximality and fairness as our notions of optimality.
7.1. Our Problems and Results
In the generalized soft quota setting, we care about deviation cost as well as preference optimality, and this defines our problems.
Deviation cost first. In this type of problem, we give precedence to minimizing the deviation cost first, and subject to that, we optimize the preferences. Let be the set of all matchings in an instance of a generalized soft quota setting. Let (respectively ) denote the set of matchings that have a minimum value of total deviation cost (respectively, the minimum value of maximum deviation cost). We define our first set of problems:
-
OPT-MIN-TOT-DC: The goal is to compute a matching that satisfies the notion with respect to the preferences in the set .
-
OPT-MIN-MAX-DC: The goal is to compute a matching that satisfies the notion with respect to the preferences in the set .
Preference optimality first. This type of problem has a signature requirement as part of the input, and we consider all matchings in the generalized soft quota setting that satisfy the signature requirement with respect to the preference optimality under consideration. Let be the set of all matchings that meet the signature requirement. Let (respectively ) denote the set of matchings that have a minimum value of total deviation cost (respectively, the minimum value of maximum deviation cost) in . We define the following problems:
-
OPT-SIGN-MIN-TOT-DC: The goal is to output any matching in .
-
OPT-SIGN-MIN-MAX-DC: The goal is to output any matching in .
For the maximum deviation cost variants, as well as for the OPT-MIN-TOT-DC problem, we show that our algorithms in the soft quota setting can be extended to solve the analogous problems in the generalized soft quota setting. For the problem OPT-SIGN-MIN-TOT-DC, we are not aware of any hardness or algorithmic results. We show polynomial time algorithms for solving special cases of the problem OPT-SIGN-MIN-TOT-DC.
7.2. Minimizing maximum deviation cost
To solve the MIN-MAX-DC type problems in the generalized soft quota setting, namely OPT-MIN-MAX-DC and OPT-SIGN-MIN-MAX-DC, we use a reduction to problems in the fixed quota setting. We describe the algorithms for the notion of rank-maximality.
We begin by presenting a useful observation about an optimal solution to the problem RMM-MIN-MAX-DC.
Observation 8. Let be an optimal solution to RMM-MIN-MAX-DC, and let be the optimal maximum deviation cost. Then, there exists a post such that, in , the lower deviation cost of is exactly equal to .
PROOF: Suppose not. Then the lower deviation cost of every post with respect to is strictly less than . Let the maximum lower deviation cost of any post with respect to be . Since , there exists at least one post whose upper deviation cost is . Let denote the set of posts that deviate from their upper target with respect to such that .
We construct a matching from as follows. For every post , we arbitrarily select matched edges incident on and delete them. We retain all other matched edges in . Let the resulting matching be . Observe that, for any post , the upper deviation cost with respect to is at most . Since we retained all the matched edges incident on a post in , the lower deviation cost of with respect to is also at most . Thus, , which contradicts the fact that is a matching with minimum maximum deviation cost.
Next, we describe the reduction from generalized soft quota setting to the fixed quota setting.
Reduction from generalized soft quota setting to the fixed quota setting. Given an instance of the generalized soft quota setting, and a fixed value of cost , we construct a fixed quota setting instance as follows. In , the applicants, posts, and applicant preferences remain the same as those of . For a post , we set the lower quota as , and the upper quota as . Note that if admits a feasible matching, then the same matching is feasible for a fixed quota setting instance for any cost . This is because an increase in the cost widens the range of acceptable numbers of applicants for a post.
Let and . Next, we present the algorithms for RMM-MIN-MAX-DC and RMM-SIGN-MIN-MAX-DC.
Algorithm for RMM-MIN-MAX-DC. Given an instance of the generalized soft quota setting, our goal is to compute a rank-maximal matching among all matchings that have a minimum value of maximum deviation cost. Under the assumption about , the maximum deviation of any post is upper bounded by . From Observation 8, the maximum deviation cost of any matching is upper bounded by . Therefore, the maximum deviation cost of any matching lies in the range . To compute the minimum value of maximum deviation cost, we start by guessing the maximum deviation cost value and checking whether the corresponding fixed quota setting instance admits a feasible matching. To check feasibility, we can ignore the preferences and use the standard flow network for the bipartite matching with demands on the edges. We perform a binary search on in the range to compute the smallest such that there exists a feasible solution. Let be the minimum value of obtained. Then, corresponding to , we compute rank-maximal matching among all feasible matchings (RMM-LQ) in the fixed quota setting instance . By the definition of RMM-LQ, the resulting matching has the best possible signature with respect to the notion of rank-maximality while achieving the minimum value for the maximum deviation cost.
Algorithm for RMM-SIGN-MIN-MAX-DC. Given an instance of the generalized soft quota setting and an input signature , our goal is to compute a matching in (recall that is the set of matchings whose signatures are at least as good as with respect to rank-maximality) that has a minimum value of maximum deviation cost. Under the assumption about , lower deviation of any post is upper bounded by . Similarly, the upper deviation of any post is upper bounded by . Therefore, the maximum deviation cost of any matching lies in the range . To compute the minimum value of maximum deviation cost for a matching in , we start by guessing the maximum deviation cost value and check whether the corresponding fixed quota setting instance admits a feasible matching. If the instance admits a feasible matching, we compute a rank-maximal matching (RMM-LQ) among all feasible matchings in . If , then satisfies the signature requirement with respect to rank-maximality. We perform a binary search on in the range to compute the smallest such that there exists a matching that meets the signature requirement.
7.3. Algorithm for RMM-MIN-TOT-DC
Given an instance of the generalized soft quota setting, our goal is to compute a rank-maximal matching among all matchings having the minimum value of total deviation cost. We observe that in an optimal matching , no post incurs a deviation cost on the upper target.
For a given instance of the generalized soft quota setting, let denote the corresponding fixed quota setting instance, where for a post , we set the lower quota and upper quota . Let be the generalized soft quota setting instance obtained from , where for every post , we restrict . Recall that in the case of uniform costs for all posts, any maximum matching in is a minimum total deviation matching in by Lemma 4. However, the analogous claim need not be true in the generalized soft quota setting, as illustrated in the following example.
(i)
(ii)
(iii)
Figure 7: An instance of generalized soft quota setting with two applicants and two posts. Figure 7(i) shows the edge set of . Each post has four values – lower target, upper target, lower deviation cost and the upper deviation cost as shown in Figure 7(ii). Two matchings and in are shown in Figure 7(iii) along with their total deviation cost.
An instance of generalized soft quota setting with two applicants and two posts is given in Figure 7. The edge set of forms a complete bipartite graph, as shown in Figure 7(i). The applicant preferences are shown in Figure 7(i); however, they are not needed for the illustration. Each post in has four values – lower target, upper target, lower deviation cost and the upper deviation cost as shown in Figure 7(ii). While the upper deviation cost values and can take any non-zero integer values, they are not required for the illustration. Since, for every post , we have in , it follows that . Consider the matchings and in , along with their respective total deviation costs, as given in Figure 7(iii). Both and are maximum matchings in the corresponding fixed quota setting instance . Although the deviations of both the matchings are the same, their deviation costs are different.
Recall that in the soft quota setting, the minimum values of total deviation in and are the same, as established in Lemma 5. Using the same arguments, we obtain an analogous result in the generalized soft quota setting stated as Lemma 14.
Lemma 14. Minimum value of total deviation cost in and is the same.
As illustrated by the example in Figure 7, the approach in Section 4.1 cannot be applied directly, and we propose the following modification. To compute a RMM-MIN-TOT-DC matching in , our idea is the following.
-
We construct an instance from , where for every post , . While the construction of remains unchanged, we focus on the set of matchings that minimize total deviation cost, and select a rank-maximal matching from this set. Note that is a solution to RMM-MIN-TOT-DC in .
-
We augment the matching in the corresponding fixed quota setting instance (where , and ) to obtain an RMM-MIN-TOT-DC matching in . This procedure is the same as step (B) of the algorithm for the RMM-MIN-TOT problem given in Section 4.1.
Next, we describe the procedure for computing a rank-maximal matching among all matchings with the minimum total deviation cost.
7.3.1. Computing RMM-MIN-TOT-DC in
Given the instance , we reduce the problem to computing a min-cost max-flow in a suitably designed flow network . A matching corresponding to a min-cost max-flow in has the following two properties:
-
is a matching having the minimum value of total deviation cost in and also in .
-
is a rank-maximal matching among all matchings with minimum total deviation cost in . However, need not be RMM-MIN-TOT-DC in .
The construction of the network is similar to that described in step (A) of the algorithm for the RMM-MIN-TOT problem in the soft quota setting, except for the cost assignment on the edges (see Section 4.1 for the network description). The costs are assigned as follows:
-
For an edge in of rank , we set cost of the corresponding edge in to . This cost assignment is the same as that used in the RMM-MIN-TOT problem.
-
For an edge in , we set the cost as , where is the corresponding lower deviation cost. Recall that, in the RMM-MIN-TOT problem, we set the cost of these edges as 0.
-
For the remaining edges in , we set the cost to 0. This is the same as in the RMM-MIN-TOT problem.
There is a natural correspondence between a flow in and a matching in as follows:
Note that, by our construction, a max-flow in has value . We define the total deviation cost of a max-flow , which is different from the total cost of the max-flow.
Definition 10 (Total deviation cost of a max-flow). Total deviation cost of a max-flow in is defined as
where is the total deviation cost via p through the dummy applicants.
We now focus on matchings in that do not deviate from the upper target. Such matchings correspond to feasible matchings in . For any matching in , we can always construct a max-flow in such that . Similarly, for any max-flow in , we can construct a matching in that does not deviate from the upper target. Therefore, we can restrict our attention to max-flows in .
Cost of a max-flow in H and total deviation cost of a matching in . By the design of our network, we ensure that the cost of a max-flow in H corresponds to the total deviation cost of the corresponding matching in . This is proved in Lemma 15.
Lemma 15. Let be two max-flows in , and let be the corresponding matchings in . If , then .
PROOF: For a post , the incoming flow is via edges in , and . In , only the edges in and have a non-zero cost. Due to the multiplicative factor in the cost of edges in , and the fact that , the contribution of edges in to the cost of the flow is . Recall the cost of an edge in . Observe that cost of the flow can be upper bounded by
where the equality is achieved when all edges are of rank r. Similarly, the cost of the flow can be lower bounded by
where the equality is achieved when all edges are of rank 1.
We show that . Suppose, for the sake of contradiction, assume that . Consider the contribution of edges in to the costs of the flows and . Observe that there are terms with a coefficient of in . Similarly, there are terms with a coefficient of in . Since , we have , which contradicts the fact that .
Using the facts , and , together with the same arguments as in the proof of Lemma 6, we conclude that .
Lemma 16. Let f be a min-cost flow in H, and let be a corresponding matching in . Then is a matching with minimum total deviation cost in .
PROOF: Suppose not. Let be a matching with minimum total deviation cost in , and let be the corresponding flow. Since , it follows from Lemma 15 that , which contradicts the fact that f is a min-cost flow.
Given the connection between the total deviation cost of and established in Lemma 14, which is independent of the preferences, we know that the minimum total deviation cost in is equal to that in . This leads to the following corollary.
Corollary 2. Any min-cost max-flow in corresponds to a matching with minimum total deviation cost in .
We now prove the preference optimality of the matching obtained by step (A).
Lemma 17. Any min-cost max-flow in corresponds to a solution to the RMM-MIN-TOT-DC problem in .
Proof of Lemma 17 is a direct generalization of the proof of Lemma 8.
In step (A), we have computed a matching that is a solution to RMM-MIN-TOT-DC problem in . Using careful augmentations, as described in the Step (B) of the RMM-MIN-TOT problem in the soft quota setting, we can compute a rank-maximal matching among all matchings with minimum total deviation cost in .
7.4. Special case of RMM-SIGN-MIN-TOT-DC
Given an instance of the generalized soft quota setting and an input signature , our goal is to compute a matching that satisfies the signature requirement and has a minimum value of the total deviation cost. For the general case of this problem, we are not aware of any efficient algorithm. As a starting point, we first consider a simpler scenario in which all posts have the same lower deviation cost and the same upper deviation cost . By modifying the network given in Figure 3, we can solve this problem efficiently. We then extend this approach to a special case, where posts are divided into a constant number of partitions, with each partition having a uniform lower and upper deviation cost across all its posts. We provide an efficient algorithm for this case, which we describe below.
We consider the case of the RMM-SIGN-MIN-TOT-DC problem, where posts in are partitioned into . For each post , the cost per lower deviation is , and the cost per upper deviation is . To solve the RMM-SIGN-MIN-TOT-DC problem in this case, we modify the flow network in Figure 3 as follows.
We remove all the outgoing edges from , and introduce nodes . We add an edge from to with vector (demand and capacity).
-
For each , we add an edge from to every post such that , with vector .
-
We remove all incoming edges to , and introduce nodes , for . We add an edge from to with vector .
• For each , we add an edge from to , for , with vector .
In this network, for each , the values and represent the total lower deviation and the total upper deviation, respectively, for all posts in the partition . A min-cost max-flow in this modified network corresponds to a rank-maximal matching in which the total lower and upper deviations for each partition are fixed by the values .
Observe that, for a given , the total deviation of all posts in is at most . Thus, the total number of possible values for is at most . Consequently, the total number of possible combinations of deviations is (assuming that ). Each such combination corresponds to a specific network, and for each network, if it admits a feasible flow, then we compute a rank-maximal matching, say , among all feasible matchings. If , then is a candidate solution. By iterating through all combinations, we compute a solution that satisfies the signature requirement and has the minimum total deviation cost. The time complexity of the algorithm is , where is the time taken to solve the min-cost max-flow problem.
8. Discussion
In this work, we study the problem of computing optimal matchings with one-sided preferences in the soft quota setting. We consider two orthogonal optimization parameters, namely the deviation of the matching and preference optimality. For the preference optimality notions of rank-maximality and fairness, we present efficient algorithms. Our algorithms rely on exponential weights on the edges of the flow network. It would be interesting to design algorithms that do not need large weights.
We also explore a natural generalization of the soft quota setting, where every deviation is associated with a cost. In this generalized soft quota setting, we present efficient algorithms for rank-maximality and fairness when the objective is to optimize the maximum deviation cost. For minimizing total deviation cost, we provide an efficient algorithm for the case where no signature requirement is imposed. However, when a signature requirement is imposed, we are not aware of any hardness or algorithmic results for minimizing total deviation cost, leaving it as an open problem.
Acknowledgements
We thank Govind S Sankar for his valuable contributions and insightful discussions that greatly assisted us in the initial stages of this work.
Appendix
Lemma 3. Let be matchings such that . Then, , where each rank edge has a cost of , and every unmatched applicant is treated as being matched to a dummy post of rank with cost .
PROOF: Let , and . Let be the first rank at which and differ. Thus, for all , and .
The cost difference between the matchings and is
Now, since , we have
Additionally, using the fact that , we conclude that
□
References
[1] K. A. Santhini, R. R. Ravi, M. Nasre, Matchings under one-sided preferences with soft quotas, in: Proceedings of the Thirty-Second International Joint Conference on Artificial Intelligence, IJCAI 2023, 19th-25th August 2023, Macao, SAR, China, 2023, pp. 2774–2782.
[2] D. J. Abraham, K. Cechlárová, D. F. Manlove, K. Mehlhorn, Pareto optimality in house allocation problems, in: International Symposium on Algorithms and Computation, Springer, Berlin, Heidelberg, 2004, pp. 3–15.
[3] P. Biró, Applications of matching models under preferences, in: U. Endriss (Ed.), Trends in Computational Social Choice, AI Access, 2017, pp. 345–373.
[4] N. Garg, T. Kavitha, A. Kumar, K. Mehlhorn, J. Mestre, Assigning papers to referees, Algorithmica 58 (2010) 119–136.
[5] D. J. Abraham, Matching markets: Design and analysis, Ph.D. thesis, Carnegie Mellon University, 2009.
[6] D. Abraham, N. Chen, V. Kumar, V. S. Mirrokni, Assignment problems in rental markets, in: Internet and Network Economics, 2006, pp. 198–213.
[7] P. Biró, T. Fleiner, R. W. Irving, D. F. Manlove, The college admissions problem with lower and common quotas, Theoretical Computer Science 411 (2010) 3136–3153.
[8] A. Arulselvan, Á. Cseh, M. Groß, D. F. Manlove, J. Matuschke, Matchings with lower quotas: Algorithms and complexity, Algorithmica 80 (2018) 185–208.
[9] A. Cseh, T. Friedrich, J. Peters, Pareto optimal and popular house allocation with lower and upper quotas, in: Proceedings of the 21st International Conference on Autonomous Agents and Multiagent Systems, 2022, p. 300–308.
[10] H. Goko, K. Makino, S. Miyazaki, Y. Yokoi, Maximally satisfying lower quotas in the hospitals/residents problem with ties, in: Proceedings of 39th International Symposium on Theoretical Aspects of Computer Science (STACS 2022), 2022, pp. 31:1–31:20.
[11] M. Goto, N. Hashimoto, A. Iwasaki, Y. Kawasaki, S. Ueda, Y. Yasuda, M. Yokoo, Strategy-proof matching with regional minimum quotas, in: Proceedings of the 2014 international conference on Autonomous agents and multi-agent systems, 2014, pp. 1225–1232.
[12] K. Hamada, K. Iwama, S. Miyazaki, The hospitals/residents problem with lower quotas, Algorithmica 74 (2016) 440–465.
[13] T. Fleiner, N. Kamiyama, A matroid approach to stable matchings with lower quotas, Mathematics of Operations Research 41 (2016) 734–744.
[14] D. Monte, N. Tumennasan, Matching with quorums, Economics Letters 120 (2013) 14–17.
[15] M. Nasre, P. Nimbhorkar, Popular matchings with lower quotas, in: 37th IARCS Annual Conference on Foundations of Software Technology and Theoretical Computer Science, 2017, pp. 44:1–44:15.
[16] M. Nasre, P. Nimbhorkar, K. Ranjan, A. Sarkar, Popular matchings in the hospital-residents problem with two-sided lower quotas, in: 41st IARCS Annual Conference on Foundations of Software Technology and Theoretical Computer Science, 2021, pp. 30:1–30:21.
[17] D. Fragiadakis, A. Iwasaki, P. Troyan, S. Ueda, M. Yokoo, Strategyproof matching with minimum quotas, ACM Transactions on Economics and Computation 4 (2016) 1–40.
[18] K. Abe, J. Komiyama, A. Iwasaki, Anytime capacity expansion in medical residency match by monte carlo tree search, in: Proceedings of the Thirty-First International Joint Conference on Artificial Intelligence, IJCAI-22, 2022, pp. 3–9.
[19] F. Bobbio, M. Carvalho, A. Lodi, A. Torrico, Capacity expansion in the college admission problem., arXiv preprint arXiv:2110.00734 (2021).
[20] F. Bobbio, M. Carvalho, A. Lodi, A. Torrico, Capacity variation in the many-to-one stable matching, arXiv preprint arXiv:2205.01302 (2022).
[21] R. W. Irving, T. Kavitha, K. Mehlhorn, D. Michail, K. E. Paluch, Rank-maximal matchings, ACM Transactions on Algorithms (TALG) 2 (2006) 602–610.
[22] K. Paluch, Capacitated rank-maximal matchings, in: International Conference on Algorithms and Complexity, Springer, Berlin, Heidelberg, 2013, pp. 324–335.
[23] H. Hosseini, V. Menon, N. Shah, S. Sikdar, Necessarily optimal one-sided matchings, Proceedings of the AAAI Conference on Artificial Intelligence, (AAAI) 35 (2021) 5481–5488.
[24] J. Peters, Online elicitation of necessarily optimal matchings, Proceedings of the AAAI Conference on Artificial Intelligence 36 (2022) 5164–5172.
[25] C.-C. Huang, T. Kavitha, K. Mehlhorn, D. Michail, Fair matchings and related problems, Algorithmica 74 (2016) 1184–1203.
[26] K. A. Santhini, G. S. Sankar, M. Nasre, Optimal matchings with one-sided preferences: Fixed and cost-based quotas, in: Proceedings of the 21st International Conference on Autonomous Agents and Multiagent Systems, 2022, p. 696–704.
[27] K. A. Santhini, G. S. Sankar, M. Nasre, Optimal matchings with one-sided preferences: fixed and cost-based quotas, Auton. Agents Multi Agent Syst. 39 (2025) 17.
[28] F. Cooper, Fair and large stable matchings in the stable marriage and student-project allocation problems, Ph.D. thesis, University of Glasgow, 2020.
[29] T. N. Dhamala, G. B. Thapa, Apportionment approach for just-in-time sequencing problem, Journal of the Institute of Engineering 7 (2009) 76–89.
[30] F. Pukelsheim, F. Ricca, B. Simeone, A. Scozzari, P. Serafini, Network flow methods for electoral systems, Networks 59 (2012) 73–88.
[31] P. Serafini, B. Simeone, Parametric maximum flow methods for minimax approximation of target quotas in biproportional apportionment, Networks 59 (2012) 191–208.
[32] K. Cechlárová, P. Eirinakis, T. Fleiner, D. Magos, D. Manlove, I. Mourtos, E. Oceláková, B. Rastegari, Pareto optimal matchings in many-to-many markets with ties, Theory of Computing Systems 59 (2016) 700–721.
[33] K. Cechlárová, T. Fleiner, Pareto optimal matchings with lower quotas, Mathematical Social Sciences 88 (2017) 3–10.
[34] M. Nasre, P. Nimbhorkar, N. Pulath, Classified rank-maximal matchings and popular matchings – algorithms and hardness, in: Graph-Theoretic Concepts in Computer Science, 2019, pp. 244–257.
[35] L. Ehlers, I. E. Hafalir, M. B. Yenmez, M. A. Yildirim, School choice with controlled choice constraints: Hard bounds versus soft bounds, Journal of Economic theory 153 (2014) 648–683.
[36] F. Echenique, M. B. Yenmez, How to control controlled school choice, American Economic Review 105 (2015) 2679–94.
[37] Y. A. Gonczarowski, N. Nisan, L. Kovalio, A. Romm, Matching for the israeli” mechanot” gap-year programs: Handling rich diversity requirements, in: Proceedings of the 2019 ACM Conference on Economics and Computation, 2019, pp. 321–321.
[38] H. Aziz, S. Gaspers, Z. Sun, Mechanism design for school choice with soft diversity constraints, in: Proceedings of the Twenty-Ninth International Joint Conference on Artificial Intelligence, IJCAI-20, 2020, pp. 153–159.
[39] R. Kurata, N. Hamada, A. Iwasaki, M. Yokoo, Controlled school choice with soft bounds and overlapping types, Journal of Artificial Intelligence Research 58 (2017) 153–184.
[40] H. Aziz, P. Biró, M. Yokoo, Matching market design with constraints, Proceedings of the AAAI Conference on Artificial Intelligence 36 (2022) 12308–12316.
[41] K. Gajulapalli, J. A. Liu, T. Mai, V. V. Vazirani, Stability-preserving, time-efficient mechanisms for school choice in two rounds, in: 40th IARCS Annual Conference on Foundations of Software Technology and Theoretical Computer Science, 2020, pp. 21:1–21:15.
[42] I. Rios, T. Larroucau, G. Parra, R. Cominetti, Improving the chilean college admissions system, Operations Research 69 (2021) 1186–1205.
[43] J. Chen, G. Csáji, Optimal capacity modification for many-to-one matching problems, in: Proceedings of the 22nd International Conference on Autonomous Agents and Multiagent Systems, 2023, pp. 2880–2882.
[44] G. Limaye, M. Nasre, Optimal cost-based allocations under two-sided preferences, in: Combinatorial Algorithms - 34th International Workshop, IWOCA 2023, Tainan, Taiwan, June 7-10, 2023, Proceedings, 2023, pp. 259–270.
[45] H. Esfandiari, N. Korula, V. Mirrokni, Bi-objective online matching and submodular allocations, Advances in Neural Information Processing Systems 29 (2016).
[46] N. Korula, V. S. Mirrokni, M. Zadimoghaddam, Bicriteria online matching: Maximizing weight and cardinality, in: International conference on web and internet economics, Springer, 2013, pp. 305–318.
[47] G. Aggarwal, Y. Cai, A. Mehta, G. Pierrakos, Biobjective online bipartite matching, in: International Conference on Web and Internet Economics, 2014, pp. 218–231.
[48] R. K. Ahuja, T. L. Magnanti, J. B. Orlin, Network flows - theory, algorithms and applications, Prentice Hall, 1993.