Abstract 1 Introduction 2 Our algorithm 3 NP-hardness of max-size occupancy-stable matching 4 NP-hardness for stable matchings in HRS References Appendix A Omitted proofs

Stability Notions for Hospital Residents with Sizes

Haricharan Balasundaram ORCID Indian Institute of Technology Madras, Chennai, India J. B. Krishnashree111Corresponding author. 222Part of this work was done during a semester-long project at IIT Madras, when the author was pursuing Integrated M.Sc., at PSG College of Technology, Coimbatore. ORCID Tata Institute of Fundamental Research Mumbai, India Girija Limaye333Part of this work was done when the author was a faculty at FLAME University, Pune. ORCID Birla Institute of Technology and Science, Pilani, K K Birla Goa Campus, India Meghana Nasre ORCID Indian Institute of Technology Madras, Chennai, India
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 a has a size s(a) and the agent occupies s(a) many positions of the hospital h when assigned to h. 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 3 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-hardness
Copyright and License:
[Uncaptioned image] © Haricharan Balasundaram, J. B. Krishnashree, Girija Limaye, and Meghana Nasre; licensed under Creative Commons License CC-BY 4.0
2012 ACM Subject Classification:
Theory of computation Design and analysis of algorithms
Acknowledgements:
We thank the anonymous reviewers for their comments that significantly improved the presentation of the paper.
Editors:
C. Aiswarya, Ruta Mehta, and Subhajit Roy

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 a in the HRS setting has a positive size s(a) 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 a of size s(a) to a hospital h occupies s(a) many positions at h.

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 3 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 G=(𝒜,E) be a bipartite graph, with n=|𝒜| and m=|E(G)|. Let 𝒜 denote the set of agents and denote the set of hospitals. An edge (a,h)E indicates that a and h are mutually acceptable. For each vertex v𝒜, we let 𝒩(v) denote the set of acceptable partners of v, that is, the set of vertices from the other set that are adjacent to v in G. Each agent a 𝒜 has an integral positive size associated with it, denoted as s(a). Let smax=maxa𝒜s(a). Every hospital h has an integral positive capacity q(h) associated with it, which denotes the maximum total size of agents that it can be assigned to. An agent a is called a non-unit sized agent if s(a)>1.

Each agent a ranks hospitals 𝒩(a) in a strict order, denoted as the preference list of a. Similarly, each hospital h ranks agents in 𝒩(h) in a strict order, denoted as the preference list of h. For any vertex v𝒜, we say that v prefers x over y iff x is before y in v’s preference order, and we denote this by xvy (see the example in Fig. 1, discussed later). Let a (resp. h) denote the length of the longest preference list of an agent (resp. hospital). We abuse the notation and call the graph G=(𝒜,E) 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 smax=1.

A many-to-one matching (called matching here onwards) in G is an assignment between agents and their acceptable hospitals such that every agent is matched to at most one hospital and for every hospital h, the sum of the sizes of agents matched to h is less than or equal to its capacity, that is, q(h). Let M(a) denote the hospital matched to agent a in matching M, and M(h) denote the set of agents matched to hospital h in matching M. We assume that every agent prefers to be matched to one of its acceptable partners over being unmatched. The occupancy of h w.r.t. matching M is the total size of agents matched to h in M, denoted by OM(h). Thus, OM(h)=aM(h)s(a).

In an HR instance, an agent-hospital pair (a,h) is said to block matching M, if (a,h)M and they both have an incentive to deviate from M and instead, get matched to each other. That is, either a is unmatched or haM(a), and either OM(h)<q(h) or there exists an agent aM(h) and aha. A matching M 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 M in an HRS instance G, a pair (a,h)EM is a blocking pair w.r.t. M if haM(a) and there exists a set of agents XM(h), possibly empty, such that for every aX, aha and OM(h)aXs(a)+s(a)q(h).

The definition implies that an unmatched edge (a,h) is a blocking pair if a is either unmatched or prefers h to its current matched partner in M, and h has sufficient capacity to accommodate a by replacing a set X of agents that are currently matched to h and are lower-preferred over a. Note that if X is empty, it implies that h can accommodate a without replacing any agent(s) in M(h).

Definition 2 (Stable matching).

