This paper was converted on www.awesomepapers.org from LaTeX by an anonymous user.
Want to know more? Visit the Converter page.

11institutetext: Indian Institute of Technology Madras, India
11email: [email protected], [email protected], [email protected]
22institutetext: FLAME University, Pune, India
22email: [email protected]

Generalized Capacity Planning for the Hospital-Residents Problemthanks: A preliminary version of this work appeared in IWOCA 2023 [15].

Haricharan Balasundaram 11    Girija Limaye This work is partially done when the author was a Ph.D. scholar at IIT Madras.22    Meghana Nasre 11    Abhinav Raja 11
Abstract

The Hospital Residents setting models important problems like school choice, assignment of undergraduate students to degree programs, among many others. In this setting, fixed quotas are associated with the programs that limit the number of agents that can be assigned to them. Motivated by scenarios where all agents must be matched, we propose and study a generalized capacity planning problem, which allows cost-controlled flexibility with respect to quotas.

Our setting is an extension of the Hospital Resident setting where programs have the usual quota as well as an associated cost, indicating the cost of matching an agent beyond the initial quotas. We seek to compute a matching that matches all agents and is optimal with respect to preferences, and minimizes either a local or a global objective on cost.

We show that there is a sharp contrast – minimizing the local objective is polynomial-time solvable, whereas minimizing the global objective is 𝖭𝖯\sf NP-hard. On the positive side, we present approximation algorithms for the global objective in the general case and a particular hard case. We achieve the approximation guarantee for the special hard case via a linear programming based algorithm. We strengthen the 𝖭𝖯\sf NP-hardness by showing a matching lower bound to our algorithmic result.

Keywords:
Stable matchings, capacity augmentation, matchings under preferences

1 Introduction

The problem of computing optimal many-to-one matchings under two-sided preferences is extensively investigated in the literature [10, 18, 16, 4, 1]. This setting is commonly known as the Hospital Residents (hr) setting.

In the hr setting [10] we are given a set of agents (residents), a set of programs (hospitals), and a set of mutually acceptable pairs between them. Each agent and every program has a preference ordering over its mutually acceptable partners. Additionally, every program has a positive integral capacity that denotes the maximum number of agents that can be assigned to the program. The goal is to compute a matching, that is, an assignment between agents and programs that is optimal with respect to preferences and capacities. This setting models several real-world problems, such as assigning students to schools [1], elective courses [16], assigning medical interns to hospitals [18], and assigning undergraduate students to university programs [4].

In this setting, stability is a well-accepted notion of optimality. An assignment between agents and programs is stable if no agent-program pair has an incentive to deviate from it [10]. It is known that all stable assignments match the same set of agents [10]. In certain applications of the hr setting, every agent must be matched. For instance, in school choice [1] every child must find a school; while matching sailors to billets in the US Navy [21, 17], every sailor must be assigned to some billet. In the hr setting, the rigid upper-quotas limit the number of agents that can be matched in any matching.

The problem of capacity expansion is investigated very recently in [6, 5, 2, 7]. In the capacity expansion problem, the quotas of programs are augmented to improve the welfare of the agents. In another work, Gajulapalli et al. [9] study a two-round mechanism for school admissions in which the goal of the second round is to accommodate more students by suggesting quota increments to schools.

In our work, we are interested in the capacity augmentation problem to ensure that every agent is matched in a stable matching of the resulting instance. Our setting is similar to the hr setting except that in addition to the (initial) capacities, every program also specifies a cost of matching additional agents to it. The capacity of programs can be augmented by spending an additional cost per augmented seat such that a stable matching in the augmented instance matches every agent.

Two special cases of this setting have been studied recently by Chen et al. [7] and Nasre and Limaye [15]. In [7], the authors assume that each program has a unit cost per augmented seat. In [15], the authors assume that the cost per augmented seat can be a non-negative integer but the initial capacities are zero. In both these works, the two main problems investigated are as follows: given an instance with agents, programs, preferences on both sides, capacities, and costs, augment the instance so that it admits a stable matching that matches every agent such that one of the following goals is achieved.

  • the maximum augmentation cost spent at a program is minimum

  • the total augmentation cost spent across all programs is minimum

In the generalized setting considered in this paper, we allow both, that is, an arbitrary positive integral initial capacities (unlike zero initial capacities in [15]) and arbitrary non-negative integral costs (unlike unit costs in [7]). We are ready to define our problems formally.

1.1 Notation and Problem Definition

We are given a bipartite graph G=(𝒜𝒫,E)G=(\mathcal{A}\cup\mathcal{P},E), where 𝒜\mathcal{A} denotes the set of agents and 𝒫\mathcal{P} denotes the set of programs. An edge (a,p)E(a,p)\in E indicates that aa and pp form an acceptable agent-program pair. For each vertex v𝒜𝒫v\in\mathcal{A}\cup\mathcal{P}, we define 𝒩(v)\mathcal{N}(v) to be the set of vertices adjacent to vv (that is, the neighborhood of vv). Each vertex v𝒜𝒫v\in\mathcal{A}\cup\mathcal{P} ranks vertices in 𝒩(v)\mathcal{N}(v) in a strict order, called the preference list of vertex vv. For any vertex v𝒜𝒫v\in\mathcal{A}\cup\mathcal{P}, if vv prefers xx over yy then we denote it by xvyx\succ_{v}y, equivalently, yvxy\prec_{v}x. The length of the longest preference list of an agent is denoted by a\ell_{a} and the length of the longest preference list of a program is denoted by p\ell_{p}. Each program pp has an initial quota q(p)q(p) which is a positive integer. In literature, this instance is referred to as the hr instance (programs being the hospitals and agents being the residents). In our setting, in addition to the quotas, a program pp has an associated non-negative integral cost c(p)c(p). As long as a matching matches upto q(p)q(p) many agents to pp, no cost is incurred. For each agent matched above the quota of pp, we incur a cost c(p)c(p) for exceeding the quota of pp.

A many-to-one matching (called matching here onwards) MEM\subseteq E in an hr instance is an assignment of agents to programs such that each agent is matched to at most one program and each program pp is matched to at most q(p)q(p) many agents. Let M(a)M(a) denote the program to which the agent a𝒜a\in\mathcal{A} is matched. We say M(a)=M(a)=\bot if aa is unmatched in MM. Let M(p)M(p) denote the set of agents matched to program pp. We call a program p𝒫p\in\mathcal{P} under-subscribed in a matching MM if |M(p)|<q(p)|M(p)|<q(p) and fully-subscribed if |M(p)|=q(p)|M(p)|=q(p). We assume that any agent prefers to be matched (to some program) rather than being unmatched.

Definition 1 (Stable Matching).

A pair (a,p)EM(a,p)\in E\setminus M is a blocking pair w.r.t. the matching MM if paM(a)p\succ_{a}M(a) and pp is either under-subscribed in M or there exists at least one agent aM(p)a^{\prime}\in M(p) such that apaa\succ_{p}a^{\prime}. A matching M is said to be stable if there is no blocking pair w.r.t. M.

Given an hr instance, a stable matching is guaranteed to exist and can be computed in linear time by the celebrated Gale and Shapley algorithm [10]. A matching MM is 𝒜\mathcal{A}-perfect if every agent is matched in MM. In this work, our goal is to compute a matching that is stable and 𝒜\mathcal{A}-perfect. There exist simple hr instances that do not admit an 𝒜\mathcal{A}-perfect stable matching. An hr instance may admit multiple stable matchings, however, by the Rural Hospitals’ Theorem [18], it is known that all stable matchings in an hr instance match the same set of agents. Thus, one can efficiently determine whether an hr instance admits an 𝒜\mathcal{A}-perfect stable matching.

In this work, to achieve 𝒜\mathcal{A}-perfectness, we consider quota augmentation for programs. Let \mathbb{N} be the set of non-negative integers. Let q~:𝒫\tilde{q}:\mathcal{P}\rightarrow\mathbb{N} be a function that maps a non-negative integer to every program p𝒫p\in\mathcal{P}. The q~(p)\tilde{q}(p) indicates the amount by which the quota at program pp should be increased such that the modified hr instance admits an 𝒜\mathcal{A}-perfect stable matching MM and for every program pp the quota of pp is equal to q(p)+q~(p)q(p)+\tilde{q}(p).

A trivial quota augmentation wherein for every program pp, q~(p)\tilde{q}(p) is set such that q(p)+q~(p)=|𝒩(p)|q(p)+\tilde{q}(p)=|\mathcal{N}(p)| always results in an 𝒜\mathcal{A}-perfect stable matching. To control q~(p)\tilde{q}(p), we use the cost function c:𝒫c:\mathcal{P}\rightarrow\mathbb{N} over the set of programs. Given a matching MM, the cost incurred at a program pp is q~(p)c(p)\tilde{q}(p)\cdot c(p). In other words, the initial q(p)q(p) many positions of a program pp are free.

Given an hr instance along with costs, our goal is to compute an 𝒜\mathcal{A}-perfect, stable matching that incurs the minimum cost. We consider two natural notions of minimization over cost:

  • minimize the total cost incurred, that is, p𝒫(q~(p)c(p))\sum_{p\in\mathcal{P}}(\tilde{q}(p)\cdot c(p)).

  • minimize the maximum cost incurred at any program, that is, maxp𝒫{q~(p)c(p)}\max_{p\in\mathcal{P}}\{\tilde{q}(p)\cdot c(p)\}.

Based on this, we define the MinSum and the MinMax problems as follows:

MinSum problem: Given G=(𝒜𝒫,E)G=(\mathcal{A}\cup\mathcal{P},E), preferences of agents and programs, quota q(p)q(p) for every program pp, a cost function cc (defined earlier), the MinSum problem asks for a quota augmentation function q~\tilde{q} and an 𝒜\mathcal{A}-perfect stable matching in the augmented instance such that the total cost of augmentation is minimized.

MinMax problem: Given G=(𝒜𝒫,E)G=(\mathcal{A}\cup\mathcal{P},E), preferences of agents and programs, quota q(p)q(p) for every program pp, a cost function cc (defined earlier), the MinMax problem asks for a quota augmentation function q~\tilde{q} and an 𝒜\mathcal{A}-perfect stable matching in the augmented instance such that the maximum augmentation cost spent at a program is minimized.

Next, we define two special cases of MinSum and MinMax.

  1. 1.

    Unit cost for augmentation: When every program pp has c(p)=1c(p)=1, we denote the problems as MinSumQ and MinMaxQ. This is equivalent to the setting investigated by Chen et al. [7].

  2. 2.

    Initial quotas being zero: When every program pp has q(p)=0q(p)=0, we denote the problems as MinSumC and MinMaxC. This is equivalent to the cost-controlled quotas setting investigated by Limaye and Nasre [15].

The notion of stability considered earlier, is defined with respect to input quotas. In a setting where initial quotas may be zero, we use the following well-studied relaxation of stability. Recall that if the matching MM is not stable then there exists a blocking pair (a,p)(a,p) with respect to MM. The blocking pair may arise due to under-subscription of the program or may arise due to the matching MM assigning to pp an agent that pp prefers lower than aa. If we allow blocking pairs arising due to an under-subscribed program pp, then we get a relaxation of stability, called envy-freeness [20].

Definition 2 (Envy-Freeness).

Given a matching MM, an agent aa has a justified envy (here onwards, called envy) towards another agent aa^{\prime} if (a,p)M(a^{\prime},p)\in M, paM(a)p\succ_{a}M(a) and apaa\succ_{p}a^{\prime}. The pair (a,a)(a,a^{\prime}) is called an envy-pair w.r.t. MM. A matching MM is envy-free if there is no envy-pair w.r.t. MM.

We observe the following about envy-freeness and stability when the initial quotas of all programs are zero. Let HH be an instance in our setting in which the initial quotas of all programs are zero. Let MM be an 𝒜\mathcal{A}-perfect matching in the augmented instance HH^{\prime}. If MM is stable in HH^{\prime}, then by definition, MM is also envy-free in HH^{\prime}. Next, suppose that MM is an envy-free matching in HH^{\prime}. Let GG denote the hr instance wherein the preferences are borrowed from HH^{\prime} (that is, HH), and for every program pp, we set its quota in GG to be equal to |M(p)||M(p)|. Then, MM is stable in GG. This implies that when we start with initial quotas of all programs being zero, envy-freeness and stability are equivalent.

Example. Consider an instance shown in Fig. 1 with three agents a1,a2,a3a_{1},a_{2},a_{3} and three programs p1,p2,p3p_{1},p_{2},p_{3}. The tuple (q,c)(q,c) preceding a program indicates that the program has initial quota qq and the cost cc of matching a single agent to it. That is, q(p1)=1q(p_{1})=1, q(p2)=1q(p_{2})=1, q(p3)=0q(p_{3})=0 and c(p1)=0c(p_{1})=0, c(p2)=3c(p_{2})=3, c(p3)=4c(p_{3})=4. Consider the two 𝒜\mathcal{A}-perfect stable matchings: M1={(a1,p2),(a2,p2),(a3,p2)}M_{1}=\{(a_{1},p_{2}),(a_{2},p_{2}),(a_{3},p_{2})\} and M2={(a1,p2),(a2,p3),(a3,p2)}M_{2}=\{(a_{1},p_{2}),(a_{2},p_{3}),(a_{3},p_{2})\}. The total augmentation cost spent in M1M_{1} and M2M_{2} is 66 and 77 respectively, whereas the maximum augmentation cost spent in M1M_{1} and M2M_{2} is 66 and 44 respectively.

It is straightforward to verify that M1M_{1} is the unique optimal solution for MinSum, whereas M2M_{2} is the unique optimal solution for MinMax.

a1\displaystyle a_{1} :p2p1\displaystyle:p_{2}\succ p_{1}
a2\displaystyle a_{2} :p3p2\displaystyle:p_{3}\succ p_{2}
a3\displaystyle a_{3} :p2\displaystyle:p_{2}
(1,0)p1\displaystyle(1,0)\ p_{1} :a1\displaystyle:a_{1}
(1,3)p2\displaystyle(1,3)\ p_{2} :a1a2a3\displaystyle:a_{1}\succ a_{2}\succ a_{3}
(0,4)p3\displaystyle(0,4)\ p_{3} :a2\displaystyle:a_{2}
Figure 1: An illustrative example for MinSum and MinMax.

1.2 Our results

We show that the MinMax problem can be solved in polynomial time whereas the MinSum problem is 𝖭𝖯\sf NP-hard. Moreover, the MinSum problem is inapproximable under standard complexity-theoretic assumptions.

Theorem 1.1.

The MinMax problem can be solved in O(mlogm)O(m\log m) time where m=|E|m=|E|.

We say that the preferences of elements of a particular set, say the agent set, are derived from a master list if there is an ordering of the programs and the preferences of all agents respect this ordering.

