Envy-Freeness in House Allocation Problems

05/01/2019 ∙ by Jiarui Gan, et al. ∙ 0

We consider the house allocation problem, where m houses are to be assigned to n agents so that each agent gets exactly one house. We present a polynomial-time algorithm that determines whether an envy-free assignment exists, and if so, computes one such assignment. We also show that an envy-free assignment exists with high probability if the number of houses exceeds the number of agents by a logarithmic factor.



There are no comments yet.


page 1

page 2

page 3

page 4

This week in AI

Get the week's most popular data science and artificial intelligence research sent straight to your inbox every Saturday.

1 Introduction

In the house allocation problem, also known as the assignment problem, a set of houses are to be assigned to a set of agents with preferences over the houses, under the constraint that each agent is assigned exactly one house (Hylland and Zeckhauser, 1979; Zhou, 1990; Abdulkadiroglu and Sönmez, 2003). Some economic efficiency condition is often desired, for example that the assignment is Pareto optimal. This means that no other assignment makes some agent better off and no agent worse off in comparison to the current assignment (Abraham et al., 2004; Manlove, 2013).

In this note, we investigate the issue of fairness in house allocation using the well-established fairness notion of envy-freeness (Foley, 1967; Varian, 1974). An allocation is said to be envy-free if every agent likes her house at least as much as any other assigned house. If the number of agents is equal to the number of houses, then all houses must be assigned. In this case, it is easy to see that determining whether an envy-free assignment exists, and computing one if so, can be done in polynomial time. Indeed, we can simply construct a bipartite graph with the agents on one side and the houses on the other side, and add an edge between an agent and a house whenever the agent likes the house as least as much as any other house. An envy-free assignment exists if and only if the graph admits a perfect matching; it is well-known that the latter condition can be checked in polynomial time.

The purpose of our note is to study envy-freeness in the general house allocation problem where the number of houses can exceed the number of agents. Formally, there are houses and agents , where . Each agent has a ranking over the houses, where ties are permitted. Allowing the number of agents and the number of houses to be different makes the problem more complex, and we can no longer determine the existence of envy-free assignments solely by matching agents to their favorite houses. For example, if there are three houses and two agents with the rankings and over the houses, then even though both agents compete for the same top house, there is an envy-free assignment that assigns house 2 to agent 1 and house 3 to agent 2. Nevertheless, we present a polynomial-time algorithm that determines whether an envy-free assignment exists, and computes one if it does. We then show that if the number of houses exceeds the number of agents by a logarithmic factor, an envy-free assignment exists with high probability.

To the best of our knowledge, the only work before ours to have considered envy-freeness in house allocation is that of Beynier et al. (2018). Their work focuses exclusively on the case but contains the extra feature that agents are placed on a network that describes the envy relation, and they showed algorithms and hardness results for different networks. Recently, Segal-Halevi (2019) studied a concept called envy-free matchings on bipartite graphs, and provided conditions under which a non-empty envy-free matching exists along with algorithms to compute such matchings. Unlike in this note, his study is restricted to unweighted bipartite graphs and does not require every agent to be assigned to a house.

2 Our Results

Denote by a bipartite graph with bipartite vertex sets and edge set . For any set of vertices , denote by the set of vertices that are adjacent to at least one vertex in . An X-saturating matching is a matching that covers every vertex in . A set is said to be a Hall violator if . It is said to be a minimal Hall violator if no is a Hall violator. Recall that by Hall’s Theorem, an -saturating matching exists if and only if for all . In other words, there is an -saturating matching exactly when no Hall violator is present.

As part of our algorithm, we will need to to find a minimal Hall violator in the case where no -saturating matching exists. In particular, we show that if there is a Hall violator, it is possible to find a minimal one efficiently. Our approach is similar to that in Lemma 4.5 of Amanatidis et al. (2017).

Lemma 2.1.

Given a bipartite graph without an -saturating matching, a minimal Hall violator can be found in polynomial time.


Let be a maximum matching of , and let and be the set of vertices in that are matched and unmatched in , respectively. Since does not admit an -saturating matching, . Let be an arbitrary vertex in . Construct an auxiliary directed graph with the same vertex set as as follows. For every edge with and , add a directed edge from to in . In addition, for every edge with and , add a directed edge from to in . Let be the set of vertices reachable from in . We claim that is a minimal Hall violator. Note that can be computed efficiently using depth-first search.

First, we show that is a Hall violator, i.e., . Every vertex in is reachable from in . If a vertex is unmatched in , then by construction, a path from to alternates between edges in and edges not in , starting and ending with edges not in . Since and are not matched in , this path is an augmenting path, contradicting the maximality of . So every vertex in is matched in , implying the existence of an injection from to . Since , this injection is not a surjection. It follows that . Observe also that every vertex in besides is matched in by construction, so in fact we have .

Next, we show that there is no such that . If , then since all vertices in are matched in , we have . Assume now that . Let . As in the previous paragraph, there is a path from to that alternates between edges in and edges not in . Let be the first vertex from in the path that is not in , and let be its match in . Since can be reached directly from the vertex preceding it on the path, which belongs to , we have . This means that contains all vertices that are matched to in , along with . Hence . ∎

With the subroutine to compute a minimal Hall violator efficiently, we are now ready to present our main algorithm.

1:procedure EnvyFreeAssignment
3:     while  do
4:         Construct a bipartite graph where there is an edge from an agent to a house if and only if the house is among the most preferred houses in for the agent.
5:         if there exists an -saturating matching then
6:              return the corresponding assignment
7:         else
8:              Find a minimal Hall violator .
9:              Remove all houses adjacent to in from .               
10:     return null
Algorithm 1 Algorithm for Computing an Envy-Free Assignment
Theorem 2.2.