A matching M in an HRS instance G is stable if there does not exist a blocking pair w.r.t. M.

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 𝒜={a1,a2,a3} and ={h1,h2}. The preference lists of agents and hospitals are as shown in the Fig. 1. We observe that any matching that leaves a1 unmatched cannot be stable since (a1,h1) blocks the matching. Similarly, any matching that leaves a2 unmatched cannot be stable since (a2,h2) blocks the matching. Therefore, if a stable matching exists in the instance, it must match both a1 and a2. Irrespective of where a1 and a2 are matched, the capacity constraint does not allow a3 to be matched. Thus, we consider M={(a1,h2),(a2,h2)}, M={(a1,h2),(a2,h1)} and M′′={(a1,h1),(a2,h2)}. It is easy to verify that M is blocked by (a2,h1), M is blocked by (a3,h2) and M′′ is blocked by (a1,h2). Thus, the instance does not admit a stable matching.

(1)a1 :h2h1 (1)a2 :h1h2 (2)a3 :h2
[1]h1 :a1a2 [2]h2 :a2a3a1
Figure 1: HRS instance that does not admit a stable matching. The number preceding the agent shows the size of the agent, whereas the number preceding the hospital denotes the hospital capacity. For example, s(a3)=2 and q(h2)=2. The preference list of an agent or a hospital is as shown. For example, hospital h2 prefers agent a2, followed by agent a3, followed by agent a1.

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 {𝒜t1,𝒜t2,,𝒜tf} of 𝒜 such that all agents in 𝒜ti have the same size and there exists an ordering 𝒜t1,𝒜t2,,𝒜tf on the sets in the partition of 𝒜 such that every hospital h prefers its neighbours in 𝒜ti over its neighbours in 𝒜tj iff i<j. We note that generalised master list ordering does not impose any master list ordering within a fixed set 𝒜ti 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 𝒜={a1,a2,a3,a4,a5} and ={h1,h2,h3}. 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, s(a1) and s(a4) 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.

h1 :a2a1a4 h2 :a1a2a3 h3 :a5a4
Figure 2: Illustration of generalised master lists. Assume that s(a1)=s(a2)s(a3) and s(a4)=s(a5)s(a3). Let 𝒜={𝒜t1,𝒜t2,𝒜t3} where 𝒜t1={a1,a2},𝒜t2={a3},𝒜t3={a4,a5}.

It is easy to see that the preferences of hospitals follow the generalised master list ordering on agents because there exists an ordering 𝒜t1,𝒜t2,𝒜t3 on the sets in the partition such that every hospital h prefers all agents in 𝒜ti𝒩(h) over 𝒜tj𝒩(h) if i<j. Since the generalised master list ordering does not impose any ordering within a fixed set 𝒜ti, we note that in Fig. 2 both a1,a2 belong to 𝒜t1 and yet it is acceptable that a2h1a1 and a1h2a2. 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 M in an HRS instance G, a pair (a,h)EM is a blocking pair w.r.t. M if haM(a) and there exists a set of agents XM(h), possibly empty, such that aX, aha and OM(h)aXs(a)+s(a)q(h) and s(a)aXs(a).

That is, an edge (a,h) is an occupancy-blocking pair w.r.t. matching M if it satisfies Definition 1 and the occupancy of h does not reduce by replacing the agents in X with agent a. When a matching M does not admit any occupancy-blocking pair, then M is an occupancy-stable matching.

Definition 4 (Occupancy-stable matching).

A matching M in an HRS instance G is occupancy-stable if there does not exist an occupancy-blocking pair w.r.t. M.

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 N={(a1,h1),(a3,h2)}. The pair (a2,h2) is not an occupancy-blocking pair since s(a3)>s(a2), hence N 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 O(m+nlogn) 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 (31smax) can be computed in O(m+nlogn) time, where smax 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 O(m+n) 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 a1a2a3. Let 𝒜ti={ai}. Then this is a special case of the generalised master list ordering with the ordering 𝒜t1,𝒜t2,𝒜t3,.

Suppose that the distinct sizes of agents are {s1,s2,,smax}, where si<sj whenever i<j. Let 𝒜si indicate the set containing all agents with size si.

  • 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 𝒜t1=𝒜smax,,𝒜tf=𝒜s1

  • 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 𝒜t1=𝒜s1,,𝒜tf=𝒜smax

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.