Theorem 1.2.

MinSumC cannot be approximated within a constant factor unless 𝖯=𝖭𝖯\sf P=\sf NP. The result holds even when the preferences of agents and programs are derived from a master list and there are only two distinct costs in the instance.

The above theorem immediately implies that the MinSum problem is constant-factor inapproximable. The constant factor inapproximability of the MinSum problem is known from the result of Chen et al. [7], however their result does not imply Theorem 1.2. We further show that under the Unique Games Conjecture (UGC) [13], MinSumC cannot be approximated to within (aϵ)(\ell_{a}-\epsilon) for any ϵ>0\epsilon>0.

Theorem 1.3.

MinSumC cannot be approximated to within a factor of (aϵ\ell_{a}-\epsilon) for any ϵ>0\epsilon>0 under UGC. This holds even when the preferences of agents and programs are derived from a master list and there are only two distinct costs.

Theorem 1.3 implies that the MinSum problem is also (aϵ\ell_{a}-\epsilon)-inapproximable (ϵ>0\epsilon>0) under UGC. This gives another lower bound for the MinSum problem.

We now state our algorithmic results for MinSum. We present two approximation algorithms for the general instances of the MinSum problem.

Theorem 1.4.

MinSum admits a |P||P|-approximation algorithm which runs in O(mlogm)O(m\log m) time.

Theorem 1.5.

MinSum admits an p\ell_{p}-approximation algorithm which runs in O(mp)O(m\cdot\ell_{p}) time, where p\ell_{p} denotes the length of the longest preference list of a program.

We present an approximation algorithm with a guarantee of a\ell_{a} when the instance has two distinct costs, thereby meeting the lower bound presented in Theorem 1.3.

Theorem 1.6.

MinSumC admits an a\ell_{a}-approximation algorithm when the instance has two distinct costs.

Our results are summarized in Table 1.

MinMax MinSum
In 𝖯\sf P (Theorem 1.1) 𝖭𝖯\sf NP-hardness and constant factor inapproximability (follows from Theorem 1.2) (aϵ)(\ell_{a}-\epsilon)-inapproximability (for any ϵ>0\epsilon>0) under UGC (Theorem 1.3) |𝒫||\mathcal{P}|-approximation (Theorem 1.4) p\ell_{p}-approximation (Theorem 1.5) a\ell_{a}-approximation for MinSumC when two distinct costs (Theorem 1.6)
Table 1: Summary of our results

Outline of the paper. In Section 2 we present a brief literature review. In Section 3 we present our algorithmic results for MinMax and general instances of MinSum. In Section 4 we present an algorithm for the restricted case of MinSumC problem with two distinct costs. Section 5 presents our hardness and inapproximability results. We conclude in Section 6.

2 Related Work and Background

Capacity planning and or capacity augmentation has received attention in the recent past since it is a natural and practical approach to circumvent rigid quotas for matching problems. The capacity planning problem with a similar motivation as ours is studied extensively under the two-sided preference setting in  [9, 6, 5, 2, 7, 3]. In the two-round school choice problem studied by Gajulapalli et al. [9], their goal in round-2 is to match all agents in a particular set. This set is derived from the matching in round-1 and they need to match the agents in an envy-free manner (called stability preserving in their work). This can still leave certain agents unassigned. It can be shown that the MinSumC setting generalizes the matching problems in round-2. We remark that in [9] the authors state that a variant of MinSumC problem (Problem 33, Section 7) is 𝖭𝖯\sf NP-hard. However, they do not investigate the problem in detail.

In the very recent works [6, 5, 2] the authors consider the problem of distributing extra seats (beyond the input quotas) limited by a budget that leads to the best outcome for agents. Their setting does not involve costs, and importantly, 𝒜\mathcal{A}-perfectness is not guaranteed. Bobbio et al. [6] show the 𝖭𝖯\sf NP-hardness of their problem. Bobbio et al. [5] and Abe et al. [2] propose a set of approaches which include heuristics along with empirical evaluations. In our work, we present algorithms with theoretical guarantees. Chen and Csáji [7] investigate a variant of the capacity augmentation problem mentioned earlier and present hardness, approximation algorithms, and parameterized complexity results. Chen and Csáji [7] investigate several variants of MinSumQ with objectives such as Pareto efficiency and student popularity instead of 𝒜\mathcal{A}-perfectness. They show these variants to be hard, which implies the hardness of the corresponding objectives in the generalized MinSum setting as well. Since these variants do not require 𝒜\mathcal{A}-perfectness, they are trivial in the cost-controlled quotas setting (as in [15]) - if there are no programs with cost 0, the solution will be the empty matching. If there are programs with cost 0, the solution can be obtained by matching every agent to their highest-preferred such program.

Capacity augmentation along with costs has also been considered in the one-sided preference list setting, known as the house allocation problem. Here every agent has a preference ordering over a subset of the programs and programs are indifferent between the its neighbours. In the one-sided preference list setting various notions of optimality like rank-maximilaity, fairness, popularity and weak dominance are studied. Kavitha and Nasre [11] and Kavitha et al. [12] address the capacity augmentation problem for the notion of popularity. It is known that a popular matching is not guaranteed to exist in the one-sided preference list setting. Therefore, their objective was to optimally increase program quotas to create an instance that admits a popular matching. In their setting, the min-max version turns out to be 𝖭𝖯\sf NP-hard whereas the min-sum problem (without the 𝒜\mathcal{A}-perfectness requirement) is polynomial time solvable.

The cost-based quotas considered in our work are also considered in the one-sided preference setting by Santhini et al. [19]. In their work, the authors ask for stronger guarantees on the output matching than 𝒜\mathcal{A}-perfectness. This is expressed in terms of a signature of a matching which allows encoding requirements about the number of agents matched to a particular rank. They consider the problem of computing a min-cost matching with a desired signature and show that it is efficiently solvable. This results in the one-sided setting are in contrast to the hardness and inapproximability results we show for a similar optimization problem under two-sided preferences.

Before we proceed to present our results, we discuss important connections between envy-free matchings and stable matchings in an hr instance.

2.1 Envy-free Matchings to Stable Matchings

As noted earlier, envy-freeness and stability are not equivalent in the hr setting. We begin by noting a useful property about any blocking pair with respect to an envy-free matching.

Lemma 1.

If MM is an envy-free matching that is not stable, then all the blocking pairs have under-subscribed programs.

Proof.

Suppose for the sake of contradiction that there exists a blocking pair (a,p)(a,p) such that the program pp is fully-subscribed (|M(p)|=q(p)|M(p)|=q(p)). Since (a,p)(a,p) is a blocking pair, we must have q(p)>0q(p)>0. Hence, |M(p)|>1|M(p)|>1 and there exists an agent aM(p)a^{\prime}\in M(p), such that apaa\succ_{p}a^{\prime}. This implies that (a,a)(a,a^{\prime}) is an envy pair, a contradiction to the fact that MM is an envy-free matching. ∎

Next we show that it is possible to convert an envy-free matching MM in an hr instance to a stable matching MsM_{s} in the same hr instance (with the program quotas unchanged) such that the agents that are matched in MM remain matched in MsM_{s}. Algorithm 1 gives a simple procedure for the same.

Algorithm 1 Convert an envy-free matching to a stable matching
1:Input: An envy-free matching MM in an hr instance GG
2:Output: A stable matching MsM_{s} in GG such that agents matched in MM remain matched in MsM_{s}
3:MsMM_{s}\leftarrow M
4:while \exists blocking pair (a,p)(a^{\prime},p) w.r.t. MsM_{s} do
5:     Let aa be the highest-preferred agent by pp such that paMs(a)p\succ_{a}M_{s}(a)
6:     MsMs{(a,Ms(a))}{(a,p)}M_{s}\leftarrow M_{s}\setminus\{(a,M_{s}(a))\}\cup\{(a,p)\}
7:return MsM_{s}

It is easy to see that no agent who is matched in MM gets unmatched in MsM_{s}. Next, we prove that in each iteration of the algorithm in line 6, MsM_{s} remains envy-free.

Lemma 2.

The matching MsM_{s} remains envy-free after every execution of line 6.

Proof.

Let aa be the agent and pp be the program selected in line 5. Agent aa is promoted in line 6, so aa will not envy any new agents after this step. Since aa is the highest-preferred agent that forms a blocking pair with respect to pp, after the promotion in line 6, no new agents will envy aa either. To see this, note that all agents a′′a^{\prime\prime} such that a′′paa^{\prime\prime}\succ_{p}a are either already matched to pp or matched to some pp^{\prime} such that pa′′pp^{\prime}\succ_{a^{\prime\prime}}p. Since the initial matching MM is envy-free and no new envy pairs are created after each execution of line 6, MsM_{s} remains envy-free. ∎

Lemma 3.

Algorithm 1 terminates and outputs a stable matching MsM_{s}.

Proof.

The while loop of the algorithm runs as long as the matching MsM_{s} is not stable. At each iteration, since by Lemma 2 the matching MsM_{s} is envy-free and possibly not yet stable, we are guaranteed to find a blocking pair. By Lemma 1 such a blocking pair is guaranteed to be of an under-subscription type blocking pair. Furthermore, once a blocking pair is found, the agent aa gets promoted. Since agent preference lists are finite, this procedure must terminate in O(m)O(m) iterations. Finally, when we exit the while loop, the matching does not admit any blocking pair which implies that MsM_{s} is stable. ∎

This establishes the following lemma.

Lemma 4.

Given an envy-free matching MM in an hr instance, we can obtain a stable matching MsM_{s} in the same hr instance such that the agents matched in MM remain matched in MsM_{s}.

Lemma 4 implies that if MM is an 𝒜\mathcal{A}-perfect, envy-free matching in an hr instance , then there exists an 𝒜\mathcal{A}-perfect, stable matching MsM_{s} in the same instance.

3 Algorithmic results

In this section, we present our algorithmic results for the MinMax problem (Theorem 1.1) and our approximation algorithms for general instances of the MinSum problem (Theorem 1.4 and Theorem 1.5).

3.1 Polynomial time algorithm for MinMax

In this section, we present a polynomial time algorithm for the MinMax problem. We begin with some observations. Let MM^{*} be an optimal solution for the MinMax problem and let t=maxp{c(p)q~(p)}t^{*}=\max_{p}\{c(p)\cdot\tilde{q}(p)\} be the cost of MM^{*}. For an integer tt, we define GtG_{t} to be the hr instance such that for every program p𝒫p\in\mathcal{P}, its quota is q(p)+tc(p)q(p)+\left\lfloor\frac{t}{c(p)}\right\rfloor. We observe the following:

  • For any integer ttt\geq t^{*}, there exists an 𝒜\mathcal{A}-perfect stable matching in GtG_{t}. This holds because MM^{*} is an 𝒜\mathcal{A}-perfect stable matching in GtG_{t} and for every program pp, q(p)q(p) in GtG_{t} is at least as much as q(p)q(p) in GtG_{t^{*}}. Therefore, MM^{*} is an 𝒜\mathcal{A}-perfect envy-free matching in GtG_{t}. Combining these facts with Lemma 4 we get the desired result.

  • For any integer t<tt<t^{*}, there does not exist an 𝒜\mathcal{A}-perfect stable matching in GtG_{t}.

In the following lemma, we show an upper bound on the number of distinct values that tt^{*} can take. Recall that m=|E|m=|E|.

Lemma 5.

There are at most m+1m+1 many distinct values that tt^{*} possibly takes.

Proof.

For any program pp, 0q~(p)|𝒩(p)|q(p)0\leq\tilde{q}(p)\leq|\mathcal{N}(p)|-q(p). This holds because in any solution (𝒜\mathcal{A}-perfect stable matching), for any program pp, the initial quota and the quota augmentation together cannot be more than |𝒩(p)||\mathcal{N}(p)|.

The cost tt^{*} is either equal to 0 or equal to c(p)kc(p)\cdot k, for some kk and some p𝒫p\in\mathcal{P} such that 1k|𝒩(p)|q(p)|𝒩(p)|1\leq k\leq|\mathcal{N}(p)|-q(p)\leq|\mathcal{N}(p)|. Thus, for a fixed program pp, we have at most |𝒩(p)||\mathcal{N}(p)| many non-zero values, if c(p)>0c(p)>0. Thus, tt^{*} takes at most p𝒫|𝒩(p)|=|E|=m\sum_{p\in\mathcal{P}}|\mathcal{N}(p)|=|E|=m many distinct non-zero values. Including 0, the lemma holds. ∎

We now give a polynomial-time algorithm for the MinMax problem – construct a sorted array c^\hat{c} such that it contains all the possible values of tt^{*}. Then perform a binary search on this array. For each cost tt being considered, construct the hr instance GtG_{t} and check whether GtG_{t} admits an 𝒜\mathcal{A}-perfect stable matching. If yes, search over values less than or equal to tt, otherwise search over values strictly greater than tt.

By Lemma 5, there are O(m)O(m) values in the array c^\hat{c} and binary search over these costs takes O(logm)O(\log m) iterations. In each iteration a stable matching is computed and checked for 𝒜\mathcal{A}-perfectness, thereby spending O(m)O(m) time per iteration. This implies that the algorithm runs in O(mlogm)O(m\log{m}) time. This proves Theorem 1.1.

3.2 |P||P|-approximation algorithm for MinSum

Using the algorithm for the MinMax problem presented in Section 3.1, we present a |P||P|-approximation algorithm for the MinSum problem.

Lemma 6.

The optimal solution for the MinMax problem is a |𝒫||\mathcal{P}|-approximation for the MinSum problem on the same instance.

Proof.

Given an instance GG, let MM^{*} be an optimal solution for MinMax and let its cost be tt^{*}. Let the optimal cost of MinSum on the same instance be yy^{*}. Clearly, yty^{*}\geq t^{*} (otherwise it contradicts the optimality of tt^{*} for MinMax).

Since tt^{*} is the maximum augmentation cost spent at any program in MM^{*}, the total cost of MM^{*} is at most |𝒫|t|\mathcal{P}|\cdot t^{*}. Hence, the total cost of MM^{*} is at most |𝒫|y|\mathcal{P}|\cdot y^{*}, giving us the desired approximation. ∎

This proves Theorem 1.4.

3.3 p\ell_{p}-approximation algorithm for MinSum

In this section, we present an p\ell_{p}-approximation algorithm for the MinSum problem. This algorithm is an extension of the algorithm presented in [15] for a restricted setting wherein all initial quotas are zero.