Algorithm 1 is a polynomial-time algorithm that decides whether an envy-free assignment exists and, if so, computes one such assignment.


Finding a minimal Hall violator can be done in polynomial time using Lemma 2.1, so each iteration of the while loop can be implemented efficiently. Since every iteration either returns an envy-free assignment or reduces the size of by at least , Algorithm 1 runs in polynomial time.

If the algorithm returns an assignment, every agent receives one of their most preferred houses among the assigned houses, so the assignment is envy-free. We will show that when the algorithm removes houses from , these houses cannot be part of any envy-free assignment. This will imply that if the algorithm returns null, there is indeed no envy-free assignment.

We proceed by induction on the number of rounds. Consider an arbitrary iteration of the while loop in which at least one house is removed. By the induction hypothesis, all houses removed in previous iterations cannot be part of an envy-free assignment. Let be the minimal Hall violator that the algorithm selects in the current iteration. Assume for contradiction that a subset of houses is part of an envy-free assignment. Let be the set of agents in who only have edges to houses in in . Note that since , we have . If is nonempty, then since is a minimal Hall violator, . If is empty, holds trivially. Since , it follows that .

By definition of , every agent in has at least one most preferred house in ; since the houses in are unassigned, such an agent must be assigned to a house in . However, there are fewer houses in than agents in , a contradiction. ∎

Note that an assignment returned by Algorithm 1 is Pareto optimal among all envy-free assignments. Indeed, every agent receives one of their most preferred houses in the current iteration of the while loop, and all houses removed in previous iterations cannot be used in any envy-free assignment. However, envy-freeness and Pareto optimality are incompatible in general. To see this, consider an example with three houses and two agents such that the agents have rankings and over the houses. The unique envy-free assignment is to assign house 2 to agent 1 and house 3 to agent 2. On the other hand, assigning house 1 to agent 1 instead yields a Pareto improvement.

Next, we consider a random preference model. We assume that the agents have strict preferences over the houses, and the preference of each agent is chosen uniformly at random among all strict rankings over the houses, independently of other agents. This is equivalent to assuming that agents have cardinal utilities over the houses drawn independently from an arbitrary non-atomic distribution.111A distribution is said to be non-atomic if it does not put positive probability on any single point. Under this model, it is not hard to see that the probability that an envy-free assignment exists is low in the case ; indeed, an envy-free assignment exists in this case only if all agents have distinct favorite houses, a highly unlikely event. However, we show that as soon as the number of houses exceeds the number of agents by a logarithmic factor, an envy-free allocation is likely to exist.

Theorem 2.3.

Suppose that the agents’ preferences are drawn randomly as described above, and that . Then the probability that an envy-free assignment exists converges to as .


Assume without loss of generality that each agent has a cardinal utility for each house, and this utility is drawn uniformly at random from the interval , independently of other pairs of agents and houses. For each house, if some agent values it at least while the remaining agents value it at most , we assign it to the former agent provided that the agent has not received a house. If all agents receive a house, the resulting assignment is envy-free since all agents value their own house at least and other assigned houses at most . Hence it remains to show that the probability that all agents receive a house converges to .

Fix an agent. The probability that a particular house is assigned to the agent is . Since , we have for large enough . Hence the probability that the agent does not receive a house is at most

where the second inequality follows from , which holds for every real number . By union bound, the probability that some agent does not receive a house is at most , which approaches for large , completing the proof. ∎


This work has been supported by the European Research Council (ERC) under grant number 639945 (ACCORD)


  • Abdulkadiroglu and Sönmez [2003] Atila Abdulkadiroglu and Tayfun Sönmez. Random serial dictatorship and the core from random endowments in house allocation problems. Econometrica, 66(3):689–701, 2003.
  • Abraham et al. [2004] David J. Abraham, Katarína Cechlárová, David Manlove, and Kurt Mehlhorn. Pareto optimality in house allocation problems. In Proceedings of the 15th International Symposium on Algorithms and Computations, pages 3–15, 2004.
  • Amanatidis et al. [2017] Georgios Amanatidis, Evangelos Markakis, Afshin Nikzad, and Amin Saberi. Approximation algorithms for computing maximin share allocations. ACM Transactions on Algorithms, 13(4):52, 2017.
  • Beynier et al. [2018] Aurélie Beynier, Yann Chevaleyre, Laurent Gourvès, Julien Lesca, Nicolas Maudet, and Anaëlle Wilczynski. Local envy-freeness in house allocation problems. In Proceedings of the 17th International Conference on Autonomous Agents and MultiAgent Systems, pages 292–300, 2018.
  • Foley [1967] Duncan K. Foley. Resource allocation and the public sector. Yale Economics Essays, 7(1):45–98, 1967.
  • Hylland and Zeckhauser [1979] Aanund Hylland and Richard Zeckhauser. The efficient allocation of individuals to positions. Journal of Political Economy, 87(2):293–314, 1979.
  • Manlove [2013] David Manlove. Algorithmics of Matching Under Preferences. World Scientific, 2013.
  • Segal-Halevi [2019] Erel Segal-Halevi. Bipartite envy-free matching. CoRR, abs/1901.09527, 2019.
  • Varian [1974] Hal R. Varian. Equity, envy, and efficiency. Journal of Economic Theory, 9:63–91, 1974.
  • Zhou [1990] Lin Zhou. On a conjecture by Gale about one-sided matching problems. Journal of Economic Theory, 52(1):123–135, 1990.