As noted earlier, the NP-hardness proved in [9] holds even when the agents have degree at most 3 and non-unit sized agents have size 2. In our reduction, we have non-unit sized agents with degree only 1, whereas in [9] non-unit sized agents have degree 3.

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 G be an HRS instance and let {𝒜t1,,𝒜tf} be a partition of 𝒜 of G such that all agents in set 𝒜ti 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 G and an ordering on a same-sized partition of G 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 3 with respect to the max-size occupancy-stable matching (Theorem 5 and Theorem 7).

  • In Section 2.2 we assume that G admits a generalised master list ordering on agents. That is, there exists a same-sized partition of agents and an ordering on the sets of this partition. With this ordering as input, Algorithm 1 computes a stable matching (Theorem 8).

Our algorithm iterates over these sets in the given ordering. For a fixed set 𝒜tk, it constructs an induced subgraph Gk of agents in the set 𝒜tk and all hospitals. We note that the graph Gk enjoys the property that all agents in the set 𝒜tk have the same size. Suppose the size of agents in Gk is s. 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 s is matched to h, the hospital h subtracts s from its available capacity instead of subtracting 1. 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 Gk to compute a stable matching Mk in Gk. The edges in matching Mk computed in the k-th iteration are added to the cumulative union of stable matchings computed till then. That is, M(tk)=r=1kMr. It finally returns the result, that is, M(tf). Algorithm 1 gives the pseudo-code.

Algorithm 1 Algorithm for HRS with an ordered partition of agents.

Let M=M(tf) denote the output of Algorithm 1. Before we proceed, we state important observations about our algorithm in the propositions below.

Proposition 10.

The subgraphs Gk are pairwise edge-disjoint.

Proposition 11.

An edge (a,h)M if and only if (a,h)Mk such that a𝒜tk.

Proposition 12.

For every hospital h, the occupancy of h monotonically increases during the execution of the algorithm, that is, if ij then OM(ti)(h)OM(tj)(h).

A stable matching in the subgraph Gk can be computed in O(|Ek|) time using the adapted Gale and Shapley algorithm described above. Here Ek denotes the set of edges in the graph Gk. 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 G.

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 Gk and the proof of correctness in the following section will go through.

2.1 Occupancy-stable matchings

Let G be the given HRS instance. Let s1,s2,,sk denote the distinct sizes of agents in G and let s1>s2>>sk1. Let 𝒜si denote the set of agents with size si. It is clear that {𝒜s1,,𝒜sk} is a same-sized partition of 𝒜. Consider the ordering 𝒜s1,,𝒜sk on the above partition. We note that such a same-sized partition and an ordering can be computed in O(nlogn) time where n=|𝒜|. 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 M=M(tf) denote the output of Algorithm 1.

Lemma 13.

The matching M computed by Algorithm 1 is occupancy-stable.

Proof.

Suppose, for the sake of contradiction, that (a,h) is an occupancy-blocking pair w.r.t. M. This implies that haM(a) and one of the following two conditions must hold:

  1. (i)

    OM(h)+s(a)q(h) or

  2. (ii)

    there exists a non-empty set of agents XM(h) such that for every aX, aha and s(a)aXs(a) and OM(h)aXs(a)+s(a)q(h).

We show that neither of (i) and (ii) holds, thereby leading to a contradiction to the claimed occupancy-blocking pair.

Let sa=s(a). Since (a,h) is an occupancy-blocking pair, (a,h)M. Therefore, by Proposition 11, (a,h)Msa. Consider the iteration when k=sa. Recall that OM(tk)(h) denotes the occupancy of h in matching M(tk), that is, OM(tk)(h) denotes the occupancy of h after computing the union in line 7. Since (a,h)Msa, we have OM(tk)(h)+s(a)>q(h). By Proposition 12, OM(h)=OM(tf)(h)OM(tk)(h), thus, OM(h)+s(a)>q(h) 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 aX, s(a)=sa. Due to the stability of matching Msa, for all such agents, aha holds. This leads to a contradiction to the given condition that for every aX, aha. Therefore, there must exist an agent aX such that s(a)s(a).

First, suppose that there exists an agent bX such that s(b)>s(a). Then, clearly, aXs(a)s(b)>s(a). This leads to a contradiction to the given condition that s(a)aXs(a). Therefore, for every aX, s(a)<s(a). This implies that all such agents a are matched to h after Msa and M(tk) were computed.