Let GG be the instance of the MinSum problem. Let MIM_{I} be any stable matching in GG. We call MIM_{I} the initial stable matching. If MIM_{I} is 𝒜\mathcal{A}-perfect then we return MIM_{I}. Otherwise, at least one agent is unmatched in MIM_{I}. Let 𝒜u\mathcal{A}_{u} denote the set of agents that are unmatched in MIM_{I}. It is well known that all stable matchings of an hr instance match the same set of agents [18]. Hence, the set 𝒜u\mathcal{A}_{u} is invariant of MIM_{I}. For every agent aa, let pap_{a}^{*} denote the least-cost program occurring in the preference list of aa. If there are multiple such programs, let pap_{a}^{*} be the highest-preferred one among them. Using MIM_{I} we construct an 𝒜\mathcal{A}-perfect matching by matching every agent u𝒜uu\in\mathcal{A}_{u} to pup_{u}^{*}. This gives us an intermediate matching, we call it MLM_{L}. We observe that MLM_{L} is 𝒜\mathcal{A}-perfect but not necessarily stable. Next, we promote agents to ensure that MLM_{L} is stable, as described below.

We start with the matching M=MLM=M_{L}. We consider a program pp and consider agents in the reverse order of the preference list of pp. If an agent aa envies agent aM(p)a^{\prime}\in M(p) then we promote aa by unmatching it and matching it to pp (see Fig. 2). This process repeats for every program. The pseudo-code is given in Algorithm 2.

