Stability Notions for Hospital Residents with Sizes
Abstract
The Hospital Residents problem with sizes (HRS) is a generalisation of the well-studied hospital residents (HR) problem. In the HRS problem, an agent has a size and the agent occupies many positions of the hospital when assigned to . The notion of stability in this setting is suitably modified, and it is known that deciding whether an HRS instance admits a stable matching is NP-hard under severe restrictions. In this work, we explore a variation of stability, which we term occupancy-based stability. This notion was defined by McDermid and Manlove (J. of Comb. Opt. 2010) but remained unexplored to the best of our knowledge. In our work, we show that every HRS instance admits an occupancy-stable matching. We further show that computing a maximum-size occupancy-stable matching is NP-hard. We complement our hardness result by providing an approximation algorithm with a guarantee strictly better than for the max-size occupancy-stable matching problem.
Given that the classical notion of stability adapted for HRS is not guaranteed to exist in general, we show a practical restriction under which a stable matching is guaranteed to exist. We present an efficient algorithm to output a stable matching in the restricted HRS instances. We also provide an alternate NP-hardness proof for the decision version of the stable matching problem for HRS which imposes a severe restriction on the number of neighbours of non-unit sized agents.
Keywords and phrases:
Stable matchings, Hospital Residents with sizes, Approximation algorithms, NP-hardnessCopyright and License:
2012 ACM Subject Classification:
Theory of computation Design and analysis of algorithmsAcknowledgements:
We thank the anonymous reviewers for their comments that significantly improved the presentation of the paper.Editors:
C. Aiswarya, Ruta Mehta, and Subhajit RoySeries and Publisher:
Leibniz International Proceedings in Informatics, Schloss Dagstuhl – Leibniz-Zentrum für Informatik
1 Introduction
The Hospital Residents (HR) setting is a well-studied scenario in the literature where a set of agents, commonly called as a set of residents, needs to be assigned to hospitals. Each agent strictly orders the set of hospitals acceptable to the agent. This ordering is called the preference list. Similarly, each hospital also has a strict ordering of agents acceptable to the hospital. In addition, each hospital has a capacity that denotes the maximum number of agents that can be assigned to the hospital. The goal in the HR problem is to compute an assignment of agents to hospitals which respects the capacities and is optimal with respect to the preferences submitted. The HR problem models several important applications, namely, recruiting medical interns (residents) in hospitals [11, 6], admitting students to degree programs; for example, the Joint Seat Allocation Authority (JOSAA) that is used in undergraduate admissions in India [8, 2], and many similar scenarios [13, 1]. In most of these settings, the de facto standard of optimality with preferences is the notion of stability. Informally, an assignment is stable if no agent hospital pair wishes to deviate from the assignment. It is well known that every instance of the HR problem admits a stable assignment [6].
Since the HR setting is relevant in various practical scenarios, the problem has been extensively studied in the literature. Furthermore, several generalisations of the HR setting are investigated. In this paper, we consider a particular variant in which agents can have sizes, and we denote this setting as the HRS setting throughout the paper. An agent in the HRS setting has a positive size associated with it. This agent can be thought of as a group of residents/students, all of whom have the same preference ordering and have to be assigned together in any assignment. Furthermore, assigning an agent of size to a hospital occupies many positions at .
As mentioned in [5, 4], the HRS setting models multiple applications which include refugee settlement and accommodating children in day-cares. In the refugee settlement problem refugee families require multiple units of services (say, hospital beds) from each host locality. The refugee family can be represented as an agent with size proportional to the demand of the family, and the host locality with its service capacity can be represented by a hospital. A similar scenario arises in accommodating children in day-care centres. It can be realised where it is desirable to have siblings in the same day care or every child occupies a certain number of slots in the day care per day. The siblings (or the number of slots needed per child) can be represented by an agent of a given size, and day cares typically have a capacity representing how many children can be accommodated (or available slots). These correspond to hospitals in our setting.
In the presence of sizes for agents, the notion of stability is suitably adapted to take into account agent sizes (see Definition 1 and Definition 2). It is well known that an HRS instance may fail to admit a stable matching. Furthermore, deciding whether an instance of the HRS setting admits a stable matching is NP-hard [9]. Thus, the natural extension of the notion of stability does not offer a practical solution. In the work of McDermid and Manlove [9], which investigated the HRS problem, the authors had defined an alternate notion of stability, which we call occupancy-stable (see Definition 3 and Definition 4). We show that occupancy-stable matching always exists and can be computed efficiently.
As discussed in [9], the rationale behind such an extended definition is as follows: in order to accommodate a better-preferred agent, the hospital may have to displace a set of lower-preferred agents. However, this displacement may create more capacity at the hospital than what is needed for the better-preferred agent. The hospital may prefer being more occupied over getting better-preferred agents. The alternate notion of stability ensures that this requirement is fulfilled. This notion was defined in the concluding remarks in [9] but has not received attention to the best of our knowledge.
In our work, we investigate the stability notion adapted for HRS (henceforth termed as stability) as well as the notion of occupancy-stable matchings. We show that every instance of the HRS admits an occupancy-stable matching, and such a matching can be computed efficiently. We further show that the computation of maximum size occupancy-stable matching is NP-hard. To complement this hardness, we provide an efficient algorithm with an approximation ratio strictly better than for the maximum size occupancy-stable matching in an HRS instance. Furthermore, to circumvent the hardness of the decision version of the stable matching problem for HRS instances, we investigate restricted cases. Master lists in preferences is a well-studied restriction [7] where preferences of agents in a set are derived from a common ranking of the agents of the other side of the bipartition. We show that under a natural generalised master list restriction, every instance of the HRS setting admits a stable matching which can be efficiently computed.
1.1 Notation and problem definition
Let be a bipartite graph, with and . Let denote the set of agents and denote the set of hospitals. An edge indicates that and are mutually acceptable. For each vertex , we let denote the set of acceptable partners of , that is, the set of vertices from the other set that are adjacent to in . Each agent has an integral positive size associated with it, denoted as . Let . Every hospital has an integral positive capacity associated with it, which denotes the maximum total size of agents that it can be assigned to. An agent is called a non-unit sized agent if .
Each agent ranks hospitals in a strict order, denoted as the preference list of . Similarly, each hospital ranks agents in in a strict order, denoted as the preference list of . For any vertex , we say that prefers over iff is before in ’s preference order, and we denote this by (see the example in Fig. 1, discussed later). Let (resp. ) denote the length of the longest preference list of an agent (resp. hospital). We abuse the notation and call the graph along with preferences, sizes and capacities an HRS instance. It is easy to see that the HR instance [6] is a special case of HRS instance with .
A many-to-one matching (called matching here onwards) in is an assignment between agents and their acceptable hospitals such that every agent is matched to at most one hospital and for every hospital , the sum of the sizes of agents matched to is less than or equal to its capacity, that is, . Let denote the hospital matched to agent in matching , and denote the set of agents matched to hospital in matching . We assume that every agent prefers to be matched to one of its acceptable partners over being unmatched. The occupancy of w.r.t. matching is the total size of agents matched to in , denoted by . Thus, .
In an HR instance, an agent-hospital pair is said to block matching , if and they both have an incentive to deviate from and instead, get matched to each other. That is, either is unmatched or , and either or there exists an agent and . A matching is stable if no pair blocks it. The notion of blocking pair and stability can be extended for the HRS setting as follows [9].
Definition 1 (Blocking pair).
Given a matching in an HRS instance , a pair is a blocking pair w.r.t. if and there exists a set of agents , possibly empty, such that for every , and .
The definition implies that an unmatched edge is a blocking pair if is either unmatched or prefers to its current matched partner in , and has sufficient capacity to accommodate by replacing a set of agents that are currently matched to and are lower-preferred over . Note that if is empty, it implies that can accommodate without replacing any agent(s) in .
Definition 2 (Stable matching).
A matching in an HRS instance is stable if there does not exist a blocking pair w.r.t. .
It is well-known that an HR instance always admits a stable matching. The celebrated algorithm by Gale and Shapley efficiently computes a stable matching in an HR instance [6]. In contrast to this, an HRS instance may not admit a stable matching, as illustrated in the following example from [9]. Fig. 1 shows an example instance with and . The preference lists of agents and hospitals are as shown in the Fig. 1. We observe that any matching that leaves unmatched cannot be stable since blocks the matching. Similarly, any matching that leaves unmatched cannot be stable since blocks the matching. Therefore, if a stable matching exists in the instance, it must match both and . Irrespective of where and are matched, the capacity constraint does not allow to be matched. Thus, we consider , and . It is easy to verify that is blocked by , is blocked by and is blocked by . Thus, the instance does not admit a stable matching.
McDermid and Manlove [9] showed that the problem of determining whether an HRS instance admits a stable matching is NP-hard. In light of this, we consider restricted settings of the instance under which the problem becomes tractable. One such restriction that has been investigated is the assumption of master list. The set of agents is said to have a master list ordering on them if there exists an ordering of agents such that every hospital has its preference list derived from that ordering [7]. We propose and investigate the notion of a generalised master list as defined below. Unlike an arbitrary HRS instance which may fail to admit a stable matching, we show that an HRS instance with the generalised master list ordering always admits a stable matching, and it can be computed efficiently.
Generalised master list on agents.
We say that the preference lists of hospitals follow the generalised master list ordering on agents if there exists a partition of such that all agents in have the same size and there exists an ordering on the sets in the partition of such that every hospital prefers its neighbours in over its neighbours in iff . We note that generalised master list ordering does not impose any master list ordering within a fixed set of the partition. We remark that the example in Fig. 1 does not follow a generalised master list since there is no way to partition the three agents satisfying the required properties. Next, we illustrate generalised master lists via an example.
Let and . The agent preferences and the hospital capacities do not matter for the illustration and hence are left unspecified. The preferences of the hospitals, the relationship between the sizes of the agents and a partition of the agent set are shown in Fig. 2. It is noted here that in the example, and could be equal. We also remark that although the generalised master list is defined on all agents in , the individual hospitals may have an incomplete preference list as seen in the example.
It is easy to see that the preferences of hospitals follow the generalised master list ordering on agents because there exists an ordering on the sets in the partition such that every hospital prefers all agents in over if . Since the generalised master list ordering does not impose any ordering within a fixed set , we note that in Fig. 2 both belong to and yet it is acceptable that and . We use generalised master lists in the context of the standard stability notion.
We now turn to an alternative notion of stability, which is a relaxation of the standard notion and is appealing since we show that it ensures guaranteed existence. McDermid and Manlove [9] discuss the following notion of a blocking pair, which is stronger than the one in Definition 1. We term it an occupancy-blocking pair.
Definition 3 (Occupancy-blocking pair).
Given a matching in an HRS instance , a pair is a blocking pair w.r.t. if and there exists a set of agents , possibly empty, such that , and and .
That is, an edge is an occupancy-blocking pair w.r.t. matching if it satisfies Definition 1 and the occupancy of does not reduce by replacing the agents in with agent . When a matching does not admit any occupancy-blocking pair, then is an occupancy-stable matching.
Definition 4 (Occupancy-stable matching).
A matching in an HRS instance is occupancy-stable if there does not exist an occupancy-blocking pair w.r.t. .
It is easy to note that every stable matching in an HRS instance is also occupancy-stable. For the HRS instance in Fig. 1 that does not admit any stable matching, consider the matching . The pair is not an occupancy-blocking pair since , hence is occupancy stable. In this work, we show that every instance of the HRS problem admits an occupancy-stable matching and it can be efficiently computed.
The size of a matching in an HRS instance is the total occupancy across all hospitals. There are simple instances in which different occupancy-stable matchings have different sizes (see the example in Fig. 3). Hence, a natural question is to ask for an occupancy-stable matching which maximises the size. In this work, we show that computing such a matching is NP-hard. We complement it with a constant factor approximation algorithm.
1.2 Our results
We show the following new results for the HRS problem.
Occupancy-stable matchings.
We show that every HRS instance admits an occupancy-stable matching, and such a matching can be efficiently computed. However, the problem of computing a maximum size occupancy-stable matching is NP-hard.
Theorem 5.
An HRS instance always admits an occupancy-stable matching, and it can be computed in time.
Theorem 6.
Given an HRS instance, computing a maximum size occupancy-stable matching is NP-hard, even if the size of each agent and the capacity of each hospital is at most 2, and the lengths of the agents’ and hospitals’ preference lists are at most 4.
On the positive side, we show that there is a strictly better than 3-factor approximation for the maximum size occupancy stable matching problem.
Theorem 7.
Given an HRS instance, an occupancy-stable matching with an approximation guarantee of can be computed in time, where denotes the maximum size of an agent.
Stable matchings.
We show that when the HRS instance admits a generalised master list ordering on agents, a stable matching always exists and it can be efficiently computed.
Theorem 8.
Given an HRS instance with a generalised master list on agents, a stable matching always exists and it can be computed in time.
We note that the following are special cases of the generalised master list setting. Therefore, our algorithmic result applies to them.
-
Master list on agents: Suppose there is a master list ordering on agents as . Let . Then this is a special case of the generalised master list ordering with the ordering .
Suppose that the distinct sizes of agents are , where whenever . Let indicate the set containing all agents with size .
-
All agents with larger size are preferred over all agents with smaller size: This is a special case of the generalised master list ordering with the order
-
All agents with a smaller size are preferred over all agents with a larger size: This is a special case of the generalised master list ordering with the order
Next, we show an alternate hardness result for the decision version of the stable matching problem in HRS instances.
Theorem 9.
For an HRS instance, deciding whether it admits a stable matching is NP-hard even when each agent with non-unit size has exactly one hospital in its preference list.
1.3 Related work
The HRS problem is related to the hospital residents problem with couples, where certain pairs of residents are identified as a couple [9]. The couples are allowed to give individual preferences as well as joint preferences. When the preferences of the couples are consistent, then the restriction is termed as Hospital residents with consistent couples. When couples need to be assigned to the same hospital, then they are called inseparable couples [9]. The HRS problem considered here is a generalisation of hospital residents with consistent and inseparable couples. Our work builds on the work done by McDermid and Manlove [9] where they considered the HRS problem. They showed that determining whether a stable matching exists in an HRS instance is NP-hard, even when each preference list has length at most three and hospital capacities are at most two.
The work of Delacretaz et al. [5] considered a richer model where agents can have multidimensional constraints, which is a vector of demands from multiple services provided by the hospital. In the 2019 work by Delacretaz [4], the author worked with a restricted version of the HRS problem where only two different sized agents are considered. Since deciding whether a stable matching exists is NP-hard, other fairness notions are considered. Delacretaz [4] characterised a stable matching, if one exists, using these fairness notions.
HRS setting is also relevant to job assignment settings where each job has a size or processing time. Dean et al. [3] studied the problem of assigning jobs to machines with preferences, generally known as the “ordinal” assignment problem. The model studied by them is the same as the HRS setting, but their feasible matching definition is relaxed. They allowed a small violation of hospital capacity. They proposed a polynomial-time algorithm that computes an unsplit (integral) job-optimal stable assignment where each machine is over-capacitated by at most the processing time of the least preferred job. In our work, we do not permit capacities to be violated, but instead consider a different notion of stability.
Master lists are motivated by real-world matching problems where the agents involved are ranked based on a common criterion. For example, as mentioned by Irving et al. [7], the Medical Training Application Service (MTAS) employed score-derived master lists with extensive ties for allocating medical posts. Another example is the allocation of students to dormitories at the Technion-Israel Institute of Technology [12], where master lists are used. Our generalised master lists are in a similar spirit. In the domain of solving hard stable matching problems, Meeks et al. [10] consider instances involving groups of similar agents, namely typed instances. In their case, the type of the agent determines how the agent ranks elements in the other set as well as the agent’s preference list. In our case, the agent’s preference list does not depend on the set in the partition that it belongs to.
2 Our algorithm
Let be an HRS instance and let be a partition of of such that all agents in set have the same size. We denote such a partition of agents as a same-sized partition. Note that all agents in a given partition have the same size, however, it is not necessary that all agents of the same size belong to a single partition. We present an algorithm that takes as input such an instance and an ordering on a same-sized partition of and computes a matching. Later, we show the following two independent results:
-
In Section 2.1, we show that a same-sized partition of and an ordering on the sets in that partition exists such that Algorithm 1 computes an occupancy-stable matching. We further show that this matching has an approximation guarantee of strictly better than with respect to the max-size occupancy-stable matching (Theorem 5 and Theorem 7).
Our algorithm iterates over these sets in the given ordering. For a fixed set , it constructs an induced subgraph of agents in the set and all hospitals. We note that the graph enjoys the property that all agents in the set have the same size. Suppose the size of agents in is . The standard Gale and Shapley algorithm [6] that works with unit-sized agents can be adapted to work for uniform sized agents as follows. Agents apply in order of their preference and hospitals accept/reject based on preference. Each time an agent of size is matched to , the hospital subtracts from its available capacity instead of subtracting . When an agent is rejected by a hospital to accept a better preferred agent, there is no change in available capacity since all agents are of the same size. We execute this adapted version of the Gale and Shapley algorithm on to compute a stable matching in . The edges in matching computed in the -th iteration are added to the cumulative union of stable matchings computed till then. That is, . It finally returns the result, that is, . Algorithm 1 gives the pseudo-code.
Let denote the output of Algorithm 1. Before we proceed, we state important observations about our algorithm in the propositions below.
Proposition 10.
The subgraphs are pairwise edge-disjoint.
Proposition 11.
An edge if and only if such that .
Proposition 12.
For every hospital , the occupancy of monotonically increases during the execution of the algorithm, that is, if then .
A stable matching in the subgraph can be computed in time using the adapted Gale and Shapley algorithm described above. Here denotes the set of edges in the graph . Since the graphs in each iteration are pairwise edge-disjoint (Proposition 10), we conclude that the algorithm runs in linear time in the size of .
The agent-proposing adaptation of the Gale and Shapley algorithm used in line 6 of Algorithm 1 is for the sake of concreteness. We remark that in line 6 we can use any stable matching in the graph and the proof of correctness in the following section will go through.
2.1 Occupancy-stable matchings
Let be the given HRS instance. Let denote the distinct sizes of agents in and let . Let denote the set of agents with size . It is clear that is a same-sized partition of . Consider the ordering on the above partition. We note that such a same-sized partition and an ordering can be computed in time where . We execute Algorithm 1 using this ordering imposed in the input instance and show that Algorithm 1 computes an occupancy-stable matching in this case. We note that the partition is only with respect to the sizes and here we do not have any restriction on the preferences of the hospitals with respect to this partition. Recall that we let denote the output of Algorithm 1.
Lemma 13.
The matching computed by Algorithm 1 is occupancy-stable.
Proof.
Suppose, for the sake of contradiction, that is an occupancy-blocking pair w.r.t. . This implies that and one of the following two conditions must hold:
-
(i)
or
-
(ii)
there exists a non-empty set of agents such that for every , and and .
We show that neither of (i) and (ii) holds, thereby leading to a contradiction to the claimed occupancy-blocking pair.
Let . Since is an occupancy-blocking pair, . Therefore, by Proposition 11, . Consider the iteration when . Recall that denotes the occupancy of in matching , that is, denotes the occupancy of after computing the union in line 7. Since , we have . By Proposition 12, , thus, holds at the end of the algorithm. Therefore, (i) does not hold at the end of the algorithm.
Next, we show that (ii) does not hold either. We first consider the case wherein for every agent , . Due to the stability of matching , for all such agents, holds. This leads to a contradiction to the given condition that for every , . Therefore, there must exist an agent such that .
First, suppose that there exists an agent such that . Then, clearly, . This leads to a contradiction to the given condition that . Therefore, for every , . This implies that all such agents are matched to after and were computed.
Since , we have . Therefore, . Adding to both sides, we get . As observed earlier in this proof, , therefore, . This leads to a contradiction to the given condition that . Therefore, (ii) does not hold. This completes the proof.
Before proving the approximation guarantee, we illustrate the execution of Algorithm 1 on an example. Consider the HRS instance shown in Fig. 3. For this instance, is partitioned as such that where contains all agents of size and contains all agents of size . Algorithm 1 computes and , thereby giving the output . The matching is the maximum size occupancy-stable matching in this instance. Thus, for this instance, we get an approximation ratio of . In what follows we prove that Algorithm 1 gives an approximation guarantee of strictly better than .
Approximation guarantee.
We show that the matching computed by Algorithm 1 is a -approximation for the maximum size occupancy-stable matching. Recall that the size of a matching is the total occupancy across all hospitals. Let denote the size of matching . Then .
Recall that denotes the output of Algorithm 1.
Lemma 14.
Let be a maximum size occupancy-stable matching in . Then .
Proof.
We partition the set of agents matched in as follows: let be the set of agents matched in that are matched in as well and be the set of agents matched in but unmatched in . That is,
Clearly, . We note that , therefore . Let denote the set of hospitals such that for some agent , . That is, denotes the set of matched partners in of those agents who are unmatched in . Therefore, .
If for every hospital , , then we get the following, thereby proving the lemma.
| (1) |
The last inequality follows from the fact that . To complete the proof, it remains to show that for every , , which we do next.
By the definition of , there exists at least one agent such that . Moreover, by the definition of , . This implies that during the execution of the algorithm, could not accommodate during the iteration where was computed. By Proposition 12, where . Since could not occupy in , we have . This implies that .
Next observe that at the end of the iteration that computed , at least one agent was matched to . This holds, since otherwise must have been matched to . Moreover, the ordering imposed on the partition of the agents in input instance implies that at that point, if then . Therefore, there exists an agent such that . A simple observation that gives us a -approximation guarantee as follows: substitute in the earlier bound that we established on to get . Then use this bound in Equation 1.
We refine this analysis further to achieve the claimed guarantee of . Using , we get . Since , we write . Therefore, . (See Fig. 4.) Thus, we get
The last inequality follows from the fact that .
This completes the proof.
2.2 Stable matchings under generalised master list
In this section, we consider HRS instances that admit a generalised master list ordering on agents. This implies that there exists a same-sized partition of and an ordering on it such that every hospital prefers its neighbours in over its neighbours in iff . We show that Algorithm 1 outputs a stable matching when such an ordering is given as input.
Lemma 15.
Suppose that admits a generalised master list ordering on agents. When this ordering is given as input, the matching computed by Algorithm 1 is stable.
Proof.
Assume for the sake of contradiction that there is a blocking pair w.r.t. the matching . Suppose that for some . Since blocks , . By Proposition 11, that was computed during the iteration when .
Since blocks , there exists a set such that for every , and . Let . Since , we have . Moreover, due to the stability of and due to the assumption that the input admits a generalised master list ordering on agents, prefers all agents matched to it in over . Therefore, all agents in must be matched to after the iteration as they are lower-preferred by over . To complete the proof, we need to show that even if we unmatch all agents in , cannot accommodate the agent , thereby getting a contradiction to the claimed blocking pair.
By Proposition 12, . In fact, since all agents in are matched to after was computed, we have . Thus, . Substituting , we get . Hence, , leading to contradiction that .
3 NP-hardness of max-size occupancy-stable matching
In this section, we present a polynomial-time reduction to establish NP-hardness of the problem of deciding whether an -perfect occupancy-stable matching exists in an HRS instance, thereby proving Theorem 6. An -perfect occupancy-stable matching is an occupancy-stable matching that matches all agents.
The Stable Marriage problem with Incomplete lists (SMI) is the restriction of the HR problem where capacities of all hospitals are one. Conventionally, the two sets in the Stable Marriage problem are denoted as men and women instead of agents and hospitals. The Stable Marriage problem with Ties and Incomplete lists (SMTI) is a generalisation of SMI in which preference lists can have ties. The definition of a blocking pair is suitably adapted for tied instances. A pair that is not assigned to each other in a matching blocks if both and strictly prefer each other to their current partners in . A matching in an SMTI instance is stable if there is no blocking pair with respect to .
Consider a restricted instance of SMTI with an equal number of men and women, in which every woman’s preference list is a strict list of length at most three; and each man’s preference list is either a strict list of length exactly three or is a single tie of length two. The goal is to decide whether there exists a complete stable matching in such a restricted SMTI instance. This is the -COM-SMTI problem, which is known to be NP-hard [9].
Consider a -COM-SMTI instance , with men and women . We construct an HRS instance from as follows. For each woman we have one hospital with capacity . For each man in with a preference list which is a tie of length two, say where , we create a gadget consisting of agents where and have size and rest have size ; and hospitals with capacities . See Fig. 5 (i) and (ii). For each man with a strict preference list in , we create a gadget containing two agents with size two and one respectively and one hospital with capacity . See Fig. 5 (iii) and (iv). This completes the description of agents and hospitals in . Now we describe the preference lists.
-
Preference list of hospital corresponding to woman : Let the preference list of be . We start with preference list of to be set as . For , the man in either has a strict preference list in or has a single tie of length two.
-
–
If has a strict preference list in , then we denote the man as and replace in by the corresponding agent .
-
–
If has a tie in its preference list, then we denote the man as and denote the preference list of as in . If , replace with in , else with .
This gives us , which is the preference list of hospital .
-
–
-
Preference list of vertices in the gadget corresponding to man with a tie: Recall that the preference list of is a tie of length two, namely where . The preferences of the agents and hospitals in the gadget corresponding to are shown in Fig. 5(i) and (ii). Note that the hospitals and corresponding to and appear only in the preferences of and , respectively.
-
Preference list of vertices in the gadget corresponding to man with strict preference list: Let the preference list of be . The preference list of the agent has the corresponding hospitals followed by the gadget hospital . See Fig. 5(iii) and (iv) for the preferences of the vertices in the gadget corresponding to .
(i)
(ii)
(iii)
(iv)
This completes the description of the reduction. Next, we prove its correctness.
Lemma 16.
In any occupancy-stable matching of , either are matched to the same hospital or both are unmatched.
Proof.
Assume is matched to and is not in the occupancy-stable matching . Then, blocks , contradicting the assumption that is -perfect. Say, is matched to , and is not in an occupancy-stable matching . Since has positions to accommodate and is ’s first choice, would block .
Lemma 17.
In any -perfect occupancy-stable matching of , exactly one of is matched to their first choice.
Proof.
Assume both are matched to their first choice in . Then, are unmatched in , contradicting the assumption that is -perfect. Now, assume both are not matched to their first choice. By Lemma 16, without loss of generality, assume both and are matched to . Then, blocks , as has the capacity to accommodate , contradicting the assumption that is occupancy-stable.
Lemma 18.
In any -perfect occupancy-stable matching of , none of the agents in are matched to their last choice hospital.
Proof.
Since is -perfect, all are matched to some hospital. By Lemma 17, without loss of generality, say is matched to . Assume is matched to its last choice . Then remains unmatched in , contradicting the assumption that is -perfect. Similarly, cannot be matched to .
Lemma 19.
If admits a complete stable matching , then admits an -perfect occupancy-stable matching .
Proof.
Given a complete stable matching , we describe below how to construct an -perfect occupancy-stable matching starting with an empty set. We need the following two sets to be defined.
-
For a man with ties in his preference list where .
-
For a man with strict preference list in . If , then
Note that, is feasible and -perfect. To prove that is occupancy-stable by contradiction, assume there exists a blocking pair with respect to . Without loss of generality, assume . Then, will not be part of a blocking pair as they are matched to their first choice. Edge will not block as doesn’t have enough capacity to accommodate without unmatching higher preferred agents. Edge will not block as is full with higher preferred agents. If an edge blocks , where corresponds to a man with strict preference, the respective would be blocking , contradicting the assumption.
Lemma 20.
If admits an -perfect occupancy-stable matching , then admits a complete stable matching .
Proof.
Given , construct as follows. Let .
-
For any such that is a man with ties in his preference list,
-
For any such that is a man with strict preference list.
By Lemma 18, exactly one of is matched to its top choice and other to its second choice, so there is no scenario where both are matched. Note that the sizes of agents and capacities of hospitals are set such that every hospital that corresponds to women has almost one match. Hence, is feasible. By Lemma 18, every man that has ties is matched to either or . Similarly, every man with a strict preference list is matched to a woman by construction. Since all men with ties in their preference list are matched, they do not block . Suppose that there exists a man-woman pair which blocks where is a man with a strict preference list. Then the corresponding blocks in . Therefore, is stable in .
Note that, deciding the existence of an –perfect occupancy-stable matching is the same as deciding the existence of an occupancy-stable matching of size , where are are the number of men with ties in their preference list and number of men with strict preference list. Hence, Lemma 19 and Lemma 20 together establish Theorem 6.
4 NP-hardness for stable matchings in HRS
In this section, we establish the NP-hardness of the decision version of the stable matching problem. Our reduction shows that the problem remains hard even when all non-unit sized agents have degree . This reduction is also from -COM-SMTI. Consider a -COM-SMTI instance , with men and women . We construct an HRS instance from as follows. For each woman we have one hospital with capacity . For each man in with a preference list which is a tie of length two say where , we create a gadget consisting of twelve agents and eight hospitals as follows. See Fig. 6(i) and (ii).
-
Agents where have unit size whereas have size .
-
For each we have three agents where have unit size and has size .
-
Two hospitals and each with capacity .
-
For each , we have three hospitals where has capacity and the remaining hospitals have capacity .
For each man with a strict preference list in , we create a gadget containing agent and hospitals hospital. See Fig. 6 (iii) and (iv).
-
A unit sized agent .
-
Three agents where has size and remaining agents are unit sized.
-
Three hospitals where has capacity and the remaining hospitals have capacity .
This completes the description of the agents and hospitals in . Now we describe the preference lists.
-
Preference list for hospital corresponding to woman : Let the preference list of be . We start with preference list of to be set as . For the man in either has a strict preference list in or has a single tie of length two.
-
–
If has a strict preference list, then we denote the man as and replace in by the corresponding agent .
-
–
If has a tie in its preference list, then we denote the man as and denote the preference list of as . If , replace with in , else with .
This gives us which is the preference list of hospital .
-
–
-
Preference lists of the vertices in the gadget corresponding to man with a tie: Recall that the preference list of is a tie of length two, namely where . The preferences of the agents and hospitals in the gadget corresponding to are shown in Fig. 6(i) and (ii). Note that the hospitals and corresponding to and appear only in the preferences of and respectively.
-
Preference lists of the vertices in the gadget corresponding to man with strict preference list: Let the preference list of be . Then the preference list of the agent has the corresponding hospitals followed by the gadget hospital . See Fig. 6(iii) and (iv) for the preferences of vertices in the gadget corresponding to .
(i)
(ii)
(iii)
(iv)
This completes the description of the reduction. We prove the correctness below.
Lemma 21.
Let be a man with a tie in his preference list in , and let . If admits a stable matching , leaves unmatched. Furthermore, cannot leave unmatched.
Proof.
Assume there exists as above such that . Hence the hospital will be removed from ’s preference list. Now, the subgraph induced by is exactly the instance in Fig. 1 except the sizes being instead of and thus doesn’t admit a stable matching. The second statement of the lemma follows from the fact that if is unmatched in then blocks . Using similar arguments as above, we get the following lemma.
Lemma 22.
Let be a man with a strict preference list in . Then, any matching in containing is not stable. Furthermore, cannot leave unmatched.
The following two lemmas (proofs in the Appendix) establish the correctness of the reduction.
Lemma 23.
Let be such that is a man with a tie in his preference list in . If admits a stable matching then one of the following holds. Either or , where and
Lemma 24.
The instance admits a complete stable matching if and only if the reduced HRS instance admits a stable matching.
Discussion.
In this paper we consider the HRS problem with a focus on the occupancy-stable matchings. We prove that computing max-sized occupancy-stable matching is NP-hard. Our algorithm gives an approximation guarantee of strictly better than for the max-size occupancy-stable matching. A natural direction is to improve the approximation guarantee and establish the hardness of approximation.
References
- [1] Atila Abdulkadiroğlu and Tayfun Sönmez. School Choice: A Mechanism Design Approach. American Economic Review, 93(3):729–747, 2003. doi:10.1257/000282803322157061.
- [2] Surender Baswana, Partha Chakrabarti, Sharat Chandran, Yash Kanoria, and Utkarsh Patange. Centralized admissions for engineering colleges in india. INFORMS Journal on Applied Analytics, 49(5):338–354, 2019. doi:10.1287/inte.2019.1007.
- [3] Brian C. Dean, Michel X. Goemans, and Nicole Immorlica. The unsplittable stable marriage problem. In Fourth IFIP International Conference on Theoretical Computer Science- TCS 2006, pages 65–75, 2006. doi:10.1007/978-0-387-34735-6_9.
- [4] David Delacrétaz. Stability in matching markets with sizes. Accessed: 2025-05-05, 2017. URL: https://daviddelacretaz.net/wp-content/uploads/2019/01/DDelacretaz-SMMS-Jan19.pdf.
- [5] David Delacrétaz, Scott Duke Kominers, and Alexander Teytelboym. Matching mechanisms for refugee resettlement. American Economic Review, 113(10):2689–2717, October 2023. doi:10.1257/aer.20210096.
- [6] D. Gale and L. S. Shapley. College admissions and the stability of marriage. The American Mathematical Monthly, 69(1):9–15, 1962. URL: http://www.jstor.org/stable/2312726.
- [7] Robert W. Irving, David F. Manlove, and Sandy Scott. The stable marriage problem with master preference lists. Discrete Applied Mathematics, 156(15):2959–2977, 2008. doi:10.1016/j.dam.2008.01.002.
- [8] Joint Seat Allocation Authority (JoSAA). Josaa - joint seat allocation authority official website. https://josaa.nic.in/, 2025. Accessed: 2025-05-23.
- [9] Eric J. McDermid and David F. Manlove. Keeping partners together: algorithmic results for the hospitals/residents problem with couples. Journal of Combinatorial Optimization, 19(3):279–303, 2010. doi:10.1007/s10878-009-9257-2.
- [10] Kitty Meeks and Baharak Rastegari. Solving hard stable matching problems involving groups of similar agents. Theoretical Computer Science, 844:171–194, 2020. doi:10.1016/j.tcs.2020.08.017.
- [11] National Resident Matching Program. National resident matching program website. https://www.nrmp.org, 2023. Accessed: 2025-05-23.
- [12] Nitsan Perach, Julia Polak, and Uriel G Rothblum. A stable matching model with an entrance criterion applied to the assignment of students to dormitories at the technion. International Journal of Game Theory, 36:519–535, 2008. doi:10.1007/s00182-007-0083-4.
- [13] Alvin E. Roth. On the Allocation of Residents to Rural Hospitals: A General Property of Two-Sided Matching Markets. Econometrica, 54(2):425–427, 1986. URL: http://www.jstor.org/stable/1913160.
Appendix A Omitted proofs
Proof of Lemma 23.
Since is stable, from Lemma 21 the agent should be matched to one of . We divide the proof based on the matched partner of in .
-
Assume . Here we establish that . In this case for to be stable, the hospital has to be fully subscribed in with agents higher preferred than . This implies that . In this case the agent cannot be left unmatched otherwise blocks . Thus, . Since , . The hospital is matched to and therefore cannot accommodate . The matching cannot leave unmatched, else blocks . This implies that . Given the current set of edges in , if does not match to , then blocks . Thus . Thus we have proved that if then .
-
Assume . Here, we establish that . Since occupies unit capacity in , cannot occupy . Hence, . Furthermore, else blocks . If is not matched to , blocks . Therefore, . Given the current set of edges in , if is not matched to then block . So, . From Lemma 21 cannot be unmatched and cannot accommodate . Therefore, . This concludes that .
This completes the proof.
Proof of Lemma 24.
Consider a complete stable matching of . Let be the reduced HRS instance of . Construct a matching as follows, starting with .
-
For a man with ties in his preference list where .
Furthermore for the man , we add .
-
For a man with strict preference list in
It can be verified that is feasible in . From Lemma 23, is stable.
To prove the other direction, consider a stable matching of . Construct a matching in as follows.
-
For any such that is a man with ties in his preference list,
-
For any such that is a man with strict preference list.
Since the capacity of is , the corresponding woman in is also matched to at most one man. Every corresponding to agent with ties in his preference list will either be matched to or , so is to or in . By Lemma 22, has to be matched to one of hospital in in . So, all men with a strict preference list in are matched to some woman in . Therefore, is feasible and complete in . Since all men with ties in their preference list are matched, they do not block . Say, there exists a man-woman pair which blocks where is a man with a strict preference list. Then corresponding blocks in . Therefore, is stable in .