Since XM, we have OM(tk)(h)+aXs(a)OM(h). Therefore, OM(h)aXs(a)OM(tk)(h). Adding s(a) to both sides, we get OM(h)aXs(a)+s(a)OM(tk)(h)+s(a). As observed earlier in this proof, OM(tk)(h)+s(a)>q(h), therefore, OM(h)aXs(a)+s(a)>q(h). This leads to a contradiction to the given condition that OM(h)aXs(a)+s(a)q(h). 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 {𝒜t1,𝒜t2} such that 𝒜t1={a1},𝒜t2={a2,a3} where 𝒜t1 contains all agents of size 3 and 𝒜t2 contains all agents of size 2. Algorithm 1 computes M1={(a1,h1)} and M2=, thereby giving the output M=M(t2)={(a1,h1)}. The matching M={(a1,h2),(a2,h1),(a3,h1)} is the maximum size occupancy-stable matching in this instance. Thus, for this instance, we get an approximation ratio of s(M)s(M)=73<3. In what follows we prove that Algorithm 1 gives an approximation guarantee of strictly better than 3.

(3)a1 :h1h2 (2)a2 :h1 (2)a3 :h1
[4]h1 :a2a3a1 [3]h2 :a1
Figure 3: Example of HRS instance used to illustrate the execution of Algorithm 1.

Approximation guarantee.

We show that the matching M computed by Algorithm 1 is a (31smax)-approximation for the maximum size occupancy-stable matching. Recall that the size of a matching is the total occupancy across all hospitals. Let s(N) denote the size of matching N. Then s(N)=hON(h)=a𝒜,N(a)s(a).

Recall that M denotes the output of Algorithm 1.

Lemma 14.

Let M be a maximum size occupancy-stable matching in G. Then s(M)s(M)(31smax).

Proof.

We partition the set of agents matched in M as follows: let X be the set of agents matched in M that are matched in M as well and Y be the set of agents matched in M but unmatched in M. That is,

  • X={aM(a) and M(a)}

  • Y={aM(a)= and M(a)}

Clearly, s(M)=aXs(a)+aYs(a). We note that aXs(a)s(M), therefore s(M)s(M)+aYs(a). Let N(Y) denote the set of hospitals h such that for some agent aY, M(a)=h. That is, N(Y) denotes the set of matched partners in M of those agents who are unmatched in M. Therefore, aYs(a)hN(Y)q(h).

If for every hospital hN(Y), q(h)OM(h)(21smax), then we get the following, thereby proving the lemma.

s(M)s(M)+aYs(a)s(M)+hN(Y)q(h)s(M)+hN(Y)OM(h)(21smax)s(M)(31smax). (1)

The last inequality follows from the fact that hN(Y)OM(h)s(M). To complete the proof, it remains to show that for every hN(Y), q(h)OM(h)(21smax), which we do next.

By the definition of N(Y), there exists at least one agent aY such that M(a)=h. Moreover, by the definition of Y, M(a)=. This implies that during the execution of the algorithm, h could not accommodate a during the iteration where Ms(a) was computed. By Proposition 12, OM(h)OM(tk)(h) where a𝒜tk. Since h could not occupy a in Ms(a)M(tk), we have s(a)>q(h)OM(tk)(h)q(h)OM(h). This implies that q(h)<s(a)+OM(h).

Next observe that at the end of the iteration that computed Ms(a), at least one agent was matched to h. This holds, since otherwise h must have been matched to a. Moreover, the ordering imposed on the partition of the agents in input instance G implies that at that point, if cM(h) then s(c)s(a). Therefore, there exists an agent cM(h) such that s(c)s(a). A simple observation that OM(h)s(c) gives us a 3-approximation guarantee as follows: substitute s(a)s(c)OM(h) in the earlier bound that we established on q(h) to get q(h)<2OM(h). Then use this bound in Equation 1.

We refine this analysis further to achieve the claimed guarantee of (31smax). Using s(c)s(a), we get q(h)<s(c)+OM(h)s(c)1+OM(h). Since cM(h), we write OM(h)=s(c)+D. Therefore, q(h)D+2s(c)1. (See Fig. 4.) Thus, we get

q(h)OM(h)D+2s(c)1D+s(c)2s(c)1s(c)=21s(c)21smax

The last inequality follows from the fact that s(c)smax.

Figure 4: Relation between OM(h) and q(h) in terms of D and s(c).

This completes the proof.

Recall that computing an ordering on the same-sized partition takes O(nlogn) time, and Algorithm 1 runs in O(m+n) time. These facts along with Lemma 13 establish Theorem 5. Moreover, Lemma 14 establishes Theorem 7.

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 𝒜t1,𝒜t2,𝒜t3, of 𝒜 and an ordering on it such that every hospital h prefers its neighbours in 𝒜ti over its neighbours in 𝒜tj iff i<j. We show that Algorithm 1 outputs a stable matching when such an ordering is given as input.