aaaa^{\prime}ppM(a)M(a)
Figure 2: Promotion of agents who envy
Algorithm 2 p\ell_{p}-approximation for MinSum problem
1:Input: an instance GG of the MinSum problem
2:Output: an 𝒜\mathcal{A}-perfect stable matching in an augmented instance of GG
3:let MIM_{I} be a stable matching in the GG
4:if MIM_{I} is 𝒜\mathcal{A}-perfect then
5:     return MIM_{I}
6:let MLM_{L} be the matching obtained as follows: ML{paa𝒜uMI(a)a𝒜uM_{L}\leftarrow\begin{cases}p_{a}^{*}&a\in\mathcal{A}_{u}\\ M_{I}(a)&a\notin\mathcal{A}_{u}\end{cases}
7:MMLM\leftarrow M_{L}
8:for every program pp do
9:     for every agent a𝒜a\in\mathcal{A} in reverse preference list ordering of pp do
10:         if aM(p)\exists a^{\prime}\in M(p) such that apaa\succ_{p}a^{\prime} and paM(a)p\succ_{a}M(a) then
11:              M=M{(a,M(a)}{(a,p)}M=M\setminus\{(a,M(a)\}\cup\{(a,p)\}               
12:return MM

We proceed to prove the correctness. We begin by showing that the matching MM computed by Algorithm 2 is an 𝒜\mathcal{A}-perfect stable matching.

Lemma 7.

The matching MM computed by Algorithm 2 is an 𝒜\mathcal{A}-perfect stable matching.

Proof.

If the algorithm returns the matching MIM_{I} then it is an 𝒜\mathcal{A}-perfect stable matching. We show that the matching MM returned at line 12 is 𝒜\mathcal{A}-perfect and stable.

It is clear that MLM_{L} is 𝒜\mathcal{A}-perfect, by construction (line 6). Thus, we start with matching MM that is 𝒜\mathcal{A}-perfect. During the execution of the loop at line 8, agents are only promoted and no agent becomes unmatched. Thus, MM remains 𝒜\mathcal{A}-perfect at the termination.

Next, we show that MM is stable. Suppose for contradiction that there exists a blocking pair (a,p)(a,p) with respect to MM. Then paM(a)p\succ_{a}M(a) and there exists an aM(p)a^{\prime}\in M(p) such that apaa\succ_{p}a^{\prime}. Consider the iteration of the for loop (in line 8) when pp was considered. Agent aa^{\prime} was either already matched to pp (before the iteration began) or is assigned to pp in this iteration. Note that apaa\succ_{p}a^{\prime} and agents are considered in the reverse order of preference of pp. Thus, in either case, when aa was considered in line 9, M(a)=pM(a^{\prime})=p holds.

If M(a)apM(a)\succ_{a}p or M(a)=pM(a)=p at this point, since agents never get demoted in the algorithm, M(a)apM(a)\succ_{a}p or M(a)=pM(a)=p holds at the end of the algorithm. Thus, we must have that M(a)apM(a)\prec_{a}p at this point. This implies that the algorithm matched aa to pp in this iteration. Since aa could only get promoted during the subsequent iterations, M(a)=pM(a)=p or M(a)apM(a)\succ_{a}p at the end of the algorithm. This contradicts the claimed blocking pair. This proves the lemma. ∎

Next, we show that MM is an p\ell_{p}-approximation of MinSum. Let PemptyP_{\text{empty}} denote the set of programs pp such that no agent is matched to pp in the matching MIM_{I} and PLCP_{\text{LC}} denote the set of programs pp such that for at least one agent u𝒜uu\in\mathcal{A}_{u}, pu=pp^{*}_{u}=p. Let ScS^{c} denote the complement of SS with respect to 𝒫\mathcal{P}. We define the following four sets of programs. Clearly, these four sets are pairwise disjoint (see Fig. 3).

  • P1=PemptycPLCcP_{1}=P_{\text{empty}}^{c}\cap P_{\text{LC}}^{c}

  • P2=PemptycPLCP_{2}=P_{\text{empty}}^{c}\cap P_{\text{LC}}

  • P3=PemptyPLCP_{3}=P_{\text{empty}}\cap P_{\text{LC}}

  • P4=PemptyPLCcP_{4}=P_{\text{empty}}\cap P_{\text{LC}}^{c}

a1a_{1}a2a_{2}a3a_{3}a4a_{4}a5a_{5}𝒜𝒜u\mathcal{A}\setminus\mathcal{A}_{u}𝒜u\mathcal{A}_{u}𝒫\mathcal{P}𝒜\mathcal{A}P2P_{2}P1P_{1}P4P_{4}P3P_{3}PemptycP_{\text{empty}}^{c}PemptyP_{\text{empty}}PLCP_{\text{LC}}PLCcP_{\text{LC}}^{c}
Figure 3: A schematic depicting the various types of programs. Blue edges denote edges in initial matching MIM_{I} while red edges indicate the edges between an agent and its least-cost program. The graph contains edges from the matching MLM_{L}.

Now we proceed to prove the approximation guarantee by observing important properties of the programs in these sets.

Lemma 8.

No agent is promoted and matched to any program in P1P4P_{1}\cup P_{4} during the execution of the for loop in line 8.

Proof.

Let pP1P4p\in P_{1}\cup P_{4}. By definition of P1P_{1} and P4P_{4}, pPLCcp\in P_{\text{LC}}^{c}. This implies that for no agent aAua\in A_{u}, p=pap=p_{a}^{*}. Therefore, after the execution of line 6, (a,p)ML(a,p)\in M_{L} if and only if (a,p)MI(a,p)\in M_{I}. Subsequently, at line 7, we have (a,p)M(a,p)\in M if and only if (a,p)MI(a,p)\in M_{I}.

For the sake of contradiction, assume that some agent is promoted and matched to pp. Let aa be the first such agent. For this promotion to happen, there must exist agent aM(p)a^{\prime}\in M(p) such that apaa\succ_{p}a^{\prime} and paM(a)p\succ_{a}M(a) in this iteration. By the choice of aa, we have (a,p)MI(a^{\prime},p)\in M_{I}. Note that M(a)=MI(a)M(a)=M_{I}(a) or M(a)aMI(a)M(a)\succ_{a}M_{I}(a) since agents can only get promoted during the execution of the loop. By stability of MIM_{I}, we have that either aAua\in A_{u} and apaa^{\prime}\succ_{p}a or MI(a)apM_{I}(a)\succ_{a}p. The former case contradicts that apaa\succ_{p}a^{\prime} whereas the latter case contradicts that M(a)=MI(a)M(a)=M_{I}(a) or M(a)aMI(a)M(a)\succ_{a}M_{I}(a). This proves the lemma. ∎

Lemma 9.

Matching MM computed by Algorithm 2 is an p\ell_{p}-approximation of the MinSum problem.

Proof.

Let c(M)c(M) denote the total augmentation cost of the matching MM. During the execution of the for loop in line 8, the cost is spent only when an agent is promoted and matched to some program pp. By Lemma 8, agents are promoted and matched to some program pp such that pP2P3p\in P_{2}\cup P_{3}.

Let len(p)len(p) denote the length of the preference list of program pp. During the execution of the for loop in line 8, at most len(p)len(p) many agents can be promoted and matched to the program pP2P3p\in P_{2}\cup P_{3}. Then c(M)pP2P3len(p)c(p)c(M)\leq\sum_{p\in P_{2}\cup P_{3}}len(p)\cdot c(p).

Programs in P2P3P_{2}\cup P_{3} are least-cost programs for some agent aAua\in A_{u}. Let 𝖮𝖯𝖳{\sf OPT} denote an optimal solution and c(𝖮𝖯𝖳)c({\sf OPT}) denote the optimal cost. Since 𝖮𝖯𝖳{\sf OPT} must match all agents in AuA_{u}, c(𝖮𝖯𝖳)aAuc(pa)pP2P3c(p)c({\sf OPT})\geq\sum_{a\in A_{u}}c(p_{a}^{*})\geq\sum_{p\in P2\cup P3}c(p). Moreover, for every pp, we have len(p)plen(p)\leq\ell_{p}. Thus,

c(M)pP2P3len(p)c(p)ppP2P3c(p)pc(𝖮𝖯𝖳)c(M)\leq\sum_{p\in P_{2}\cup P_{3}}len(p)\cdot c(p)\leq\ell_{p}\sum_{p\in P_{2}\cup P_{3}}c(p)\leq\ell_{p}\cdot c({\sf OPT})

Matchings MIM_{I} and MLM_{L} can be computed in O(m)O(m) time using the Gale-Shapley algorithm. The for loop in line 8 takes O(mp)O(m\ell_{p}) time. Thus, algorithm 2 runs in O(mp)O(m\ell_{p}) time. This proves Theorem 1.5.

4 MinSumC with two distinct costs

In this section, we present a linear program (LP) for the MinSumC problem followed by an approximation algorithm for a restricted hard case. Recall that under the MinSumC setting, an envy-free matching is itself stable. Therefore, in this section, we compute an envy-free matching.

4.1 Linear Program and its dual

Fig. 4 shows the LP relaxation for the MinSumC problem. Let H=(𝒜𝒫,E)H=(\mathcal{A}\cup\mathcal{P},E) be the underlying graph of the MinSumC instance. Let xa,px_{a,p} be a primal variable for the edge (a,p)E(a,p)\in E: xa,px_{a,p} is 11 if aa is matched to pp, 0 otherwise. The objective of the primal LP (Eq. 1) is to minimize the total cost of all matched edges. Eq. 2 encodes the envy-freeness constraint: if agent aa is matched to pp then every agent apaa^{\prime}\succ_{p}a must be matched to either pp or a higher-preferred program than pp, otherwise aa^{\prime} envies aa. In the primal LP, the envy-freeness constraint is present for a triplet (a,p,a)(a^{\prime},p,a) where apaa^{\prime}\succ_{p}a. We call such a triplet a valid triplet. Eq. 3 encodes 𝒜\mathcal{A}-perfectness constraint.

Primal: minimize

p𝒫c(p)(a,p)Exa,p\sum\limits_{p\in\mathcal{P}}{c(p)\cdot\sum\limits_{(a,p)\in E}{x_{a,p}}} (1)

subject to

p:p=porpapxa,pxa,p,(a,p)E,apa\sum_{\begin{subarray}{c}p^{\prime}:\\ p^{\prime}=p\ \text{or}\\ p^{\prime}\succ_{a^{\prime}}p\end{subarray}}{x_{a^{\prime},p^{\prime}}}\geq x_{a,p},\ \operatorname{\forall}(a^{\prime},p)\in E,a\prec_{p}a^{\prime} (2)
(a,p)Exa,p=1,a𝒜\sum\limits_{(a,p)\in E}{x_{a,p}}=1,\ \ \ \operatorname{\forall}a\in\mathcal{A} (3)
xa,p0,(a,p)Ex_{a,p}\geq 0,\ \ \ \operatorname{\forall}(a,p)\in E (4)

Dual: maximize

a𝒜ya\sum\limits_{a\in\mathcal{A}}{y_{a}} (5)

subject to

ya+p:p=porpapa:apaza,p,aa:apaza,p,ac(p),(a,p)Ey_{a}+\sum_{\begin{subarray}{c}p^{\prime}:\\ p^{\prime}=p\ \text{or}\\ p^{\prime}\prec_{a}p\end{subarray}}\ \ {\sum\limits_{\begin{subarray}{c}a^{\prime}:\\ a^{\prime}\prec_{p^{\prime}}a\end{subarray}}{z_{a,p^{\prime},a^{\prime}}}}-\sum\limits_{\begin{subarray}{c}a^{\prime}:\\ a\prec_{p}a^{\prime}\end{subarray}}{z_{a^{\prime},p,a}}\\ \leq c(p),\ \ \ \ \operatorname{\forall}(a,p)\in E (6)
za,p,a0,(a,p)E,apaz_{a^{\prime},p,a}\geq 0,\ \ \ \operatorname{\forall}(a^{\prime},p)\in E,a\prec_{p}a^{\prime} (7)
Figure 4: Linear Program and its dual for the MinSumC problem
Refer to caption
Figure 5: Let (a,p,a)(a^{\prime},p,a) be a valid triplet and papp^{\prime}\succ_{a^{\prime}}p. The edges shown in the figure are those whose dual constraint contains the variable za,p,az_{a^{\prime},p,a} in either positive or negative form.

In the dual LP, we have two kinds of variables, the yy variables which correspond to every agent and the zz variables which correspond to every valid triplet in the primal program. The dual constraint (Eq. 6) is for every edge (a,p)(a,p) in EE. The yay_{a} variable corresponding to an agent aa appears in the dual constraint corresponding to every edge incident on aa. The value yay_{a} can be interpreted as the cost paid by agent aa for matching aa to one of the programs in 𝒩(a)\mathcal{N}(a). For an edge (a,p)(a,p) and an agent apaa^{\prime}\succ_{p}a, the dual variable za,p,az_{a^{\prime},p,a} appears in negative form in exactly one constraint and it is for the edge (a,p)(a,p). The same dual variable za,p,az_{a^{\prime},p,a} appears in positive form in the constraint for every edge (a,p)(a^{\prime},p^{\prime}) such that p=pp^{\prime}=p or papp^{\prime}\succ_{a^{\prime}}p (refer Fig. 5). The value of za,p,az_{a^{\prime},p,a} can be interpreted as the cost paid by agent aa in matching aa^{\prime} to a program pp^{\prime} such that p=pp^{\prime}=p or papp^{\prime}\succ_{a^{\prime}}p to resolve potential envy-pair (a,a)(a^{\prime},a) if aa gets matched to pp. Following are the useful facts about the linear program and its dual.

Fact 1. Let aa be a fixed agent. If yay_{a} is incremented by a positive value Δ\Delta then it increments the left-hand side (lhs) of the dual constraint of every edge (a,p)(a,p) by Δ\Delta and it does not affect the dual constraint of any edge incident on agent aaa^{\prime}\neq a.∎

Fact 2. Let (a,p,a)(a^{\prime},p,a) be a fixed valid triplet. If za,p,az_{a^{\prime},p,a} is incremented by a positive value Δ\Delta then it increments the lhs of the dual constraint of every edge (a,p)(a^{\prime},p^{\prime}) by Δ\Delta such that p=pp^{\prime}=p or papp^{\prime}\succ_{a^{\prime}}p, reduces the lhs of the dual constraint of exactly one edge (a,p)(a,p) by Δ\Delta and does not affect the dual constraint of any edge incident on agent a′′{a,a}a^{\prime\prime}\notin\{a,a^{\prime}\}.∎

For a given dual setting and an edge, if Eq. 6 is satisfied with equality then we call such an edge as a tight edge, otherwise it is a slack edge. For an edge (a,p)(a,p), slack(a,p)slack(a,p) denotes its slack. When referring to a zz variable, when a specific agent or program occurring in it does not matter, we use ×\times in its place.

Definition 3 (Threshold agent).

Let MM be a matching in the instance. For every program pp, thresh(p)thresh(p) is the most-preferred agent aa, if it exists, such that paM(a)p\succ_{a}M(a), otherwise thresh(p)thresh(p) is \bot.

The definition of threshold agent is similar to the threshold resident defined in [14] and a barrier (vertex) defined in [9]. We remark that the threshold agent depends on the matching MM, hence when MM gets modified, the threshold agents for programs may change.

Definition 4 (Matchable edge).

For an envy-free matching MM, and an agent aa (matched or unmatched), we say that an edge (a,p)M(a,p)\notin M is matchable if the dual constraint on (a,p)(a,p) is tight and a=thresh(p)a=thresh(p), otherwise the edge is non-matchable.

It is straightforward to verify that for an envy-free matching MM, if we match agent aa along a matchable edge then the resultant matching remains envy-free.

4.2 An a\ell_{a}-approximation algorithm for MinSumC𝖼𝟣,𝖼𝟤{\sf\textsc{MinSumC}_{c1,c2}}

A reader may find the discussion in the Appendix about the challenges involved in designing a primal-dual algorithm for the general case of the MinSumC problem. In this section, we show that when the MinSumC instance has only two distinct costs c1c_{1} and c2c_{2} where c1<c2c_{1}<c_{2}, we can circumvent the challenges and obtain an a\ell_{a}-approximation algorithm for the MinSumC problem. We recall from Theorem 1.2 that even in this restricted setting, the problem remains NP-hard.

High-level idea of the algorithm. Our LP based algorithm begins with an initial feasible dual setting and an envy-free matching MM which need not be 𝒜\mathcal{A}-perfect. As long as MM is not 𝒜\mathcal{A}-perfect, we pick an unmatched agent aa and increase the dual variable yay_{a}. We show that for an unmatched agent such an increase is possible and all edges incident on aa become tight due to the update. However, none of the edges incident on aa may be matchable (since for every p𝒩(a)p\in\mathcal{N}(a), thresh(p)athresh(p)\neq a). Under the restricted setting of two distinct costs we ensure that after a bounded number of updates to the zz variables, at least one edge incident on aa is matchable. Throughout we maintain the following invariants with respect to the matching MM.

  • MM is envy-free, not necessarily 𝒜\mathcal{A}-perfect and every matched edge is tight.

  • For an agent aa (matched or unmatched), for every paM(a)p\succ_{a}M(a), either (i) (a,p)(a,p) is tight and thresh(p)athresh(p)\neq a or (ii) slack(a,p)=c2c1slack(a,p)=c_{2}-c_{1}.

Recall that when the matching is modified, thresholds may change, due to which a tight, non-matchable edge may become matchable. As long as there exists such an edge, we match it. This is achieved by the free-promotions routine. The free-promotions routine checks if there exists a matchable edge (a,p)(a,p). If there is no such edge, the routine terminates. Otherwise, it matches (a,p)(a,p), re-computes the threshold agents and repeats the search. Checking for a matchable edge and computing threshold agents takes O(m)O(m) time where m=|E|m=|E|. the free-promotions routine runs in O(m2)O(m^{2}) time.

Description of the algorithm. Algorithm 3 gives the pseudo-code. In the Appendix, we give an illustrative example which depicts the key steps of the algorithm on a MinSumC𝖼𝟣,𝖼𝟤{\sf\textsc{MinSumC}_{c1,c2}} instance.

We begin with an empty matching MM and by setting all yy variables to c1c_{1} and all zz variables to 0 (line 1). Following this, for every agent aa with a cost c1c_{1} program in 𝒩(a)\mathcal{N}(a) we match the agent to its most-preferred program with cost c1c_{1} (for loop at line 2). Next, we compute the threshold agent for every program w.r.t. MM. As long as MM is not 𝒜\mathcal{A}-perfect, we pick an arbitrary unmatched agent aa and update the dual variables as follows.

1:let M=M=\emptyset, all yy variables are set to c1c_{1} and all zz variables are set to 0
2:for every agent a𝒜a\in\mathcal{A} s.t. p𝒩(a)\exists p\in\mathcal{N}(a) such that c(p)=c1c(p)=c_{1} do
3:     let pp be the most-preferred program in 𝒩(a)\mathcal{N}(a) s.t. c(p)=c1c(p)=c_{1} and let M=M{(a,p)}M=M\cup\{(a,p)\}
4:compute thresh(p)thresh(p) for every program p𝒫p\in\mathcal{P}
5:while MM is not 𝒜\mathcal{A}-perfect do
6:     let aa be an unmatched agent
7:     while aa is unmatched do
8:         set ya=ya+c2c1y_{a}=y_{a}+c_{2}-c_{1}
9:         if there exists a matchable edge incident on aa then
10:              M=M{(a,p)(a,p)M=M\cup\{(a,p)\mid(a,p) is the most-preferred matchable edge for a}a\}
11:              perform free-promotions routine and re-compute thresholds
12:         else
13:              𝒫(a)={p𝒩(a)paM(a),(a,p)\mathcal{P}(a)=\{p\in\mathcal{N}(a)\mid p\succ_{a}M(a),(a,p) is tight and thresh(p)a}thresh(p)\neq a\}
14:              while 𝒫(a)\mathcal{P}(a)\neq\emptyset do
15:                  let aa^{\prime} be the threshold agent of some program in 𝒫(a)\mathcal{P}(a)
16:                  let 𝒫(a,a)\mathcal{P}(a,a^{\prime}) denote the set of programs in 𝒫(a)\mathcal{P}(a) whose threshold agent is aa^{\prime}
17:                  let pp be the least-preferred program for aa^{\prime} in 𝒫(a,a)\mathcal{P}(a,a^{\prime})
18:                  set za,p,a=c2c1z_{a^{\prime},p,a}=c_{2}-c_{1}
19:                  let (a,p)(a^{\prime},p^{\prime}) be the most-preferred matchable edge incident on aa^{\prime}. Unmatch aa^{\prime} if matched and let M=M{(a,p)}M=M\cup\{(a^{\prime},p^{\prime})\}
20:                  execute free-promotions routine, re-compute thresholds and the set 𝒫(a)\mathcal{P}(a)                             
21:return MM
Algorithm 3 Algorithm to compute an a\ell_{a}-approximation of MinSumC on MinSumC𝖼𝟣,𝖼𝟤{\sf\textsc{MinSumC}_{c1,c2}}
  1. 1.

    For the agent aa, we increase yay_{a} by c2c1c_{2}-c_{1}. We ensure that the dual setting is feasible and all edges incident on aa become tight for the dual constraint in Eq. 6. Although this step makes all edges incident on aa tight, they may not be necessarily matchable. Recall that a tight edge (a,p)(a,p) is matchable if thresh(p)=athresh(p)=a.

  2. 2.

    If there is a program pp such that (a,p)(a,p) is matchable, then aa is immediately matched to the most-preferred such program pp (line 10) and we are done with matching agent aa. Since the matching is modified, we execute the free-promotions routine.

  3. 3.

    In case there is no such program for which aa is the threshold agent, we update carefully selected zz variables in order to either promote the threshold agent (if matched) or match the (unmatched) threshold agent via the following steps.

    1. (a)

      We compute the set 𝒫(a)\mathcal{P}(a) of programs p𝒩(a)p\in\mathcal{N}(a) such that the dual constraint on edge (a,p)(a,p) is tight and thresh(p)athresh(p)\neq a and paM(a)p\succ_{a}M(a) (line 13). In other words, 𝒫(a)\mathcal{P}(a) is the set of programs in the neighbourhood of aa such that pp is higher-preferred over M(a)M(a) and edge (a,p)(a,p) is tight but not matchable.

    2. (b)

      By the definition of 𝒫(a)\mathcal{P}(a), for every pj𝒫(a)p_{j}\in\mathcal{P}(a), there exists thresh(pj)=aathresh(p_{j})=a^{\prime}\neq a. We pick an arbitrary agent aa^{\prime} that is a threshold of some program in 𝒫(a)\mathcal{P}(a) (line 15). Note that the agent aa^{\prime} can be the threshold agent of more than one program in 𝒫(a)\mathcal{P}(a), and we let 𝒫(a,a)\mathcal{P}(a,a^{\prime}) denote the set of programs in 𝒫(a)\mathcal{P}(a) for whom aa^{\prime} is the threshold. Let pp be the least-preferred program for aa^{\prime} in 𝒫(a,a)\mathcal{P}(a,a^{\prime}) (line 17).

    3. (c)

      Our goal is to match aa^{\prime} to a program pp^{\prime} such that p=pp^{\prime}=p or papp^{\prime}\succ_{a^{\prime}}p. By the choice of a,aa,a^{\prime} and pp and from the primal LP, (a,p,a)(a^{\prime},p,a) is a valid triplet and therefore there exists a dual variable za,p,az_{a^{\prime},p,a} (refer Fig. 5). We set za,p,az_{a^{\prime},p,a} to c2c1c_{2}-c_{1} (line 18). We ensure that this update maintains dual feasibility.

    4. (d)

      Recall that the variable za,p,az_{a^{\prime},p,a} appears in the positive form in the dual constraint of every edge (a,p)(a^{\prime},p^{\prime}) such that p=pp^{\prime}=p or papp^{\prime}\succ_{a^{\prime}}p. We ensure that this update results in making all edges (a,p)(a^{\prime},p^{\prime}) tight and at least one of these becomes matchable. We match aa^{\prime} along the most-preferred matchable edge (line 19). Recall that za,p,az_{a^{\prime},p,a} variable appears in negative form in the dual constraint of edge (a,p)(a,p), hence edge (a,p)(a,p) becomes slack after this update.

    5. (e)

      Since MM is modified, we execute the free-promotions routine. If a tight edge incident on aa becomes matchable, then aa is matched inside the free-promotions routine.

    6. (f)

      We remark that the set 𝒫(a)\mathcal{P}(a) computed in line 13 is dependent on the matching MM, specifically M(a)M(a) and the threshold agents w.r.t. MM. In order to maintain a specific slack value on the edges that is useful in maintaining dual feasibility and ensuring progress, we re-compute the set 𝒫(a)\mathcal{P}(a) (line 20) and re-enter the loop in line 14 if 𝒫(a)\mathcal{P}(a)\neq\emptyset.

4.3 Proof of correctness

We start by observing the following properties.

(P1) At line 4, no agent is assigned to any program with cost c2c_{2} and for every agent aa (matched or unmatched), every program paM(a)p\succ_{a}M(a) has cost c2c_{2}.

(P2) A matched agent never gets demoted.

(P3) A tight edge incident on a matched agent remains tight.

(P4) All matched edges are tight at the end of the algorithm.

(P1) is a simple observation about the matching at line 4. Whenever a matched agent aa changes its partner from M(a)M(a) to pp^{\prime}, we have thresh(p)=athresh(p^{\prime})=a. By the definition of the threshold agent, paM(a)p^{\prime}\succ_{a}M(a), which implies (P2). Note that the only edge that can become slack during the execution is the edge (a,p)(a,p) which is incident on an unmatched agent aa (line 18). This implies (P3). We observe that when the edge is matched, it is tight. By (P3), a matched edge (being incident on a matched agent) always remains tight, implying (P4).

Now, we proceed to prove Theorem 1.6. In the following lemma, we prove that the matching MM computed by the algorithm is envy-free.

Lemma 10.

Matching MM is envy-free throughout the execution of the algorithm.

Proof.

Matching MM is trivially envy-free after line 1. Any two agents aa and aa^{\prime} that are matched in line 3 are matched to a program with cost c1c_{1} and by the choice made in line 3, it is clear that they do not form an envy-pair. By (P1), every unmatched agent aa has only cost c2c_{2} programs in 𝒩(a)\mathcal{N}(a) thus, no unmatched agent envies an agent matched in line 3. Thus, MM is envy-free before entering the loop at line 5.

Suppose MM is envy-free before a modification in MM inside the loop. We show that it remains envy-free after the modification. Matching MM is modified either at line 10 or line 19 or inside the free-promotions routine. In all these places, only a matchable edge (ai,pj)(a_{i},p_{j}) is matched. Therefore no agent aaia^{\prime}\neq a_{i} envies aia_{i} after this modification. Before this modification aia_{i} did not envy aaia^{\prime}\neq a_{i} and by (P2) aia_{i} (if matched) is not demoted, therefore aia_{i} does not envy aaia^{\prime}\neq a_{i} after the modification. Thus, MM remains envy-free. ∎

Next, we proceed to prove the dual feasibility, termination, and 𝒜\mathcal{A}-perfectness. We make the following observation about the innermost while loop (line 14).

Lemma 11.

Let aa be a fixed unmatched agent selected in line 6 and consider an iteration of the loop at line 7 during which the algorithm enters else part. Suppose during an iteration of the loop at line 14, for some pk𝒩(a)p_{k}\in\mathcal{N}(a), p=pkp=p_{k} is selected at line 17. Then at the end of iteration, slack(a,pk)=c2c1slack(a,p_{k})=c_{2}-c_{1} and ppkp\neq p_{k} during subsequent iterations of the loop. Therefore, at most a\ell_{a} many distinct z×,pk,az_{\times,p_{k},a} variables are updated during the iteration of the loop at line 7.

Proof.

By the choice of pkp_{k}, the edge (a,pk)(a,p_{k}) was tight before this iteration. By Fact 2, the update on z×,pk,az_{\times,p_{k},a} reduces the lhs of the dual constraint of the edge (a,pk)(a,p_{k}) by c2c1c_{2}-c_{1}. Thus, after this update, slack(a,pk)=c2c1slack(a,p_{k})=c_{2}-c_{1}. Therefore, when 𝒫(a)\mathcal{P}(a) is re-computed at line 20, pk𝒫(a)p_{k}\notin\mathcal{P}(a). Also observe that no other dual update in z×,pj,az_{\times,p_{j},a} inside the loop at line 14 for pjpkp_{j}\neq p_{k} affects the slack of edge (a,pk)(a,p_{k}). Thus, in a subsequent iteration of this loop, pkp_{k} is never selected as pp again.

For every pkp_{k} selected as pp in line 17, a distinct z×,pk,az_{\times,p_{k},a} variable is updated. Thus, there are at most 𝒫(a)\mid\mathcal{P}(a)\mid many distinct z×,pk,az_{\times,p_{k},a} variables are updated inside the loop at line 14 in an iteration of the loop at line 7. By observing that 𝒫(a)𝒩(a)\mathcal{P}(a)\subseteq\mathcal{N}(a), we get 𝒫(a)a\mid\mathcal{P}(a)\mid\leq\ell_{a}, hence the claim follows. ∎

Recall that if edge (a^,p^)(\hat{a},\hat{p}) is non-matchable then either (a^,p^)(\hat{a},\hat{p}) is slack or thresh(p^)a^thresh(\hat{p})\neq\hat{a}. In our algorithm, we maintain a stronger invariant: for every agent aa and for every program pp higher-preferred over M(a)M(a), we maintain that either all non-matchable edges (a,p)(a,p) are slack or all non-matchable edges (a,p)(a,p) are tight and for every such edge, thresh(p)athresh(p)\neq a. Moreover, we also maintain a specific slack value when the edges are slack. We categorize agents based on these two cases (see Fig. 6 and Fig. 7).

Definition 5 (type-1 and type-2 agents).

An agent aa is called a type-1 agent if for every program paM(a)p\succ_{a}M(a), slack(a,p)=c2c1slack(a,p)=c_{2}-c_{1}. An agent aa is called a type-2 agent if aa is matched and for every program paM(a)p\succ_{a}M(a), slack(a,p)=0slack(a,p)=0 and thresh(p)athresh(p)\neq a.

Refer to caption
Figure 6: Type-1 agent a^\hat{a}: slack(a^,pj)=c2c1slack(\hat{a},p_{j})=c_{2}-c_{1}, pja^p=M(a^)\operatorname{\forall}p_{j}\succ_{\hat{a}}p=M(\hat{a}), if a^\hat{a} is matched, otherwise, pj𝒩(a^)\operatorname{\forall}p_{j}\in\mathcal{N}(\hat{a})
Refer to caption
Figure 7: Type-2 agent a^\hat{a}: slack(a^,pj)=0slack(\hat{a},p_{j})=0 pja^p=M(a^)\operatorname{\forall}p_{j}\succ_{\hat{a}}p=M(\hat{a})

We remark that type-1 agents could be either matched or unmatched but type-2 agents are always matched. Recall that if a=aja^{\prime}=a_{j} is unmatched then M(aj)=M(a_{j})=\bot and therefore, every program pj𝒩(aj)p_{j}\in\mathcal{N}(a_{j}) satisfies the condition that pjajM(aj)=p_{j}\succ_{a_{j}}M(a_{j})=\bot. We claim that a type-1 agent is selected as aa^{\prime} at most once inside the loop at line 14.

Lemma 12.

Let aja_{j} be a type-1 agent such that a=aja^{\prime}=a_{j} is selected in an arbitrary iteration of the loop at line 14. Then, at the termination of the loop, aja_{j} is a type-2 agent and in subsequent iterations of the loop, aaja^{\prime}\neq a_{j}.

Proof.

Since aja_{j} is a type-1 agent, for every program pja^M(a^)p_{j}\succ_{\hat{a}}M(\hat{a}), slack(aj,pj)=c2c1slack(a_{j},p_{j})=c_{2}-c_{1}. Suppose p=pkp=p_{k} is selected in line 17. Then by Fact 2, for every ptp_{t} such that pt=pkp_{t}=p_{k} or ptajpkp_{t}\succ_{a_{j}}p_{k}, the dual update in line 18 results in making all (aj,pt)(a_{j},p_{t}) edges tight. Also, since thresh(pk)=ajthresh(p_{k})=a_{j}, at least one of these newly tight edges (specifically, (aj,pk)(a_{j},p_{k})) becomes matchable. Therefore, M(aj)M(a_{j}) is modified inside the iteration (line 19), implying that aja_{j} is either matched or promoted. The choice of M(aj)M(a_{j}), that is, pp^{\prime} in line 19 is such that for every pjajM(aj)=pp_{j}\succ_{a_{j}}M(a_{j})=p^{\prime}, the edge (aj,pj)(a_{j},p_{j}) is tight and thresh(pj)ajthresh(p_{j})\neq a_{j}. Thus, when the iteration ends, aja_{j} is a type-2 agent.

By (P3), the tight edges incident on aja_{j} remain tight throughout the algorithm. In subsequent iterations, agent aja_{j} may further get promoted by the free-promotions routine such that for every pjajM(aj)p_{j}\succ_{a_{j}}M(a_{j}), slack(aj,pj)=0slack(a_{j},p_{j})=0 and thresh(pj)ajthresh(p_{j})\neq a_{j}. Therefore, aja_{j} remains a type-2 agent in all subsequent iterations of the loop. This implies that aja_{j} is not the threshold for any program pjajM(aj)p_{j}\succ_{a_{j}}M(a_{j}), in particular for any program pj𝒩(a)p_{j}\in\mathcal{N}(a) for the chosen aa. Thus, during subsequent iterations of the loop, aaja^{\prime}\neq a_{j}. ∎

In Lemma 13, we establish that at a specific step during the algorithm, every agent is either type-1 or type-2. This property is crucial in showing dual feasibility and termination.

Lemma 13.

Before every iteration of the loop starting at line 7, an agent a^\hat{a} is either a type-1 agent or a type-2 agent.

Proof.

We prove this by induction. Before the first iteration of the loop at line 7, suppose agent a^\hat{a} is matched. Then (P1) and the initial dual setting together imply that for every program pja^M(a^)p_{j}\succ_{\hat{a}}M(\hat{a}), slack(a^,pj)=c2c1slack(\hat{a},p_{j})=c_{2}-c_{1}. Therefore a^\hat{a} is a matched type-1 agent. Suppose a^\hat{a} is unmatched. Then, by (P1), every program pj𝒩(a^)p_{j}\in\mathcal{N}(\hat{a}), c(pj)=c2c(p_{j})=c_{2}, therefore the initial dual setting implies that slack(a^,pj)=c2c1slack(\hat{a},p_{j})=c_{2}-c_{1}. This implies that a^\hat{a} is an unmatched type-1 agent.

Consider an arbitrary agent a^\hat{a}. Suppose that a^\hat{a} is either type-1 or type-2 before ll-th iteration of the loop. It is clear that aa selected in line 6 is different than aa^{\prime} selected at line 15. During the ll-th iteration, either a=a^a=\hat{a} in line 6 or a=a^a^{\prime}=\hat{a} in line 15 or a^\hat{a} is promoted inside the free-promotions routine. We show that in each of the cases, a^\hat{a} is either type-1 or type-2 before (l+1)(l+1)-th iteration begins.

  1. (i)

    a=a^a=\hat{a} in line 6: It implies that a^\hat{a} is unmatched. By induction hypothesis, a^\hat{a} is a type-1 agent, therefore for every pj𝒩(a^)p_{j}\in\mathcal{N}(\hat{a}), slack(a^,pj)=c2c1slack(\hat{a},p_{j})=c_{2}-c_{1}. Then, the update in line 8 results in making all edges incident on a^\hat{a} tight. We consider the following two cases – a^\hat{a} remains unmatched during the ll-th iteration or a^\hat{a} gets matched.

    • a^\hat{a} remains unmatched during the ll-th iteration: Then the while loop at line 14 must have been executed. During an iteration of the loop at line 14, if p=pjp=p_{j} then the slack of the edge (a^,pj)(\hat{a},p_{j}) becomes c2c1c_{2}-c_{1} after the dual update in line 18 (by Fact 2). We show that for every pj𝒩(a^)p_{j}\in\mathcal{N}(\hat{a}), there is some iteration of the loop at line 14 such that p=pjp=p_{j} is selected, thereby implying that when the loop terminates, for every edge (a^,pj)(\hat{a},p_{j}), slack becomes c2c1c_{2}-c_{1}. Once this is shown, it is clear that before the (l+1)(l+1)-th iteration, a^\hat{a} is a type-1 agent.

      Suppose for contradiction that for some program pjp_{j}, p=pjp=p_{j} is never selected. Since the edge (a^,pj)(\hat{a},p_{j}) is tight before the loop execution began, it must be the case that either pja^M(a^)p_{j}\prec_{\hat{a}}M(\hat{a}) or thresh(pj)=a^thresh(p_{j})=\hat{a}. The first case implies that M(a^)M(\hat{a})\neq\bot, a contradiction that a^\hat{a} remains unmatched during the ll-th iteration. In the second case, since thresh(pj)=a^thresh(p_{j})=\hat{a}, the edge (a^,pj)(\hat{a},p_{j}) was matchable inside the free-promotions routine, thus a^\hat{a} must have been matched inside the free-promotions routine, leading to a contradiction again. Thus, for every pj𝒩(a^)p_{j}\in\mathcal{N}(\hat{a}), there is some iteration of the loop during which p=pjp=p_{j}. This implies that when the loop at line 14 terminates, for every pj𝒩(a^)p_{j}\in\mathcal{N}(\hat{a}), slack(a^,pj)=c2c1slack(\hat{a},p_{j})=c_{2}-c_{1}.

    • a^\hat{a} gets matched during the ll-th iteration: Recall that all edges incident on a^\hat{a} are tight after the dual update in line 8. If a^\hat{a} is matched at line 10 then the ll-th iteration immediately terminates. Thus, before the (l+1)(l+1)-th iteration, for every pja^M(a^)p_{j}\succ_{\hat{a}}M(\hat{a}), slack(a^,pj)=0slack(\hat{a},p_{j})=0 and by the choice made in line 10, thresh(pj)a^thresh(p_{j})\neq\hat{a}, implying that a^\hat{a} is a type-2 agent.

      If a^\hat{a} is matched inside the loop at line 14 then the free-promotions routine must have matched it. Consider the last iteration of the loop at line 14 during which the free-promotions routine matched or promoted a^\hat{a} and let M(a^)=ptM(\hat{a})=p_{t}. We will show that for pja^ptp_{j}\succ_{\hat{a}}p_{t}, slack(aj,pj)=c2c1slack(a_{j},p_{j})=c_{2}-c_{1}, thereby implying that a^\hat{a} is a matched type-1 agent before (l+1)(l+1)-th iteration begins.

      By Lemma 11, it is enough to show that for every pja^ptp_{j}\succ_{\hat{a}}p_{t}, p=pjp=p_{j} is chosen is some iteration of the loop at line 14. Suppose not. Then, there exists some pjp_{j} such that (a^,pj)(\hat{a},p_{j}) is tight after the loop at line 14 terminates. By the choice of ptp_{t} inside the free-promotions routine, (a^,pj)(\hat{a},p_{j}) was non-matchable, implying that thresh(pj)a^thresh(p_{j})\neq\hat{a}. Hence during the last iteration of the loop, when 𝒫(a^)\mathcal{P}(\hat{a}) was re-computed in line 20, pj𝒫(a^)p_{j}\in\mathcal{P}(\hat{a}), that is, 𝒫(a^)\mathcal{P}(\hat{a})\neq\emptyset. This contradicts that the loop terminated after this iteration. Therefore, for every pja^ptp_{j}\succ_{\hat{a}}p_{t}, pjp_{j} was selected in some iteration of the loop at line 14, thereby implying that before the (l+1)(l+1)-th iteration of the loop at line 7, a^\hat{a} is a matched type-1 agent.

  2. (ii)

    a=a^a^{\prime}=\hat{a} at line 15: Consider the first iteration of the loop at line 14 when this happens. Note that the dual update in line 8 does not affect the slack on edges incident on a^\hat{a}. Since a^\hat{a} is a threshold for some program pja^M(a^)p_{j}\succ_{\hat{a}}M(\hat{a}), by the induction hypothesis, a^\hat{a} is a type-1 agent. Therefore, for every pja^M(a^)p_{j}\succ_{\hat{a}}M(\hat{a}), slack(a^,pj)=c2c1slack(\hat{a},p_{j})=c_{2}-c_{1} before this iteration of the loop at line 14. By Lemma 12, a^\hat{a} is a type-2 agent when the loop terminates. Therefore when (l+1)(l+1)-th iteration of the loop at line 7 begins, a^\hat{a} is a type-2 agent.

  3. (iii)

    aa^a\neq\hat{a} and aa^a^{\prime}\neq\hat{a} but a^\hat{a} is promoted inside the free-promotions routine: First note that none of the dual updates in the ll-th iteration affect any edge incident on a^\hat{a}. Thus, if a^\hat{a} is promoted inside the free-promotions routine, then by the induction hypothesis, a^\hat{a} must be a type-2 agent. Thus, for every pja^M(a^)p_{j}\succ_{\hat{a}}M(\hat{a}), slack(a^,pj)=0slack(\hat{a},p_{j})=0 and thresh(pj)a^thresh(p_{j})\neq\hat{a} and some update in the matching must have made one of these edges matchable, that is, for some tight edge (a^,pj)(\hat{a},p_{j}), thresh(pj)=a^thresh(p_{j})=\hat{a}. Consider the last iteration of the loop at line 14 when the free-promotions routine promoted a^\hat{a}. Then, by the choice of M(a^)M(\hat{a}) inside the routine, for every program pja^M(a^)p_{j}\succ_{\hat{a}}M(\hat{a}), edge (a^,pj)(\hat{a},p_{j}) is non-matchable. This implies that for every such pjp_{j}, thresh(pj)a^thresh(p_{j})\neq\hat{a}. Thus, a^\hat{a} remains a type-2 agent when the (l+1)(l+1)-th iteration begins.

This completes the proof of the lemma. ∎

Next, we show that the dual setting is feasible.

Lemma 14.

The dual setting is feasible throughout the algorithm.

Proof.

It is clear that the dual setting is feasible before entering the loop after line 7 for the first time. We show that if the dual setting is feasible before an arbitrary dual update (either line 8 or line 18) then it remains feasible after the update.

  • Update at line 8: Since aa is unmatched, by Lemma 13, aa is a type-1 agent and therefore, the slack on every edge incident on aa is c2c1c_{2}-c_{1}. By Fact 1, this update increases the lhs of every edge incident on aa by c2c1c_{2}-c_{1} and the iteration of the loop at line 7 terminates. Therefore the dual setting is feasible.

  • Update at line 18: We note that the update in line 18 increases the lhs of a subset of edges incident on agent aa^{\prime} (by Fact 2). Therefore we show that for an arbitrary agent aja_{j} selected as aa^{\prime}, the dual setting on the affected edges is feasible after the update.

    Consider the first iteration of the loop at line 14 wherein an arbitrary aja_{j} is selected as aa^{\prime} in line 15. Since aa=aja\neq a^{\prime}=a_{j}, the type of aja_{j} before execution of the loop at line 14 began is same as its type before entering the loop at line 7. Suppose aja_{j} is a type-2 agent then the fact that aja_{j} is threshold at some program in 𝒫(a)\mathcal{P}(a) contradicts that for every program pjajM(aj)p_{j}\succ_{a_{j}}M(a_{j}), thresh(pj)ajthresh(p_{j})\neq a_{j}. Therefore, aja_{j} is a type-1 agent. This implies that for every pjajM(aj)p_{j}\succ_{a_{j}}M(a_{j}), the slack of the edge (aj,pj)(a_{j},p_{j}) is c2c1c_{2}-c_{1}, therefore the dual update in line 18 maintains dual feasibility. By Lemma 12, this is the only iteration of the loop at line 14 when a=aja^{\prime}=a_{j}. Therefore, when the execution of loop at line 14 terminates (followed by immediate termination of the loop at line 7), the dual setting remains feasible.

This completes the proof of the lemma. ∎

Now, we show that the algorithm terminates in polynomial time and computes an 𝒜\mathcal{A}-perfect matching MM.

Lemma 15.

Algorithm 3 terminates by computing an 𝒜\mathcal{A}-perfect matching in polynomial time.

Proof.

We first show that in every iteration of the loop in line 7, either an unmatched agent is matched or at least one agent is promoted: by Lemma 13 and Fact 1, after the dual update in line 8 all edges incident on aa become tight. Either aa gets matched in line 10 or the loop in line 14 executes at least once. Since 𝒫(a)\mathcal{P}(a)\neq\emptyset every time the loop at line 14 is entered, an agent aa^{\prime} is selected in line 15. By the choice of aa^{\prime}, Lemma 13, Fact 2 and the choice of pp in line 17, the dual update in line 18 ensures that at least one edge (a,pj)(a^{\prime},p_{j}), for pjaM(a)p_{j}\succ_{a^{\prime}}M(a^{\prime}) becomes matchable and aa^{\prime} gets matched along that edge. By (P2), this modification does not demote aa^{\prime} (if aa^{\prime} was already matched). Therefore, either an unmatched agent (either aa in line 10 or aa^{\prime} in line 19) is matched or at least one agent (aa^{\prime} in line 19) is promoted during an iteration.

Thus after O(m)O(m) iterations of the loop in line 7, a fixed unmatched agent aa gets matched and the loop in line 7 terminates. As mentioned earlier, the free-promotions routine takes O(m2)O(m^{2}) time. Thus, the loop in line 7 terminates in O(m3)O(m^{3}) time for a fixed unmatched agent aa and the loop in 5 terminates in O(m3O(m^{3}𝒜)\mid\mathcal{A}\mid) time. By the termination condition of the loop, MM is an 𝒜\mathcal{A}-perfect matching. ∎

Remark on the running time. We observe that the initial setting of dual variables takes O(mO(m𝒜)\mid\mathcal{A}\mid) time because there are O(mO(m𝒜)\mid\mathcal{A}\mid) valid triplets. Since the algorithm guarantees (P2), with careful implementation of the free-promotions routine and efficiently computing the threshold agents, the running time of the algorithm can be improved. ∎

Finally, we show that the matching MM computed by Algorithm 3 is an a\ell_{a}-approximation.

Lemma 16.

Matching MM computed by Algorithm 3 is an a\ell_{a}-approximation of MinSumC.

Proof.

Let 𝖮𝖯𝖳{\sf OPT} be an optimal matching and c(M)c(M) and c(𝖮𝖯𝖳)c({\sf OPT}) denote the cost of MM and 𝖮𝖯𝖳{\sf OPT} respectively. By the LP duality, c(𝖮𝖯𝖳)a𝒜yac({\sf OPT})\geq\sum\limits_{a\in\mathcal{A}}{y_{a}}. By (P4), (a,p)M(a,p)\in M implies that the edge (a,p)(a,p) is tight. Thus, we have

c(M)=(a,p)Mc(p)\displaystyle c(M)=\sum\limits_{(a,p)\in M}{c(p)} =(a,p)M(ya+p=porpapapaza,p,aapaza,p,a)\displaystyle=\sum\limits_{(a,p)\in M}\Big{(}y_{a}+\sum_{\begin{subarray}{c}p^{\prime}=p\ \text{or}\\ p^{\prime}\prec_{a}p\end{subarray}}\ \ {\sum\limits_{a^{\prime}\prec_{p^{\prime}}a}{z_{a,p^{\prime},a^{\prime}}}}-\sum\limits_{a\prec_{p}a^{\prime}}{z_{a^{\prime},p,a}}\Big{)}
=a𝒜ya+(a,p)M(p=porpapapaza,p,aapaza,p,a)S(Z)\displaystyle=\sum\limits_{a\in\mathcal{A}}{y_{a}}+\underbrace{\sum\limits_{(a,p)\in M}\Big{(}\sum_{\begin{subarray}{c}p^{\prime}=p\ \text{or}\\ p^{\prime}\prec_{a}p\end{subarray}}\ \ {\sum\limits_{a^{\prime}\prec_{p^{\prime}}a}{z_{a,p^{\prime},a^{\prime}}}}-\sum\limits_{a\prec_{p}a^{\prime}}{z_{a^{\prime},p,a}}\Big{)}}_{S(Z)}

where the first equality is from Eq. 1, the second equality is from Eq. 6 and the third equality follows because MM is 𝒜\mathcal{A}-perfect. Let S(Z)S(Z) denote the second summation in the above cost. Our goal is to show that S(Z)S(Z) is upper-bounded by (a1)a𝒜ya(\ell_{a}-1)\sum\limits_{a\in\mathcal{A}}{y_{a}} thereby implying that c(M)aa𝒜yac(M)\leq\ell_{a}\cdot\sum\limits_{a\in\mathcal{A}}{y_{a}}.

We first note that all the zz variables are set to 0 initially and they are updated only inside the loop at line 14. We charge the update in every zz variable to a specific unmatched agent aa picked at line 6 and upper-bound the total update in zz charged to aa in terms of yay_{a}. Let AA^{\prime} be the set of agents unmatched before the loop at line 5 is entered. During every iteration of the loop in line 5, an unmatched agent aa from AA^{\prime} is picked and the loop in line 7 executes until aa is matched. Suppose that after picking aa in line 6, the loop in line 7 runs for κ(a)\kappa(a) iterations. Then, yay_{a} is incremented by c2c1c_{2}-c_{1} for κ(a)\kappa(a) times and since aa is matched, it is not picked again at line 6. Thus, at the end of algorithm, ya=c1+κ(a)(c2c1)y_{a}=c_{1}+\kappa(a)(c_{2}-c_{1}), that is yaκ(a)(c2c1)y_{a}\geq\kappa(a)(c_{2}-c_{1}).

We first present a simpler analysis that proves an (a+1)(\ell_{a}+1)-approximation. Recall that the zz variables are non-negative (Eq. 7). Thus, we upper-bound the total value of zz variables appearing in positive form in S(Z)S(Z). During the iterations 11 to κ(a)1\kappa(a)-1, the algorithm must enter the else part and in the κ(a)-th\kappa(a)\text{-}th iteration, the loop may or may not enter the else part. Suppose the algorithm enters the else part. Then by Lemma 11, for a fixed aa when the algorithm enters the else part, at most a\ell_{a} many zz variables are set to c2c1c_{2}-c_{1}. Thus, at most κ(a)a(c2c1)\kappa(a)\ell_{a}(c_{2}-c_{1}) total update in S(Z)S(Z) occurs during execution of the loop in line 7 when agent aa is picked. We charge this cost to agent aa, thus agent aAa\in A^{\prime} is charged at most aya\ell_{a}y_{a}. Thus,

c(M)=a𝒜ya+S(Z)\displaystyle c(M)=\sum\limits_{a\in\mathcal{A}}{y_{a}}+S(Z) a𝒜Aya+aAya+aAaya\displaystyle\leq\sum\limits_{a\in\mathcal{A}\setminus A^{\prime}}{y_{a}}+\sum\limits_{a\in A^{\prime}}{y_{a}}+\sum\limits_{a\in A^{\prime}}{\ell_{a}y_{a}}
(a+1)a𝒜ya(a+1)c(𝖮𝖯𝖳)\displaystyle\leq(\ell_{a}+1)\sum\limits_{a\in\mathcal{A}}{y_{a}}\leq(\ell_{a}+1)c({\sf OPT})

Now, we proceed to a better analysis that shows an a\ell_{a}-approximation. Recall that if (a,p,a)(a^{\prime},p,a) is a valid triplet then the variable za,p,az_{a^{\prime},p,a} appears in the dual constraint of possibly multiple edges incident on aa^{\prime} in positive form and in the dual constraint of exactly one edge, that is, the edge (a,p)(a,p) in negative form. We show that there exist certain valid triplets such that the corresponding zz variable occurring in positive form in the dual constraint of a matched edge also appears in negative form in the dual constraint of another matched edge, thereby canceling out their contribution in S(Z)S(Z). Thus, it is enough to upper-bound the update in zz variables that are not cancelled. We prove that the total update in such zz variables that is charged to an agent aAa\in A^{\prime} can be upper-bounded by (a1)ya(\ell_{a}-1)y_{a} instead of aya\ell_{a}y_{a} as done earlier.

Let aAa\in A^{\prime} be an arbitrary agent. Suppose that after aa is selected at line 6, aa is matched to some program p¯\overline{p} and that M(a)=pkM(a)=p_{k} at the end of the algorithm. By (P2), pk=p¯p_{k}=\overline{p} or pkap¯p_{k}\succ_{a}\overline{p}. Also, during iterations 11 to κ(a)1\kappa(a)-1, thresh(pk)athresh(p_{k})\neq a and the loop in line 14 executes. It implies that in each of the iterations, there exists an agent aja_{j} such that thresh(pk)=ajthresh(p_{k})=a_{j} and zaj,pk,az_{a_{j},p_{k},a} is updated. Also, aja_{j} was matched to pp^{\prime} such that p=pkp^{\prime}=p_{k} or pajpkp^{\prime}\succ_{a_{j}}p_{k}. By (P2), at the end of the algorithm, M(aj)=pM(a_{j})=p^{\prime} or M(aj)apM(a_{j})\succ_{a^{\prime}}p^{\prime}. Thus, the variable zaj,pk,az_{a_{j},p_{k},a} appears in positive form in the dual constraint of the edge (aj,M(aj))(a_{j},M(a_{j})). Since (a,pk)M(a,p_{k})\in M and the variable zaj,pk,az_{a_{j},p_{k},a} appears in negative form in the dual constraint of edge (a,pk)(a,p_{k}). Therefore, the variable zaj,pk,az_{a_{j},p_{k},a} cancels out in S(Z)S(Z). This implies that for each of the iterations 11 to κ(a)1\kappa(a)-1, at most a1\ell_{a}-1 many zz variables are set to c2c1c_{2}-c_{1} such that they may not cancel out. We charge the update in these variables to aa.

In the last κ(a)\kappa(a)-th iteration, aa gets matched. If aa is matched at line 10 then no zz variable is updated during this iteration. Otherwise, aa is matched in one of the iterations of the loop in line 14 by the free-promotions routine. Recall that by our assumption, aa is matched to p¯\overline{p} in this step. By the choice of p¯\overline{p} in the free-promotions routine, the edge (a,p¯)(a,\overline{p}) must have been matchable, that is, it is tight and thresh(p¯)=athresh(\overline{p})=a. The fact that edge (a,p¯)(a,\overline{p}) was tight implies (by Fact 2) that no variable of the form z×,p¯,az_{\times,\overline{p},a} was updated so far inside the loop at line 14 during the κ(a)\kappa(a)-th iteration. When 𝒫(a)\mathcal{P}(a) is re-computed, p¯𝒫(a)\overline{p}\notin\mathcal{P}(a) because M(a)=p¯M(a)=\overline{p} at this step. Thus, in the subsequent iterations of the loop in line 14, no agent aa^{\prime} could have selected p¯\overline{p} in line 17. This implies that no zz variable of the form z×,p¯,az_{\times,\overline{p},a} is updated during the rest of the execution of the loop at line 14 of the κ(a)\kappa(a)-th iteration. This implies that during the κ(a)\kappa(a)-th iteration, the zz variables that are set to c2c1c_{2}-c_{1} are of the form z×,p^,az_{\times,\hat{p},a} where p¯p^\overline{p}\neq\hat{p}. By the fact that p¯𝒩(a)\overline{p}\in\mathcal{N}(a), p^𝒩(a)\hat{p}\in\mathcal{N}(a) and 𝒩(a)\mid\mathcal{N}(a)\mid a\leq\ell_{a}, the number such zz variables is at most a1\ell_{a}-1.

Thus, during κ(a)\kappa(a) many iterations for the agent aAa\in A^{\prime} at most κ(a)(a1)(c2c1)\kappa(a)(\ell_{a}-1)(c_{2}-c_{1}) total update in S(Z)S(Z) is charged to aa. Recall that yaκ(a)(c2c1)y_{a}\geq\kappa(a)(c_{2}-c_{1}). Thus, agent aAa\in A^{\prime} contributes at most (a1)ya(\ell_{a}-1)y_{a} in S(Z)S(Z). This gives

c(M)=a𝒜ya+S(Z)\displaystyle c(M)=\sum\limits_{a\in\mathcal{A}}{y_{a}}+S(Z) a𝒜Aya+aAya+aA(a1)ya\displaystyle\leq\sum\limits_{a\in\mathcal{A}\setminus A^{\prime}}{y_{a}}+\sum\limits_{a\in A^{\prime}}{y_{a}}+\sum\limits_{a\in A^{\prime}}{(\ell_{a}-1)\cdot y_{a}}
aa𝒜yaac(𝖮𝖯𝖳)\displaystyle\leq\ell_{a}\sum\limits_{a\in\mathcal{A}}{y_{a}}\leq\ell_{a}\cdot c({\sf OPT})

This completes the proof of the lemma. ∎

This establishes Theorem 1.6.

5 Hardness and inapproximability

In this section, we prove hardness and inapproximability results for MinSumC. These results are extended versions of the hardness results in [15]. Recall that under the MinSumC setting, envy-freeness and stability are equivalent.

5.1 Constant factor inapproximability of MinSumC

In this section, we show that MinSumC cannot be approximated within any constant factor. This result holds even when there are only two distinct costs in the instance and the preference lists follow master list ordering on both sides. We present a reduction from the Set cover problem.

The Set cover problem: Given a universe 𝒰\mathcal{U} of nn elements {e1,e2,,en}\{e_{1},e_{2},\ldots,e_{n}\} and a collection 𝒞\mathcal{C} of mm sets {C1,C2,,Cm}\{C_{1},C_{2},\ldots,C_{m}\} where each set Cj𝒰C_{j}\subseteq\mathcal{U}, a set cover is a set T𝒞T\subseteq\mathcal{C} such that CTC=𝒰\bigcup_{C\in T}C=\mathcal{U}. Given an integer kk, the goal is to decide whether there is a set cover with cardinality at most kk.

A subset CjC_{j} is said to cover an element eie_{i} if eiCje_{i}\in C_{j}. A set T𝒞T\subseteq\mathcal{C} is said to cover element eie_{i} if there exists CjTC_{j}\in T such that CjC_{j} covers eie_{i}.

Reduction to MinSumC: Given a set cover instance I=(𝒰,𝒞,k)I=(\mathcal{U},\mathcal{C},k), the corresponding MinSumC instance II^{\prime} is constructed as follows: for every element ei𝒰e_{i}\in\mathcal{U}, there is an element-agent aia_{i}. For every subset Cj𝒞C_{j}\in\mathcal{C}, there is a subset-program cjc_{j} and nn dummy agents ujlu_{j}^{l} and nn dummy programs wjlw_{j}^{l} where 1ln1\leq l\leq n. Therefore, in the reduced instance, there are n+nmn+nm agents and m+mnm+mn programs.

Next, we define the cost of the programs and the preference lists in the reduced instance. For all subset-programs, c(cj)=1c(c_{j})=1 and for all dummy programs, c(wjl)=0c(w_{j}^{l})=0. Note that in the reduced instance, there are only two distinct costs. For a set QQ, let Q\langle Q\rangle denote the elements of QQ ordered in a fixed but arbitrary way. Every element-agent aia_{i} ranks all subset-programs cjc_{j} such that the corresponding element eie_{i} is in the subset CjC_{j}. Every dummy agent ujiu_{j}^{i} corresponding to the subset CjC_{j} prefers the subset-program cjc_{j} over the dummy program corresponding to CjC_{j}. Every subset-program cjc_{j} prefers its corresponding dummy agents ujlu_{j}^{l} over the element-agents aia_{i} corresponding to elements in the subset CjC_{j}. Every dummy program ranks only its dummy agents. The preference lists are shown below. Note that 1in1\leq i\leq n, 1jm1\leq j\leq m.

Preference lists of agents

ai\displaystyle a_{i} :{cj|eiCj}\displaystyle:\langle\{c_{j}|e_{i}\in C_{j}\}\rangle
ujl\displaystyle u^{l}_{j} :cjwjl\displaystyle:c_{j}\succ w^{l}_{j}

Preference lists of programs

cj(0,1)\displaystyle\hskip 2.84544ptc_{j}(0,1) :{ujl|1ln}{ai|eiCj}\displaystyle:\langle\{u_{j}^{l}|1\leq l\leq n\}\rangle\succ\langle\{a_{i}|e_{i}\in C_{j}\}
wjl(0,0)\displaystyle w^{l}_{j}(0,0) :ujl\displaystyle:u^{l}_{j}

We define kk^{\prime} as (k+1)n(k+1)n. We also assume that k>1k>1, without loss of generality.

Lemma 17.

Given a set cover TT in II such that |T|k|T|\leq k, we can construct an 𝒜\mathcal{A}-perfect envy-free matching MM in II^{\prime} such that c(M)kc(M)\leq k^{\prime}.

Proof.

Let Copen={cjCjT}C_{open}=\{c_{j}\mid C_{j}\in T\}. Note that |Copen|=|T||C_{open}|=|T|. Construct MM by matching every element-agent aia_{i} to its highest-preferred program in CopenC_{open}. Dummy agents corresponding to programs in CopenC_{open} are matched to their respective programs, and the remaining dummy agents are matched to their dummy programs. Thus the matching MM is 𝒜\mathcal{A}-perfect.

We show that the constructed matching MM is envy-free. For element-agents aia_{i}, any program pp such that paiM(ai)p\succ_{a_{i}}M(a_{i}) will have no agents matched to it (by construction). The same holds for dummy agents corresponding to programs not in CopenC_{open}. The dummy agents corresponding to programs in CopenC_{open} are matched to their highest-preferred programs. Therefore, no agent envies another agent.

Next, we show that c(M)kc(M)\leq k^{\prime}. For every program cjc_{j} in CopenC_{open}, some number of element-agents and all dummy agents of cjc_{j} are matched to it in MM. There are nn such dummy agents per program, while the element-agents together contribute a cost of nn over all programs. Therefore, c(M)=|Copen|n+n=(|T|+1)nc(M)=|C_{open}|n+n=(|T|+1)n. Given that |T|k|T|\leq k, we get c(M)(k+1)n=kc(M)\leq(k+1)n=k^{\prime}. ∎

Lemma 18.

Given an 𝒜\mathcal{A}-perfect envy-free matching MM in II^{\prime} such that c(M)αkc(M)\leq\alpha k^{\prime} for some constant α>1\alpha>1, we can construct a set cover TT in II such that |T|2αk|T|\leq 2\alpha k.

Proof.

Given MM, define the set of programs Copen={cjai such that M(ai)=cj}C_{open}=\{c_{j}\mid\exists a_{i}\text{ such that }M(a_{i})=c_{j}\}. Let T={CjcjCopen}T=\{C_{j}\mid c_{j}\in C_{open}\}. We show that the set TT is a set cover. Suppose for the contradiction that TT is not a set cover. Then there exists an element eie_{i} which is not covered by TT. None of the potential partners of the corresponding element-agent aia_{i} are in CopenC_{open}, so aia_{i} must be unmatched in MM. This implies that MM is not 𝒜\mathcal{A}-perfect, leading to a contradiction. Thus, TT is a set cover.

Next, we show that the size of TT is at most 2αk2\alpha k. Note that |T|=|Copen||T|=|C_{open}|. Since MM is an 𝒜\mathcal{A}-perfect matching, each aia_{i} is matched in MM, thereby contributing a cost of one unit each in c(M)c(M). Moreover, since MM is envy-free, if an agent aia_{i} is matched to program cjc_{j} then the nn dummy agents ujlu_{j}^{l} corresponding to cjc_{j} must be matched to cjc_{j} in MM. They together contribute a cost of n|Copen|n|C_{open}| since such cjCopenc_{j}\in C_{open}. The dummy agents corresponding to each program cjCopenc_{j}\notin C_{open} may be matched to either cjc_{j} or wjlw_{j}^{l}. Thus, c(M)n+n|Copen|=n(1+|T|)c(M)\geq n+n|C_{open}|=n(1+|T|). Given that c(M)αkc(M)\leq\alpha k^{\prime}, we get n(|T|+1)α(k+1)nn(|T|+1)\leq\alpha(k+1)n. This implies that |T||T|+12αk|T|\leq|T|+1\leq 2\alpha k.

Suppose, for the sake of contradiction, that there exists an α\alpha-approximation algorithm for the MinSumC problem. For a given set cover instance, we can use the above reduction to construct a MinSumC instance. Then, using the α\alpha-approximation algorithm and Lemma 17 and Lemma 18, we can get a 2α2\alpha-approximation algorithm for the Set Cover problem. However, the Set Cover problem cannot be approximated within any constant factor unless 𝖯=𝖭𝖯\sf P=\sf NP [8]. This implies that for any constant α\alpha, MinSumC does not admit an α\alpha-approximation algorithm.

Finally, we note that the following master list ordering over agents and programs holds in the reduced MinSumC instance.

u11u12u1nu21u22umn1umna1a2an\displaystyle u_{1}^{1}\succ u_{1}^{2}\succ\dots\succ u_{1}^{n}\succ u_{2}^{1}\succ u_{2}^{2}\succ\dots\succ u_{m}^{n-1}\succ u_{m}^{n}\succ a_{1}\succ a_{2}\succ\dots\succ a_{n}
c1c2cmw11w12w1nw21w22wmn1wmn\displaystyle c_{1}\succ c_{2}\succ\dots\succ c_{m}\succ w_{1}^{1}\succ w_{1}^{2}\succ\dots\succ w_{1}^{n}\succ w_{2}^{1}\succ w_{2}^{2}\succ\dots\succ w_{m}^{n-1}\succ w_{m}^{n}

This establishes Theorem 1.2.

Remark: Note that in the MinSumC problem, stable matchings and envy-free matchings are the same. Thus, if we had an α\alpha-approximation algorithm for the MinSum problem, we would have an α\alpha-approximation algorithm for MinSumC, which would contradict Theorem 1.2. Thus, the MinSum problem is also constant-factor inapproximable. As mentioned earlier, this also follows from Theorem 2 in [7].

5.2 (aϵ)(\ell_{a}-\epsilon)-inapproximability of MinSumC

In this section, we show that our algorithmic result for the MinSumC problem (Theorem 1.6) is tight modulo Unique Games Conjecture [13]. Specifically, we show that for any ϵ>0\epsilon>0, MinSumC does not admit an (aϵ)(\ell_{a}-\epsilon) approximation algorithm. We present a reduction from the Vertex cover problem, which is a special case of the Set cover problem defined in Section 5.1. The construction of the MinSumC instance presented below is similar to the construction presented in Section 5.1.

We first note the following: if MinSumC admits an approximation algorithm with guarantee (aα)(\ell_{a}-\alpha) then it admits an approximation algorithm with guarantee (aβ)(\ell_{a}-\beta) for any constants β<α\beta<\alpha. Therefore, it is enough to show that MinSumC does not admit an approximation algorithm with guarantee (aϵ)(\ell_{a}-\epsilon) for ϵ12\epsilon\leq\frac{1}{2}.


The Vertex cover problem: Given a graph G(V,E)G(V,E) where |V|=n|V|=n and |E|=m|E|=m, a set TVT\subseteq V is called a vertex cover if for every edge eEe\in E, there is a vertex vTv\in T such that ee is incident on vv. Given an integer kk, our goal is to decide whether there exists a vertex cover with cardinality at most kk. An instance (G,k)(G,k) of the Vertex cover problem can be reduced to the instance of the Set cover problem by taking 𝒰=E\mathcal{U}=E, 𝒞={𝒩(v)vV}\mathcal{C}=\{\mathcal{N}(v)\mid v\in V\} and the same value of kk.


Reduction to MinSumC: Given a vertex cover instance II, construct the corresponding set cover instance I¯\overline{I}. Then construct the MinSumC instance II^{\prime} from I¯\overline{I} as presented in Section 5.1 with the following change: instead of constructing nn dummy agents and programs per subset Cj𝒞C_{j}\in\mathcal{C}, construct f(n,ϵ)f(n,\epsilon)-many such dummy agents and dummy programs corresponding to each subset CjC_{j}, where f(n,ϵ)=2n(1ϵ)ϵ1f(n,\epsilon)=\frac{2n(1-\epsilon)}{\epsilon}\geq 1 (since ϵ12\epsilon\leq\frac{1}{2}).

Note that in the reduced instance, there are n+f(n,ϵ)mn+f(n,\epsilon)m agents and m+f(n,ϵ)mm+f(n,\epsilon)m programs. The preference lists for all agents and programs are constructed identically as presented in Section 5.1. We define k=n+kf(n,ϵ)k^{\prime}=n+kf(n,\epsilon).

Lemma 19.

Given a vertex cover TT in II such that |T|k|T|\leq k, we can construct an 𝒜\mathcal{A}-perfect envy-free matching MM in II^{\prime} such that c(M)kc(M)\leq k^{\prime}.

Proof.

Let Copen={cjCjT}C_{open}=\{c_{j}\mid C_{j}\in T\}. Note that |Copen|=|T||C_{open}|=|T|, as in Lemma 17. Again, MM is constructed by matching every element-agent aia_{i} to its highest-preferred program in CopenC_{open}. Dummy agents corresponding to programs in CopenC_{open} are matched to their respective programs, and the remaining dummy agents are matched to their dummy programs. As in Lemma 17, we see that MM is 𝒜\mathcal{A}-perfect and envy-free. Moreover, c(M)kc(M)\leq k^{\prime}. ∎

Lemma 20.

If II^{\prime} admits an 𝒜\mathcal{A}-perfect envy-free matching MM with c(M)(aϵ)kc(M)\leq\left(\ell_{a}-\epsilon\right)k^{\prime} for 12ϵ>0\frac{1}{2}\geq\epsilon>0, then II admits a vertex cover TTwith |T|(2ϵ)k|T|\leq\left(2-\epsilon^{\prime}\right)k where ϵ=ϵ2\epsilon^{\prime}=\frac{\epsilon}{2}.

Proof.

Given an 𝒜\mathcal{A}-perfect envy-free matching MM, define the set of opened programs CopenC_{open} and construct a vertex cover TT using CopenC_{open}, as done in the proof of Lemma 18. Hence, |T|=|Copen||T|=|C_{open}|. As it follows from Lemma 18, TT is a valid set cover. Next, we show that |T|(2ϵ2)k|T|\leq\left(2-\frac{\epsilon}{2}\right)k. Since we have f(n,ϵ)f(n,\epsilon)-many dummy agents for every program, specifically for every cjCopenc_{j}\in C_{open}, the cost c(M)n+|T|f(n,ϵ)c(M)\geq n+|T|\cdot f(n,\epsilon). Also, in the reduced instance II^{\prime}, we have a=2\ell_{a}=2 since each element of I¯\overline{I} is contained in exactly two sets (corresponding to the two end-points of that edge in II), so the element-agents have only two programs in their preference lists, dummy agents always have only two programs in their preference list. Therefore, we get

n+|T|f(n,ϵ)\displaystyle n+|T|\cdot f(n,\epsilon) c(M)(aϵ)k=(aϵ)(n+kf(n,ϵ))\displaystyle\leq c(M)\leq(\ell_{a}-\epsilon)k^{\prime}=(\ell_{a}-\epsilon)(n+kf(n,\epsilon))
|T|\displaystyle\implies|T| (aϵ)k+(aϵ1)nf(n,ϵ)=(2ϵ)k+(1ϵ)nf(n,ϵ)\displaystyle\leq(\ell_{a}-\epsilon)k+\frac{(\ell_{a}-\epsilon-1)n}{f(n,\epsilon)}=(2-\epsilon)k+\frac{(1-\epsilon)n}{f(n,\epsilon)} (a=2)\displaystyle(\ell_{a}=2)

Substituting f(n,ϵ)=n(1ϵ)(ϵ2)f(n,\epsilon)=\frac{n(1-\epsilon)}{\left(\frac{\epsilon}{2}\right)} followed by k1k\geq 1, we get

|T|\displaystyle|T| (2ϵ)k+ϵ2(2ϵ)k+kϵ2=(2ϵ2)k=(2ϵ)k\displaystyle\leq(2-\epsilon)k+\frac{\epsilon}{2}\leq(2-\epsilon)k+\frac{k\epsilon}{2}=\left(2-\frac{\epsilon}{2}\right)k=(2-\epsilon^{\prime})k

where ϵϵ2>0\epsilon^{\prime}\equiv\frac{\epsilon}{2}>0. ∎

If the MinSumC problem admits an (aϵ)(\ell_{a}-\epsilon)-approximation algorithm (ϵ>0\epsilon>0), then using Lemma 20 and Lemma 19 we get a (2ϵ)(2-\epsilon^{\prime})-approximation algorithm (ϵ>0\epsilon^{\prime}>0) for the Vertex cover problem (where ϵ=ϵ2\epsilon^{\prime}=\frac{\epsilon}{2}). However, under the Unique Games Conjecture, it is known that the Vertex cover problem cannot be approximated within a factor of (2ϵ)(2-\epsilon^{\prime}) for ϵ>0\epsilon^{\prime}>0 [13]. Therefore, the MinSumC problem does not admit an (aϵ)(\ell_{a}-\epsilon)-approximation algorithm, for any ϵ>0\epsilon>0.

We further notice that in the reduced instance, there is a master list ordering over agents and programs, as described in Section 5.1. This establishes Theorem 1.3.

Remark: An argument similar to that in Section 5.1 shows that Theorem 1.3 implies (aϵ)(\ell_{a}-\epsilon)-inapproximability for the MinSum problem as well.

6 Concluding remarks

In this work we propose and investigate the generalized capacity planning problem for the many-to-one matchings under two-sided preferences. Motivated by the need to match every agent, we propose a setting wherein costs control the extent to which a program is matched. We aim to compute a stable matching in an optimally cost-augmented instance such that it matches every agent. We investigate two optimization problems. We prove that the MinMax problem is efficiently solvable but the MinSum problem turns out to be 𝖭𝖯\sf NP-hard. We present approximation algorithms for MinSum with varying approximation guarantees and an improved approximation algorithm for a special hard case. A specific open direction is to bridge the gap between the upper bound and lower bound for general instances of the MinSum problem. It is also interesting to extend the LP algorithm for general instances.

References

  • [1] Abdulkadiroğlu, A., Sönmez, T.: School Choice: A Mechanism Design Approach. American Economic Review 93(3), 729–747 (2003). https://doi.org/10.1257/000282803322157061
  • [2] Abe, K., Komiyama, J., Iwasaki, A.: 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 2022, Vienna, Austria, 23-29 July 2022. pp. 3–9 (2022). https://doi.org/10.24963/ijcai.2022/1
  • [3] Afacan, M.O., Dur, U., Van der Linden, M.: Capacity design in school choice. Games and Economic Behavior 146, 277–291 (2024). https://doi.org/10.1016/j.geb.2024.05.002
  • [4] Baswana, S., Chakrabarti, P.P., Chandran, S., Kanoria, Y., Patange, U.: Centralized Admissions for Engineering Colleges in India. Interfaces 49(5), 338–354 (2019). https://doi.org/10.1287/inte.2019.1007
  • [5] Bobbio, F., Carvalho, M., Lodi, A., Rios, I., Torrico, A.: Capacity Planning in Stable Matching: An Application to School Choice. In: Proceedings of the Twenty-Fourth ACM Conference on Economics and Computation. p. 295 (2023). https://doi.org/10.1145/3580507.3597771
  • [6] Bobbio, F., Carvalho, M., Lodi, A., Torrico, A.: Capacity Variation in the Many-to-one Stable Matching (2022). https://doi.org/10.48550/ARXIV.2205.01302
  • [7] Chen, J., Csáji, G.: Optimal Capacity Modification for Many-To-One Matching Problems. In: Proceedings of the Twenty-Second International Conference on Autonomous Agents and Multiagent Systems, AAMAS 2023. pp. 2880–2882 (2023), https://dl.acm.org/doi/10.5555/3545946.3599110
  • [8] Dinur, I., Steurer, D.: Analytical approach to parallel repetition. In: Proceedings of the Forty-Sixth Annual ACM symposium on Theory of Computing. pp. 624–633 (2014). https://doi.org/10.1145/2591796.2591884
  • [9] Gajulapalli, K., Liu, J.A., Mai, T., Vazirani, V.V.: Stability-Preserving, Time-Efficient Mechanisms for School Choice in Two Rounds. In: Proceedings of the Fortieth IARCS Annual Conference on Foundations of Software Technology and Theoretical Computer Science, (FSTTCS 2020). pp. 21:1–21:15 (2020). https://doi.org/10.4230/LIPIcs.FSTTCS.2020.21
  • [10] Gale, D., Shapley, L.S.: College admissions and the stability of marriage. The American Mathematical Monthly 69(1), 9–15 (1962), http://www.jstor.org/stable/2312726
  • [11] Kavitha, T., Nasre, M.: Popular matchings with variable item copies. Theor. Comput. Sci. 412(12-14), 1263–1274 (2011). https://doi.org/10.1016/J.TCS.2010.12.067
  • [12] Kavitha, T., Nasre, M., Nimbhorkar, P.: Popularity at minimum cost. J. Comb. Optim. 27(3), 574–596 (2014). https://doi.org/10.1007/S10878-012-9537-0
  • [13] Khot, S., Regev, O.: Vertex cover might be hard to approximate within 2-ϵ\epsilon. Journal of Computer and System Sciences 74(3), 335–349 (2008). https://doi.org/10.1016/j.jcss.2007.06.019
  • [14] Krishnapriya, A.M., Nasre, M., Nimbhorkar, P., Rawat, A.: How Good Are Popular Matchings? In: Proceedings of the Seventeenth International Symposium on Experimental Algorithms (SEA 2018). pp. 9:1–9:14 (2018). https://doi.org/10.4230/LIPIcs.SEA.2018.9
  • [15] Limaye, G., Nasre, M.: Optimal Cost-Based Allocations Under Two-Sided Preferences. In: Proceedings of the Thirty-Fourth International Workshop on Combinatorial Algorithms (IWOCA 2023). pp. 259–270 (2023), https://link.springer.com/chapter/10.1007/978-3-031-34347-6_22
  • [16] Othman, A., Sandholm, T., Budish, E.: Finding approximate competitive equilibria: efficient and fair course allocation. In: Proceedings of the Ninth International Conference on Autonomous Agents and Multiagent Systems (AAMAS 2010). p. 873–880 (2010), https://dl.acm.org/doi/10.5555/1838206.1838323
  • [17] Robards, P.A.: Applying two-sided matching processes to the United States Navy Enlisted assignment process. Tech. rep., Naval Postgraduate School Monterey CA (2001), https://hdl.handle.net/10945/10845
  • [18] Roth, A.E.: On the Allocation of Residents to Rural Hospitals: A General Property of Two-Sided Matching Markets. Econometrica 54(2), 425–427 (1986), http://www.jstor.org/stable/1913160
  • [19] Santhini, K.A., Sankar, G.S., Nasre, M.: Optimal matchings with one-sided preferences: Fixed and cost-based quotas. In: Proceedings of the Twenty-First International Conference on Autonomous Agents and Multiagent Systems, AAMAS 2022. pp. 696–704 (2022), https://dl.acm.org/doi/10.5555/3535850.3535929
  • [20] Wu, Q., Roth, A.E.: The lattice of envy-free matchings. Games and Economic Behavior 109, 201–211 (2018). https://doi.org/10.1016/j.geb.2017.12.016
  • [21] Yang, W., Giampapa, J., Sycara, K.: Two-sided matching for the US Navy Detailing Process with Market Complication. Tech. rep., Robotics Institute, Carnegie-Mellon University (2003), https://www.ri.cmu.edu/publications/two-sided-matching-for-the-u-s-navy-detailing-process-with-market-complication/

Appendix 0.A Appendix

0.A.1 Challenges in designing a primal-dual algorithm for MinSumC

A standard primal-dual approach for the MinSumC problem would be to begin with a dual feasible solution. The algorithm then repeatedly updates the dual till we obtain a primal feasible solution using the tight edges w.r.t. to the dual setting. We illustrate the challenges in using such an approach for the general MinSumC problem. Consider the MinSumC instance in Fig. 8. Recall that the tuple (q,c)(q,c) preceding a program indicates that the initial quota and cost of that program is qq and cc respectively. Since the instance in Fig. 8 is of the MinSumC problem, the initial quotas are 0 for each program.

a1\displaystyle a_{1} :p1p0\displaystyle:p_{1}\succ p_{0}
a2\displaystyle a_{2} :p1p0\displaystyle:p_{1}\succ p_{0}
a3\displaystyle a_{3} :p1p0\displaystyle:p_{1}\succ p_{0}
a4\displaystyle a_{4} :p1p2p0\displaystyle:p_{1}\succ p_{2}\succ p_{0}
a5\displaystyle a_{5} :p2p3\displaystyle:p_{2}\succ p_{3}
(0,0)p0\displaystyle(0,0)\ p_{0} :a1a2a3a4\displaystyle:a_{1}\succ a_{2}\succ a_{3}\succ a_{4}
(0,1)p1\displaystyle(0,1)\ p_{1} :a1a2a3a4\displaystyle:a_{1}\succ a_{2}\succ a_{3}\succ a_{4}
(0,6)p2\displaystyle(0,6)\ p_{2} :a4a5\displaystyle:a_{4}\succ a_{5}
(0,11)p3\displaystyle(0,11)\ p_{3} :a5\displaystyle:a_{5}
Figure 8: A MinSumC instance used in illustrating the challenges

Assume that we begin with an initial dual setting where all dual variables are set to 0. The matching M={(a1,p0),(a2,p0),(a3,p0),(a4,p0)}M=\{(a_{1},p_{0}),(a_{2},p_{0}),(a_{3},p_{0}),(a_{4},p_{0})\} obtained on the tight edges is envy-free but does not match agent a5a_{5} and hence is not primal feasible. Since no edge incident on a5a_{5} is tight (slack on (a5,p2)(a_{5},p_{2}) and (a5,p3)(a_{5},p_{3}) is 6 and 11 respectively) we can set y5y_{5} to 6 while maintaining dual feasibility. We observe that while this update makes the edge (a5,p2)(a_{5},p_{2}) tight, adding the edge to the matching MM introduces an envy pair – namely a4a_{4} envying a5a_{5}. We note that this is our first difficulty, that is, while there are tight edges incident on an unmatched agent, none of them may be matchable.

The second difficulty stems from the following: in order to match a5a_{5} along the (non-matchable) tight edge (a5,p2)(a_{5},p_{2}) we must first resolve the potential envy pair (a4,a5)(a_{4},a_{5}), that is, we must promote agent a4a_{4}. With the current dual setting, y4y_{4} cannot be increased hence a natural way is to update a zz variable. This can indeed be achieved by setting za4,p2,a5=1z_{{a_{4}},{p_{2}},{a_{5}}}=1, thus making (a4,p1)(a_{4},p_{1}) tight. However, as encountered earlier, this edge is not matchable, since matching a4a_{4} to p1p_{1} introduces several other envy pairs. Note that this chain of potential envy resolutions is triggered by the unmatched agent a5a_{5}. Since, this chain can be arbitrarily long, several zz updates may be required. It is not immediate if these updates in zz variables can be charged to an update in some yy variable, thereby achieving a reasonable approximation ratio.

However, as seen in Section 4.2, for the restricted hard case of two distinct costs, we are able to resolve these challenges.

0.A.2 Example illustrating the execution of Algorithm 3

a1\displaystyle a_{1} :p1p2p0\displaystyle:p_{1}\succ p_{2}\succ p_{0}
a2\displaystyle a_{2} :p2p3p0\displaystyle:p_{2}\succ p_{3}\succ p_{0}
a3\displaystyle a_{3} :p1p2p3\displaystyle:p_{1}\succ p_{2}\succ p_{3}
(0,0)p0\displaystyle(0,0)\ p_{0} :a1a2\displaystyle:a_{1}\succ a_{2}
(0,1)p1\displaystyle(0,1)\ p_{1} :a1a3\displaystyle:a_{1}\succ a_{3}
(0,1)p2\displaystyle(0,1)\ p_{2} :a1a2a3\displaystyle:a_{1}\succ a_{2}\succ a_{3}
(0,1)p3\displaystyle(0,1)\ p_{3} :a2a3\displaystyle:a_{2}\succ a_{3}
  • M={(a1,p0),(a2,p0)}M=\{(a_{1},p_{0}),(a_{2},p_{0})\}

  • (1) a=a3a=a_{3}, ya3=1y_{a_{3}}=1, tight edges on a3a_{3} are {(a3,p1)\{(a_{3},p_{1}), (a3,p2)(a_{3},p_{2}), (a3,p3)}(a_{3},p_{3})\}, thresh(p1)=thresh(p2)=a1thresh(p_{1})=thresh(p_{2})=a_{1} and thresh(p3)=a2thresh(p_{3})=a_{2}

  • (3a) 𝒫(a3)={p1,p2,p3}\mathcal{P}(a_{3})=\{p_{1},p_{2},p_{3}\}

  • (3b,3c) let a=a1a^{\prime}=a_{1}, then p=p2p=p_{2}, za1,p2,a3=1z_{a_{1},p_{2},a_{3}}=1

  • (3d) Tight edges on a1a_{1} are {(a1,p1),(a1,p2)}\{(a_{1},p_{1}),(a_{1},p_{2})\}, p=p1p^{\prime}=p_{1}, M={(a1,p1),(a2,p0)}M=\{(a_{1},p_{1}),(a_{2},p_{0})\}, tight edges on a3a_{3} are {(a3,p1),(a3,p3)}\{(a_{3},p_{1}),(a_{3},p_{3})\}

  • (3e) thresh(p1)=a3thresh(p_{1})=a_{3}, M={(a1,p1),(a2,p0),(a3,p1)}M=\{(a_{1},p_{1}),(a_{2},p_{0}),(a_{3},p_{1})\}

  • (3f) 𝒫(a3)=\mathcal{P}(a_{3})=\emptyset

Figure 9: A MinSumC𝖼𝟣,𝖼𝟤{\sf\textsc{MinSumC}_{c1,c2}} instance. An execution of Algorithm 3 is illustrated by giving the state of the algorithm. The blue content in the brackets correspond to the labels of steps mentioned in the description of the algorithm.