Lemma 15.

Suppose that G admits a generalised master list ordering on agents. When this ordering is given as input, the matching M computed by Algorithm 1 is stable.

Proof.

Assume for the sake of contradiction that there is a blocking pair (a,h) w.r.t. the matching M. Suppose that a𝒜ti for some i. Since (a,h) blocks M, (a,h)M. By Proposition 11, (a,h)Mti that was computed during the iteration when k=i.

Since (a,h) blocks M, there exists a set XM(h) such that for every aX, aha and OM(h)aXs(a)+s(a)q(h). Let s(X)=aXs(a). Since (a,h)Mti, we have OM(ti)(h)+s(a)>q(h). Moreover, due to the stability of Mti and due to the assumption that the input admits a generalised master list ordering on agents, h prefers all agents matched to it in M(ti) over a. Therefore, all agents in X must be matched to h after the ith iteration as they are lower-preferred by h over a. To complete the proof, we need to show that even if we unmatch all agents in X, h cannot accommodate the agent a, thereby getting a contradiction to the claimed blocking pair.

By Proposition 12, OM(h)OM(ti)(h). In fact, since all agents in X are matched to h after M(ti) was computed, we have OM(h)OM(ti)(h)+s(X). Thus, OM(h)s(X)OM(ti)(h). Substituting OM(ti)(h)>q(h)s(a), we get OM(h)s(X)>q(h)s(a). Hence, OM(h)s(X)+s(a)>q(h), leading to contradiction that OM(h)s(X)+s(a)q(h).

We assume that the ordering on the partitions implied by the generalised master list is part of the input instance G. This assumption, together with the fact that Algorithm 1 runs in O(m+n) time establish Theorem 8.

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 (m,w) that is not assigned to each other in a matching M blocks M if both m and w strictly prefer each other to their current partners in M. A matching M in an SMTI instance is stable if there is no blocking pair with respect to M.

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 (3,3)-COM-SMTI problem, which is known to be NP-hard [9].

Consider a (3,3)-COM-SMTI instance I, with n men {m1,m2,,mn} and n women {w1,w2,,wn}. We construct an HRS instance G=(𝒜,E) from I as follows. For each woman wi we have one hospital hi with capacity 2. For each man mj in I with a preference list which is a tie of length two, say (wa,wb) where a<b, we create a gadget consisting of 6 agents {aj1,aj2,aj3,aj4,aj,α1,aj,α2} where aj1 and aj2 have size 2 and rest have size 1; and 4 hospitals {hj1,hj2,hj,α1,hj,α2} with capacities 2. See Fig. 5 (i) and (ii). For each man ms with a strict preference list in I, we create a gadget containing two agents as,as,β with size two and one respectively and one hospital hs,β with capacity 2. See Fig. 5 (iii) and (iv). This completes the description of agents and hospitals in G. Now we describe the preference lists.

  • Preference list of hospital hi corresponding to woman wi: Let the preference list of wi be lwi. We start with preference list of hi to be set as lhi=lwi. For 1t|lwi|, the man mit in lwi either has a strict preference list in I or has a single tie of length two.

    • If mit has a strict preference list in I, then we denote the man as ms and replace ms in lhi by the corresponding agent as.

    • If mit has a tie in its preference list, then we denote the man as mj and denote the preference list of mj as (wi,wb) in I. If i<b, replace mj with aj1 in lhi, else with aj2.

    This gives us lhi, which is the preference list of hospital hi.

  • Preference list of vertices in the gadget corresponding to man mj with a tie: Recall that the preference list of mj is a tie of length two, namely (wa,wb) where a<b. The preferences of the agents and hospitals in the gadget corresponding to mj are shown in Fig. 5(i) and (ii). Note that the hospitals ha and hb corresponding to wa and wb appear only in the preferences of aj1 and aj2, respectively.

  • Preference list of vertices in the gadget corresponding to man ms with strict preference list: Let the preference list of ms be we,wf,wg. The preference list of the agent as has the corresponding hospitals followed by the gadget hospital as,β. See Fig. 5(iii) and (iv) for the preferences of the vertices in the gadget corresponding to ms.

(2)aj1: hj1hahj,α1
(2)aj2: hj2hbhj,α2
(1)aj3: hj1hj2
(1)aj4: hj2hj1
(1)aj,α1: hj,α1
(1)aj,α2: hj,α2

(i)

[2]hj1: aj4aj1aj3
[2]hj2: aj3aj2aj4
[2]hj,α1: aj,α1aj1
[2]hj,α2: aj,α2aj2

(ii)

(2)as: hehfhghs,β
(1)as,β: hs,β

(iii)

[2]hs,β: as,βas

(iv)

Figure 5: Agents and hospitals corresponding to a man in the SMTI instance.

This completes the description of the reduction. Next, we prove its correctness.

Lemma 16.

In any occupancy-stable matching M of G, either {aj3,aj4} are matched to the same hospital or both are unmatched.

Proof.

Assume aj3 is matched to hj1 and aj4 is not in the occupancy-stable matching M. Then, (aj1,hj1) blocks M, contradicting the assumption that M is 𝒜-perfect. Say, aj3 is matched to hj2, and aj4 is not in an occupancy-stable matching M. Since hj2 has positions to accommodate aj4 and hj2 is aj4’s first choice, (aj4,hj2) would block M.

Lemma 17.

In any 𝒜-perfect occupancy-stable matching M of G, exactly one of {aj1,aj2} is matched to their first choice.

Proof.

Assume both {aj1,aj2} are matched to their first choice in M. Then, {aj3,aj4} are unmatched in M, contradicting the assumption that M is 𝒜-perfect. Now, assume both {aj1,aj2} are not matched to their first choice. By Lemma 16, without loss of generality, assume both aj3 and aj4 are matched to hj1. Then, (aj2,hj2) blocks M, as hj2 has the capacity to accommodate aj2, contradicting the assumption that M is occupancy-stable.

Lemma 18.

In any 𝒜-perfect occupancy-stable matching M of G, none of the agents in {aj1,aj2,as} are matched to their last choice hospital.

Proof.

Since M is 𝒜-perfect, all {aj1,aj2,as} are matched to some hospital. By Lemma 17, without loss of generality, say aj1 is matched to hj1. Assume aj2 is matched to its last choice hj,α2. Then aj,α2 remains unmatched in M, contradicting the assumption that M is 𝒜-perfect. Similarly, as cannot be matched to hs,β.

Lemma 19.

If I admits a complete stable matching M, then G admits an 𝒜-perfect occupancy-stable matching M.

Proof.

Given a complete stable matching M, we describe below how to construct an 𝒜-perfect occupancy-stable matching M starting with an empty set. We need the following two sets to be defined.

Tja = {(aj1,ha),(aj2,hj2),(aj3,hj1),(aj4,hj1),(aj,α1,hj,α1),(aj,α2,hj,α2)}
Tjb = {(aj1,hj1),(aj2,hb),(aj3,hj2),(aj4,hj2),(aj,α1,hj,α1),(aj,α2,hj,α2)}
  • For a man mj with ties in his preference list (wa,wb) where a<b.

    M=M{Tjaif (mj,wa)MTjbif (mj,wb)M
  • For a man ms with strict preference list in I. If (ms,hi)M, then

    M=M{(as,hi),(as,β,hs,β)}

Note that, M is feasible and 𝒜-perfect. To prove that M is occupancy-stable by contradiction, assume there exists a blocking pair with respect to M. Without loss of generality, assume TjaM. Then, aj2,aj3,aj,α1,aj,α2 will not be part of a blocking pair as they are matched to their first choice. Edge (aj1,hj1) will not block M as hj1 doesn’t have enough capacity to accommodate aj1 without unmatching higher preferred agents. Edge (aj4,hj2) will not block as hj2 is full with higher preferred agents. If an edge (as,hi) blocks M, where as corresponds to a man with strict preference, the respective (ms,wi) would be blocking M, contradicting the assumption.

Lemma 20.

If G admits an 𝒜-perfect occupancy-stable matching M, then I admits a complete stable matching M.

Proof.

Given M, construct M as follows. Let M=.

  • For any j such that mj is a man with ties in his preference list, (wa,wb)

    M=M{{(mj,ha)}if (aj1,ha)M{(mj,hb)}if (aj2,hb)M
  • For any s such that ms is a man with strict preference list.

    M=M{(ms,hi)} if (as,hi)M

By Lemma 18, exactly one of {aj1,aj2} is matched to its top choice and other to its second choice, so there is no scenario where both {(mj,ha),(mj,hb)} 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, M is feasible. By Lemma 18, every man mj that has ties is matched to either wa or wb. Similarly, every man ms 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 M. Suppose that there exists a man-woman pair (ms,wi) which blocks M where ms is a man with a strict preference list. Then the corresponding (as,hi) blocks M in G. Therefore, M is stable in I.

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 8|Mj|+3|Ms|, where |Mj| are |Ms| 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 1. This reduction is also from (3,3)-COM-SMTI. Consider a (3,3)-COM-SMTI instance I, with n men {m1,m2,,mn} and n women {w1,w2,,wn}. We construct an HRS instance G=(𝒜,E) from I as follows. For each woman wi we have one hospital hi with capacity 1. For each man mj in I with a preference list which is a tie of length two say (wa,wb) where a<b, we create a gadget consisting of twelve agents and eight hospitals as follows. See Fig. 6(i) and (ii).

  • Agents {aj1,,aj6} where {aj1,aj2,aj3,aj4} have unit size whereas {aj5,aj6} have size 3.

  • For each k=1,2 we have three agents {rj,tk|t=1,2,3} where rj,1k,rj,2k have unit size and rj,3k has size 3.

  • Two hospitals hj1 and hj2 each with capacity 3.

  • For each k=1,2, we have three hospitals {pj,tk|t=1,2,3} where pj,3k has capacity 3 and the remaining hospitals have capacity 1.

For each man ms with a strict preference list in I, we create a gadget containing 4 agents and 3 hospitals hospitals. See Fig. 6 (iii) and (iv).

  • A unit sized agent as.

  • Three agents {rs,t|t=1,2,3} where rs,3 has size 3 and remaining agents are unit sized.

  • Three hospitals {ps,t|t=1,2,3} where ps,3 has capacity 3 and the remaining hospitals have capacity 1.

This completes the description of the agents and hospitals in G. Now we describe the preference lists.

  • Preference list for hospital hi corresponding to woman wi: Let the preference list of wi be lwi=mi1,mi2,mi3. We start with preference list of hi to be set as lhi=lwi. For t=1,2,3 the man mit in lwi either has a strict preference list in I or has a single tie of length two.

    • If mit has a strict preference list, then we denote the man as ms and replace ms in lhi by the corresponding agent as.

    • If mit has a tie in its preference list, then we denote the man as mj and denote the preference list of mj as (wi,wb). If i<b, replace mj with aj1 in lhi, else with aj2.

    This gives us lhi which is the preference list of hospital hi.

  • Preference lists of the vertices in the gadget corresponding to man mj with a tie: Recall that the preference list of mj is a tie of length two, namely (wa,wb) where a<b. The preferences of the agents and hospitals in the gadget corresponding to mj are shown in Fig. 6(i) and (ii). Note that the hospitals ha and hb corresponding to wa and wb appear only in the preferences of aj1 and aj2 respectively.

  • Preference lists of the vertices in the gadget corresponding to man ms with strict preference list: Let the preference list of ms be we,wf,wg. Then the preference list of the agent as has the corresponding hospitals followed by the gadget hospital ps,1. See Fig. 6(iii) and (iv) for the preferences of vertices in the gadget corresponding to ms.

(1)aj1: hj1hapj,11
(1)aj2: hj2hbpj,12
(1)aj3: hj2hj1
(1)aj4: hj1hj2
(3)aj5: hj1
(3)aj6: hj2
(1)rj,1k: pj,1kpj,2kpj,3k
(1)rj,2k: pj,3kpj,2k
(3)rj,3k: pj,3k

(i)

[3]hj1: aj3aj5aj1aj4
[3]hj2: aj4aj6aj2aj3
[1]pj,1k: ajkrj,1k
[1]pj,2k: rj,2krj,1k
[3]pj,3k: rj,1krj,3krj,2k

(ii)

(1)as: hehfhgps,1
(1)rs,1: ps,1ps,2ps,3
(1)rs,2: ps,3ps,2
(3)rs,3: ps,3

(iii)

[1]ps,1: asrs,1
[1]ps,2: rs,2rs,1
[3]ps,3: rs,1rs,3rs,2

(iv)

Figure 6: Agents and hospitals corresponding to a man in the SMTI instance.

This completes the description of the reduction. We prove the correctness below.

Lemma 21.

Let mj be a man with a tie in his preference list in I, and let k{1,2}. If G admits a stable matching N, N leaves (ajk,pj,1k) unmatched. Furthermore, N cannot leave ajk unmatched.

Proof.

Assume there exists j,k as above such that (pj,1k,ajk)N. Hence the hospital pj,1k will be removed from rj,1k’s preference list. Now, the subgraph induced by {rj,1k,rj,2k,rj,3k,pj,2k,pj,3k} is exactly the instance in Fig. 1 except the sizes being 3 instead of 2 and thus doesn’t admit a stable matching. The second statement of the lemma follows from the fact that if ajk is unmatched in N then (ajk,pj,1k) blocks N. Using similar arguments as above, we get the following lemma.

Lemma 22.

Let ms be a man with a strict preference list in I. Then, any matching N in G containing (as,ps,1) is not stable. Furthermore, N cannot leave as unmatched.

The following two lemmas (proofs in the Appendix) establish the correctness of the reduction.

Lemma 23.

Let j be such that mj is a man with a tie in his preference list in I. If G admits a stable matching N then one of the following holds. Either TjaN or TjbN, where Tja={(aj1,ha),(aj2,hj2),(aj3,hj2),(aj4,hj2),(aj5,hj1)} and Tjb={(aj1,hj1),(aj2,hb),(aj3,hj1),(aj4,hj1),(aj6,hj2)}

Lemma 24.

The instance I admits a complete stable matching if and only if the reduced HRS instance G admits a stable matching.

Lemma 24 establishes Theorem 9.

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 3 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 N is stable, from Lemma 21 the agent aj1 should be matched to one of {hj1,ha}. We divide the proof based on the matched partner of aj1 in N.

  • Assume (aj1,ha)N. Here we establish that TjaN. In this case for N to be stable, the hospital hj1 has to be fully subscribed in N with agents higher preferred than aj1. This implies that (aj5,hj1)N. In this case the agent aj3 cannot be left unmatched otherwise (aj3,hj1) blocks N. Thus, (aj3,hj2)N. Since (aj3,hj2)N, (aj6,hj2)N. The hospital hj1 is matched to aj5 and therefore cannot accommodate aj4. The matching N cannot leave aj4 unmatched, else (aj4,hj2) blocks N. This implies that (aj4,hj2)N. Given the current set of edges in N, if N does not match aj2 to hj2, then (aj2,hj2) blocks N. Thus (aj2,hj2)N. Thus we have proved that if (aj1,ha)N then TjaN.

  • Assume (aj1,hj1)N. Here, we establish that TjbN. Since aj1 occupies unit capacity in hj1, aj5 cannot occupy hj1. Hence, (aj5,hj1)N. Furthermore, (aj3,hj1)N else (aj5,hj1) blocks N. If aj4 is not matched to hj1, (aj4,hj1) blocks N. Therefore, (aj4,hj1)N. Given the current set of edges in N, if aj6 is not matched to hj2 then (aj6,hj2) block N. So, (aj6,hj2)N. From Lemma 21 aj2 cannot be unmatched and hj2 cannot accommodate aj2. Therefore, (aj2,hb)N. This concludes that TjbN.

This completes the proof.

Proof of Lemma 24.

Consider a complete stable matching M of I. Let G be the reduced HRS instance of I. Construct a matching M as follows, starting with M=ϕ.

  • For a man mj with ties in his preference list (wa,wb) where a<b.

    M=M{Tjaif (mj,wa)MTjbif (mj,wb)M

    Furthermore for the man mj, we add M=MSj1Sj2.

  • For a man ms with strict preference list in I

    M=M{(as,hi)}Ss

It can be verified that M is feasible in G. From Lemma 23, M is stable.

To prove the other direction, consider a stable matching M of G. Construct a matching M in I as follows.

  • For any j such that mj is a man with ties in his preference list, (wa,wb)

    M=M{{(mj,ha)}if TjaM{(mj,hb)}if TjbM
  • For any s such that ms is a man with strict preference list.

    M=M{(ms,hi)} if (as,hi)M

Since the capacity of hi is 1, the corresponding woman wi in I is also matched to at most one man. Every aj corresponding to agent mj with ties in his preference list will either be matched to ha or hb, so is mj to ma or mb in I. By Lemma 22, as has to be matched to one of hospital in {he,hf,hg} in M. So, all men with a strict preference list in I are matched to some woman in I. Therefore, M is feasible and complete in I. Since all men with ties in their preference list are matched, they do not block M. Say, there exists a man-woman pair (ms,wi) which blocks M where ms is a man with a strict preference list. Then corresponding (as,hi) blocks M in G. Therefore, M is stable in I.