# Fairly Allocating Many Goods with Few Queries

We investigate the query complexity of the fair allocation of indivisible goods. For two agents with arbitrary monotonic valuations, we design an algorithm that computes an allocation satisfying envy-freeness up to one good (EF1), a relaxation of envy-freeness, using a logarithmic number of queries. We show that the logarithmic query complexity bound also holds for three agents with additive valuations. These results suggest that it is possible to fairly allocate goods in practice even when the number of goods is extremely large. By contrast, we prove that computing an allocation satisfying envy-freeness and another of its relaxations, envy-freeness up to any good (EFX), requires a linear number of queries even when there are only two agents with identical additive valuations.

## Authors

• 1 publication
• 20 publications
• 34 publications
• ### Almost Envy-Freeness in Group Resource Allocation

We study the problem of fairly allocating indivisible goods between grou...
01/24/2019 ∙ by Maria Kyropoulou, et al. ∙ 0

• ### One Dollar Each Eliminates Envy

We study the fair division of a collection of m indivisible goods amongs...
12/05/2019 ∙ by Johannes Brustle, et al. ∙ 0

• ### The Fairness of Leximin in Allocation of Indivisible Chores

The leximin solution – which selects an allocation that maximizes the mi...
05/11/2020 ∙ by Xingyu Chen, et al. ∙ 0

• ### Democratic Fair Allocation of Indivisible Goods

We study the problem of fairly allocating indivisible goods to groups of...
09/08/2017 ∙ by Erel Segal-Halevi, et al. ∙ 0

• ### (Almost Full) EFX Exists for Four Agents (and Beyond)

The existence of EFX allocations is a major open problem in fair divisio...
02/21/2021 ∙ by Ben Berger, et al. ∙ 0

• ### On monotonic determinacy and rewritability for recursive queries and views

A query Q is monotonically determined over a set of views if Q can be ex...
03/12/2020 ∙ by Michael Benedikt, et al. ∙ 0

• ### Approximating Sumset Size

Given a subset A of the n-dimensional Boolean hypercube 𝔽_2^n, the sumse...
07/26/2021 ∙ by Anindya De, et al. ∙ 0

##### 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

Fair division is the study of how to allocate resources among interested agents in such a way that all agents find the resulting allocation to be fair (Brams and Taylor, 1996; Moulin, 2003). One of the field’s paradigmatic applications is the allocation of indivisible goods; this task typically arises in inheritance cases, when, say, an art or jewelry collection is divided between several heirs. Indeed, dividing goods is one of five applications offered by Spliddit (Goldman and Procaccia, 2014), a not-for-profit fair division website; since its launch in November 2014, the website has served more than 130,000 users, and, in particular, has solved thousands of goods-division instances submitted by users.

While Steinhaus (1948) was the first to study fairness from a mathematical point of view, the history of fair division actually goes back much further: A simple fair division mechanism called the cut-and-choose protocol is mentioned in the Book of Genesis. After a dispute between Abraham and Lot, Abraham suggests that the two go their separate ways. He divides the land into two parts that—here we are perhaps using artistic license—he likes equally, and lets Lot choose the part that he prefers. The cut-and-choose protocol ensures that the resulting allocation satisfy an important fairness property called envy-freeness—each of Abraham and Lot finds his part to be worth at least as much as the other person’s part. Even though envy-freeness can always be satisfied when the allocated resources are divisible (Stromquist, 1980), this is not the case when we deal with indivisible resources. With two agents and a single indivisible good, we already see that one of the agents will not receive the good and envy the other agent.

Consequently, various relaxations of envy-freeness have been considered, the most prominent one being envy-freeness up to one good (EF1). This means that some agent may envy another agent under the given allocation, but that envy can be eliminated by removing a single good from the latter agent’s bundle. Lipton et al. (2004) showed that EF1 can be guaranteed even when the agents have arbitrary monotonic valuations. They achieved this by using an algorithm that we will refer to as the envy cycle elimination algorithm, which runs in time , where is the number of agents and the number of goods.

Given that an EF1 allocation always exists and can be found efficiently at this level of generality, a natural question to ask is how much we need to know about the agents’ valuations to compute such an allocation. This issue is crucial for combinatorial valuations, since merely writing down a complete valuation might already take exponential time. But the question is equally important for additive valuations; while expressing such a valuation only takes linear time, this may already be prohibitive if the number of goods is very large. In fact, the goods application on Spliddit elicits additive valuations and computes an EF1 allocation (Caragiannis et al., 2016); the largest instance that was encountered involved ten siblings and roughly 1400 goods. In this case, the siblings actually prepared a spreadsheet with their value for each of the goods!

### 1.1 Our Results

We allow algorithms to elicit the valuations of agents via a standard interface, value queries, which ask an agent for her value for a given subset of goods. The complexity of algorithms is measured in terms of the worst-case number of queries they require.

In Section 3 we consider the case of two agents. We show that it is possible to compute an EF1 allocation for agents with arbitrary monotonic valuations using a logarithmic number of queries (Theorem 3.1). This is asymptotically tight, even for two agents with identical and very simple binary valuations (Proposition 3.2). We then turn to envy-freeness and establish that determining whether an envy-free allocation exists takes an exponential number of queries for agents with identical monotonic valuations (Proposition 3.3) and a linear number of queries for agents with identical additive valuations (Theorem 3.4); our latter bound is also exactly tight. We end our investigation of the two-agent case by considering another relaxation of envy-freeness called envy-freeness up to any good (EFX), a stronger notion than EF1. We show that computing an EFX allocation already takes a linear number of queries for agents with identical additive valuations (Theorem 3.5). This complements a recent result of Plaut and Roughgarden (2018), who showed that while an EFX allocation always exists for two agents with arbitrary monotonic valuations, computing one such allocation already requires an exponential number of queries in the worst case, even when the valuations of the agents are identical. Taken together, these results suggest that, when the number of goods is large, EF1 is the ‘right’ notion of fairness, whereas EFX is too demanding. The results of Section 3 are summarized in Table 1.

In Section 4 we address the case of three agents. Our main result is an algorithm that computes an EF1 allocation for three agents with additive valuations using a logarithmic number of queries (Theorem 4.4). Our algorithm adapts the Selfridge-Conway procedure, a classical cake-cutting protocol for computing an envy-free allocation of a heterogeneous divisible good, to the setting of indivisible goods. In particular, as a building block we use an algorithm that, for three agents with identical additive valuations, computes an EF1 allocation satisfying the extra property that any three predetermined goods belong to three different bundles (Lemma 4.3).

Finally, in Section 5 we consider the setting where there can be any number of agents. We show that the envy cycle elimination algorithm of Lipton et al. (2004) can be implemented using a relatively modest number of queries (Theorem 5.1). To complement this positive result, we conclude by presenting a lower bound on the number of queries needed to compute an EF1 allocation (Theorem 5.2).

### 1.2 Related Work

The paper that is most closely related to ours is the one mentioned above, by Plaut and Roughgarden (2018). Using an interesting reduction from the local search problem on a class of graphs known as Kneser graphs, they show that the problem of finding an EFX allocation requires an exponential number of queries, even for two agents with identical valuations. They also examine when EFX can be achieved in conjunction with other properties such as Pareto optimality, and establish the existence of allocations satisfying an approximate version of EFX for agents with subadditive valuations.

A bit further afield, query complexity has long been a topic of interest in computational fair division, albeit in the context of cake cutting (Procaccia, 2013). The standard query model is due to Robertson and Webb (1998), and allows two types of operations: evaluate (which is similar to our value queries) and cut. In this model, the query complexity of achieving fair cake allocations, under various notions of fairness, is well studied (Edmonds and Pruhs, 2006; Procaccia, 2009; Deng, Qi, and Saberi, 2012; Kurokawa, Lai, and Procaccia, 2013; Aziz and Mackenzie, 2016a; Procaccia and Wang, 2017).

## 2 Preliminaries

There is a set of goods and a set of agents. A bundle is a subset of . Each agent has a nonnegative valuation for each . We sometimes abuse notation and write for .

A valuation is said to be monotonic if for any and any . It is said to be additive if for any , and binary if it is additive and or for each . While additivity is significantly more restrictive than monotonicity, many papers in fair division assume that agents’ valuations are additive (Amanatidis et al., 2015; Bouveret and Lemaître, 2016; Caragiannis et al., 2016; Kurokawa, Procaccia, and Wang, 2018). This assumption is also made by Spliddit’s app for dividing goods (Caragiannis et al., 2016), as, in practice, additive valuations hit a sweet spot between expressiveness and ease of elicitation. We assume throughout the paper that agents have monotonic valuations111Without this assumption, neither of the relaxations of envy-freeness that we consider can always be satisfied even when there are two agents. and that, without loss of generality, for all .

An allocation is a partition of into bundles , where bundle is allocated to agent . If the goods lie on a line, for each good we denote by and the set of goods to the left and right of , respectively. A contiguous allocation is an allocation in which every bundle forms a contiguous block on the line.

We now define the fairness notions that we consider.

###### Definition 2.1.

An allocation is said to be

• envy-free if for any .

• envy-free up to any good (EFX) if for any and any good , .

• envy-free up to one good (EF1) if for any such that , there exists a good such that .222The clause “such that ” is necessary for the case where .

It is easy to see that envy-freeness is stronger than EFX, which is in turn stronger than EF1. Envy-freeness is a classical and well-studied fairness notion that goes back to Foley (1967). By contrast, its two relaxations are relatively new: EF1 was introduced by Budish (2011) and a related property was studied by Lipton et al. (2004), while EFX was only proposed recently by Caragiannis et al. (2016). Interestingly, it is not known whether an EFX allocation always exists, even for three agents with additive valuations (Caragiannis et al., 2016; Plaut and Roughgarden, 2018).

We will consider algorithms that compute fair allocations according to these fairness notions. In order to discover the agents’ valuations, an algorithm is allowed to issue value queries. In each query, the algorithm chooses an agent and a subset , and finds out the value of . We assume that the algorithm is deterministic, and allow it to be adaptive, i.e., the algorithm can determine its next query based on its past queries and the corresponding answers.

## 3 Two Agents

In this section, we consider the setting with two agents. We organize our results based on fairness notion: EF1, envy-freeness, and EFX.

### 3.1 Ef1

We begin by describing an algorithm that computes an EF1 allocation for two agents with arbitrary monotonic valuations. The algorithm is similar to the cut-and-choose protocol for cake cutting: the first agent partitions the goods into two bundles with the property that she would be satisfied with either bundle, and the second agent chooses the bundle that she prefers. In order to minimize the number of queries, we arrange the goods on a line and use binary search to determine the cut point of the first agent.

Algorithm 1 (for two agents with monotonic valuations) Step 1: Arrange the goods on a line in arbitrary order. Find the rightmost good such that . Step 2: If , consider the partition ; else, consider the partition . Give the bundle from the partition that she prefers, and the remaining bundle.

We claim that the algorithm computes an EF1 allocation using a logarithmic number of queries.

###### Theorem 3.1.

For two agents with arbitrary monotonic valuations, Algorithm 1 computes an EF1 allocation. Moreover, the algorithm can be implemented to use queries in the worst case.

###### Proof.

We first show that the algorithm computes an EF1 allocation. Since gets the bundle that she prefers, she does not envy .

To reason about ’s envy, assume first that . It holds that : This is clearly true if is the rightmost good on the line, and otherwise it follows from the definition of that . Therefore, if receives , she is not envious at all. And if she receives , it holds that

 u1(Rg)≥u1(Lg)=u1((Lg∪{g})∖{g}),

so EF1 is satisfied.

The second case is where . If gets then she is not envious, since, by the definition of , . If she gets instead, then EF1 holds, because

 u1(Lg)>u1(Rg)=u1((Rg∪{g})∖{g}).

Next, we show that the algorithm can be implemented to use queries. By monotonicity, Step 1 can be done by binary search using queries. In Step 2, we use two queries to compare and , and two more queries to compare ’s valuation for the two bundles in the partition. Hence the total number of queries is . ∎

The following proposition shows that the bound in Theorem 3.1 is tight.

###### Proposition 3.2.

Any deterministic algorithm that computes an EF1 allocation for two agents with identical binary valuations uses queries in the worst case, even when each agent values only two goods.

Since Proposition 3.2 will later be generalized by Theorem 5.2, we do not present its proof here.

### 3.2 Envy-freeness

Next, we turn our attention to envy-freeness. Unlike the case of EF1, allocations that satisfy envy-freeness are not guaranteed to exist. We show that for two agents with identical monotonic valuations, even an algorithm that only decides whether an envy-free allocation exists already needs to make an exponential number of queries in the worst case. A similar argument holds for algorithms that compute an envy-free allocation whenever one exists.

###### Proposition 3.3.

Assume that is even. Any deterministic algorithm that determines whether an envy-free allocation exists for two agents with identical monotonic valuations uses at least queries in the worst case.

The proof of Proposition 3.3, and all other omitted proofs, can be found in Appendix A.

Even though an algorithm that decides whether an envy-free allocation exists needs to make an exponential number of queries for agents with monotonic valuations, when we restrict our attention to agents with additive valuations, the exponential lower bound no longer holds since the algorithm can query the value of both agents for every good and find out the full valuations. Nevertheless, it is still conceivable that there are algorithms that do asymptotically better, e.g., use a logarithmic number of queries. We show that this is not the case: a linear number of queries is necessary, even when the two agents have identical valuations. In fact, we leverage linear-algebraic techniques to establish that at least queries are needed in this case. This bound is tight for two identical agents since the algorithm can find out the common valuation by querying the value of each of the goods.

###### Theorem 3.4.

Assume that is even. Any deterministic algorithm that decides whether an envy-free allocation exists for two agents with identical additive valuations uses at least queries in the worst case.

###### Proof.

For ease of notation, let for , where is the common valuation. Note that an envy-free allocation exists if and only if the goods can be partitioned into two sets of equal value. Consider an algorithm that always uses at most queries. Assume without loss of generality that the algorithm always uses exactly queries; whenever it uses fewer than queries, we add arbitrary queries for the algorithm. The idea is that for each query, if the queried subset has size , we will give an answer close to in such a way that after all queries, it is still possible that there exists an envy-free allocation, but also that there does not exist one. This will allow us to obtain the desired conclusion.

For , let

be a vector of length

where the th component is 1 if good is included in the th query, and 0 otherwise. Therefore the th query asks for the value . Furthermore, let be the set of all vectors of length all of whose components are , and let be the set of vectors with an equal number of and 1. Note that an envy-free allocation exists exactly when for some .

When we receive the th query, if , our answer is already determined by previous answers. Assume therefore that for all . For each such that , there exists a unique answer that would force . We avoid all such (finite number of) answers. After query number we have a subspace of dimension such that we know the value if and only if is in the subspace.

Next, let . Clearly, all vectors in are orthogonal to the vector . We claim that in fact has dimension , and therefore consists of all vectors orthogonal to . To see this, take two distinct vectors in that differ only in the first and th component for . The difference vector, which consists of a 1 in the first position, a in the th position, and 0 elsewhere belongs to . No nontrivial linear combination of these vectors can produce the all-zero vector, meaning that indeed has dimension . Now, since any vector is not orthogonal to , we have , and so there exists such that . (If this were not the case, we would have , and then the two subspaces would be equal because they are of the same dimension.) Since is of dimension and , setting the value of will, in combination with the previous constraints, uniquely determine . If we set , an envy-free allocation exists. On the other hand, if we set so that for all , an envy-free allocation does not exist. This choice of value for is available because for each , only one value of forces .

It remains to show that we can give the answers so that after setting the value of , all components of the unique solution for are nonnegative. Let be such that for any vector with for all , and any invertible matrix all of whose entries are , 0, or 1, the unique solution to has for all . The existence of

is guaranteed by the fact that the linear transformation

takes the all-zero vector to itself, by the continuity of the transformation, and by the fact that there are a finite number of such matrices . For each query on a subset of size , we give an answer in the range . Moreover, we choose the value of to be in the range .

Write for all , where is the unique solution according to our choices. Our answers to the queries ensure that the values of for belong to the range , and our choice of ensures that also belong to the same range. Since all elements of and belongs to the set , by taking to be the matrix with and as its rows, and to be a vector of length with and as its elements, our definition of implies that for all . It follows that for all , as desired. ∎

For two agents with additive valuations, envy-freeness is equivalent to another well-known fairness notion called proportionality, which requires that each agent receive at least half of her value for the whole set of goods. Thus, the lower bound in Theorem 3.4 also holds for two agents with identical additive valuations with respect to proportionality.

### 3.3 Efx

We end this section by considering EFX. For two agents with monotonic valuations, Plaut and Roughgarden (2018) showed that an EFX allocation is guaranteed to exist, but computing it takes an exponential number of queries in the worst case. If the agents have additive valuations, however, the algorithm can already find out the full valuations using only a linear number of queries. Our next result shows that a linear number of queries is, in fact, needed for computing an EFX allocation.

###### Theorem 3.5.

Assume that

is odd. Any deterministic algorithm that computes an EFX allocation for two agents with identical additive valuations uses at least

queries in the worst case.

Note that Theorem 3.5 is incomparable with Theorem 3.4, even though EFX is a relaxation of envy-freeness, because the former result deals with a search problem (finding an EFX allocation knowing that one always exists), whereas the latter deals with a decision problem (deciding whether an EF allocation exists at all).

## 4 Three Agents

In this section, we study the setting with three agents who are endowed with additive valuations. Our main result is an algorithm that finds an EF1 allocation using queries, but we first need to develop some machinery for the case where the agents have identical valuations.

While the case of identical additive valuations might seem trivial at first glance, as we will see, there are already several interesting statements that we can make about the setting, so it may be of independent interest. We begin by establishing some properties of a particular partition of goods on a line into two contiguous blocks.

###### Lemma 4.1.

Assume that the goods lie on a line. Suppose that an agent with an additive valuation chooses the partition of the goods into two contiguous blocks that minimizes the difference between the values of the two blocks. (If there are goods of value 0 next to the cut point, move the cut point until these goods belong to the block of lower value.) Let be the left block and the rightmost good of the block. Similarly, let be the right block and the leftmost good of the block. Then:

1. We have that and .

2. The partition can be computed using queries in the worst case.

Next, we present an algorithm that computes a contiguous EF1 allocation for three agents with identical valuations using a logarithmic number of queries. Not only will the contiguity condition be useful later in our algorithm for three agents with arbitrary valuations, but in certain applications it may also be desirable to produce a contiguous allocation. For example, if the goods are office space, it is conceivable that each research group wishes to have a consecutive block of offices in order to facilitate collaboration within the group. While contiguous fair allocations of indivisible goods have recently been studied (Bouveret et al., 2017; Suksompong, 2017), to the best of our knowledge even the existence of a contiguous EF1 allocation for three agents with identical valuations has not been established before, let alone an algorithm that computes such an allocation using a small number of queries. Hence our result may be of interest even if one is not concerned with the number of queries made. In the appendix, the existence result is generalized to any number of agents with identical monotonic valuations (Lemma C.2).

Algorithm 2 (for three agents with identical additive valuations) Step 1: Assume that the goods lie on a line, and denote by the common valuation of the three agents. Let be the leftmost good such that , and let be the rightmost good such that . (Possibly .) Assume without loss of generality that . Step 2: If , let be the leftmost good such that . Set . Else, set . In both cases, set and . Step 3: If , return the allocation . Else, set . Partition the remaining goods into two contiguous blocks according to Lemma 4.1; denote by the left block and the right block. Return the allocation .

The following lemma establishes the claimed properties of Algorithm 2.

###### Lemma 4.2.

Assume that the goods lie on a line. For three agents with identical additive valuations, Algorithm 2 computes a contiguous EF1 allocation. Moreover, the algorithm can be implemented to use queries in the worst case.

A bonus of Algorithm 2 is that in the allocation produced by the algorithm, if some agent envies another agent, then the envy can be eliminated by removing not just some arbitrary good from the latter agent’s bundle, but one of the goods at the end of the latter agent’s block. In fact, we can also choose this good to be a good next to a cut point; this nails down a unique good for the agents getting the left or right block. The property can be deduced from the proof of Lemma 4.2.

To demonstrate that even the problem of establishing the existence of a contiguous EF1 allocation in this setting is not straightforward, we present a very natural approach that, perhaps surprisingly, does not work. We first pretend that the goods are divisible and find the two cut points that would divide the goods into three parts of exactly equal value. For each cut point, if the cut point falls between two (now indivisible) goods, we keep it; otherwise we round it either to the left or to the right. One might be tempted to claim that at least one of the resulting allocations must be EF1. Indeed, Lemma 4.1 implies that an analogous approach works for two agents. However, an example given in Appendix B shows that the approach does not work for three agents, no matter how we round the cut points.

Next, we leverage Algorithm 2 to show that for three agents with identical additive valuations, if we designate three goods in advance, it is possible to compute an EF1 allocation such that all three designated goods belong to different bundles.

###### Lemma 4.3.

Let , , be three distinct goods. For three agents with identical additive valuations, there exists a deterministic algorithm that computes an EF1 allocation such that the three goods belong to three different bundles using queries in the worst case.

Note that for two agents, an analogous statement holds even when the agents have arbitrary monotonic valuations, since we can place the two designated goods at different ends of a line and apply Algorithm 1.

With Algorithm 2 and Lemma 4.3 in hand, we are now ready to present an algorithm that computes an EF1 allocation for three agents with arbitrary additive valuations using a logarithmic number of queries. The algorithm is based on the Selfridge-Conway procedure for computing an envy-free allocation of divisible goods, often modeled as a cake, for three agents. At a high level, the Selfridge-Conway procedure operates by letting the first agent divide the cake into three equal pieces and letting the second agent trim her favorite piece so that it is equal to her second favorite piece. Then, the procedure allocates one “main” piece to each agent, with the third agent choosing first, and allocates the leftover cake in a carefully designed way.

Like the Selfridge-Conway procedure, our algorithm starts by letting the first agent divide the goods into three almost equal bundles using Algorithm 2, so that no matter how the bundles are allocated, the agent finds the allocation to be EF1. It then proceeds by letting the second agent trim her favorite bundle so that her value for the bundle goes just below that for her second favorite bundle. However, a difficulty in our indivisible goods setting is that at this point, the second agent might find the remaining part of her favorite bundle to be worth less than her second favorite bundle even if we remove any good from her second favorite bundle. This is possible, for instance, if the last good that she removes from her favorite bundle is of high value, and her second favorite bundle only consists of goods of low value. We will need to fix this problem by finding “large” goods in the leftover bundle that help us recover the EF1 guarantee; this is done in Step 3 of the algorithm. While identifying these large goods can be done easily if we can make queries for the value of every good in the leftover bundle, we would not achieve the logarithmic bound if the leftover piece contained more than a logarithmic number of goods.

Algorithm 3 (for three agents with additive valuations) Step 1: Compute an EF1 allocation for three identical agents with valuation . If and have different favorite bundles among , give them their favorite bundles, and give the remaining bundle to . Else, assume without loss of generality that and . Step 2: Let divide into and such that and there exists with . If , give to , to , and to . Compute an EF1 allocation of the goods in for three identical agents with valuation . Let choose her favorite bundle followed by , and let take the remaining bundle. Else, we have . Step 3: Define . Call a good large if and , where we update , , and during the course of the step. Let find up to three large goods. The first large good is the good such that . To find further large goods, let be such that , for some , and does not contain any identified large good. If such a set (and good ) exists, remove the goods in from and add them to , and decrease by . (For the first large good, take .) Then is a new large good. If with the updated set , allocate the goods according to Step 2. So we may still assume that . On the other hand, if no such set exists, remove all goods except the (up to two) identified large goods from and add them to , and decrease by ’s value for these goods. Step 4: Compute an EF1 allocation of the goods in for three identical agents with valuation in such a way that all identified large goods belong to different bundles. Step 5: Let be ’s preferred bundle between and , and let be the other bundle. Give to , to , and to . Step 6: If there is an identified large good in each of , , and , give her favorite bundle if we were to remove the identified large good from each of these bundles. Let choose her preferred bundle from the remaining two bundles (without removing the large goods), and give the remaining bundle. Else, give the first identified large good to and the second identified large good (if exists) to .

The following theorem, which we view as our main result, establishes the claimed properties of Algorithm 3 by leveraging the machinery developed above.

###### Theorem 4.4.

For three agents with additive valuations, Algorithm 3 computes an EF1 allocation. Moreover, the algorithm can be implemented to use queries in the worst case.

## 5 Any Number of Agents

In this section, we consider the general setting where there can be any number of agents. We state and discuss some results here, and relegate several results that require stronger assumptions to Appendix C.

Our starting point is the envy cycle elimination algorithm of Lipton et al. (2004), which computes an EF1 allocation for agents with arbitrary monotonic valuations. The algorithm works by allocating one good at a time in arbitrary order. It also maintains an envy graph, which has the agents as its vertices, and a directed edge from to if envies with respect to the current (partial) allocation. At each step, the next good is allocated to an agent with no incoming edge, and any cycle that arises as a result is eliminated by giving ’s bundle to for any edge from to in the cycle. This allows the algorithm to maintain the invariant that the envy graph has no cycles and therefore has an agent with no incoming edge before each allocation of a good. The envy cycle elimination algorithm runs in time in the worst case. We refer to the paper of Lipton et al. (2004) for the proof of correctness and detailed analysis of this algorithm.

Our main positive result for this section is the observation that the envy cycle elimination algorithm can be implemented using a relatively modest number of (value) queries.

###### Theorem 5.1.

For any number of agents with arbitrary monotonic valuations, the envy cycle elimination algorithm can be implemented to compute an EF1 allocation using:

1. queries in the worst case.

2. queries in the worst case, if the valuation of each agent takes at most (possibly unknown) values across all subsets of goods.

Theorem 5.1 illustrates a sharp contrast between EF1 and the stronger fairness notions of envy-freeness and EFX. For the latter two notions, computing a fair allocation requires an exponential number of queries in the worst case, even in the most restricted setting of two agents with identical valuations. On the other hand, for EF1 we can get away with only queries even in the most general setting of any number of agents with arbitrary monotonic valuations. Moreover, if and are small compared to , the bound of Item 2 of the theorem can be better than that of Item 1. In particular, if and are constant, the implementation only requires queries. The case of corresponds to the setting where each agent either approves or disapproves each subset of goods.333This is not to be confused with what we call binary valuations in this paper, for which can be as large as . A small value of may occur in settings where the mechanism designer gives a predefined set of preferences that the agents can express on each subset of goods, e.g., ‘very interested’, ‘somewhat interested’, and ‘not interested’.

To complement this positive result, we conclude by giving a lower bound (which, sadly, does not match the upper bound) on the number of queries needed to compute an EF1 allocation.

###### Theorem 5.2.

Let for some constant . Any deterministic algorithm that computes an EF1 allocation for agents with binary valuations uses queries in the worst case.

###### Proof.

Assume first that is even, say , and that each agent has value 1 for two goods and 0 for the remaining goods. Suppose further that for , agents and have identical valuations; we abuse notation and denote this valuation by . Note that if both of the goods valued by some agent are allocated to a single agent, the resulting allocation cannot be EF1.

Initially, for each , let be the whole set of goods. As long as , we answer the query of the algorithm on the value of for a subset of goods as follows. If , answer 2 and replace by ; else, answer 0 and replace by . While , the only information that the algorithm has is that both valued goods are contained in . This information is not sufficient to return an allocation such that the two valued goods are guaranteed to be in different bundles, so the algorithm must keep making queries until for every . Since initially and the size of decreases by no more than half with each query, the algorithm uses at least queries in the worst case. The conclusion follows from the observation that .

If is odd, we can assume that the last agent has value 0 for all goods and deduce the same asymptotic bound using the remaining agents. ∎

Since the assumption of Theorem 5.2 holds for any constant if is large enough, and when the two agents considered in the proof have identical valuations and each agent values only two goods, this theorem implies Proposition 3.2.

## 6 Discussion

From a technical viewpoint, the main take-home message of our work is this: Envy-free cake cutting protocols, designed for divisible goods, can be adapted to yield EF1 allocations of indivisible goods using a logarithmic number of queries. On a high level, the idea is to arrange the goods on a line, and approximately implement cut operations using binary search. We do this to obtain Theorem 3.1, by adapting the cut-and-choose protocol, and Theorem 4.4, by building on the classic Selfridge-Conway protocol.

However, making sure the approximation errors do not add up in a way that violates EF1 already becomes nontrivial when there are three agents, as illustrated by Algorithm 3 and Theorem 4.4. Extending the approach even to four agents with arbitrary additive valuations, therefore, seems very challenging. A related difficulty is that the known envy-free cake cutting protocols for four or more agents are quite involved (Brams and Taylor, 1995; Aziz and Mackenzie, 2016a, b; Amanatidis et al., 2018).

Another intriguing question is whether the logarithmic upper bound on the complexity of EF1 extends to three agents with monotonic valuations. Such valuations cannot be handled by the Selfridge-Conway procedure, which is designed for the cake cutting setting where additivity is assumed. Of course, it is possible that, in fact, there is super-logarithmic lower bound on the query complexity in this case.

## References

• Amanatidis et al. (2015) Amanatidis, G.; Markakis, E.; Nikzad, A.; and Saberi, A. 2015. Approximation algorithms for computing maximin share allocations. In Proceedings of the 42nd International Colloquium on Automata, Languages and Programming (ICALP), 39–51.
• Amanatidis et al. (2018) Amanatidis, G.; Christodoulou, G.; Fearnley, J.; Markakis, E.; Psomas, C.-A.; and Vakaliou, E. 2018. An improved envy-free cake cutting protocol for four agents. In

Proceedings of the 11th International Symposium on Algorithmic Game Theory (SAGT)

.
Forthcoming.
• Aziz and Mackenzie (2016a) Aziz, H., and Mackenzie, S. 2016a. A discrete and bounded envy-free cake cutting protocol for any number of agents. In Proceedings of the 57th Symposium on Foundations of Computer Science (FOCS), 416–427.
• Aziz and Mackenzie (2016b) Aziz, H., and Mackenzie, S. 2016b. A discrete and bounded envy-free cake cutting protocol for four agents. In

Proceedings of the 48th Annual ACM Symposium on Theory of Computing (STOC)

, 454–464.
• Bouveret and Lemaître (2016) Bouveret, S., and Lemaître, M. 2016. Characterizing conflicts in fair division of indivisible goods using a scale of criteria. Autonomous Agents and Multi-Agent Systems 30(2):259–290.
• Bouveret et al. (2017) Bouveret, S.; Cechlárová, K.; Elkind, E.; Igarashi, A.; and Peters, D. 2017. Fair division of a graph. In

Proceedings of the 26th International Joint Conference on Artificial Intelligence (IJCAI)

, 135–141.
• Brams and Taylor (1995) Brams, S. J., and Taylor, A. D. 1995. An envy-free cake division protocol. The American Mathematical Monthly 102(1):9–18.
• Brams and Taylor (1996) Brams, S. J., and Taylor, A. D. 1996. Fair Division: From Cake-Cutting to Dispute Resolution. Cambridge University Press.
• Budish (2011) Budish, E. 2011. The combinatorial assignment problem: Approximate competitive equilibrium from equal incomes. Journal of Political Economy 119(6):1061–1103.
• Caragiannis et al. (2016) Caragiannis, I.; Kurokawa, D.; Moulin, H.; Procaccia, A. D.; Shah, N.; and Wang, J. 2016. The unreasonable fairness of maximum Nash welfare. In Proceedings of the 17th ACM Conference on Economics and Computation (EC), 305–322.
• Deng, Qi, and Saberi (2012) Deng, X.; Qi, Q.; and Saberi, A. 2012. Algorithmic solutions for envy-free cake cutting. Operations Research 60(6):1461–1476.
• Edmonds and Pruhs (2006) Edmonds, J., and Pruhs, K. 2006. Cake cutting really is not a piece of cake. In Proceedings of the 17th Annual ACM-SIAM Symposium on Discrete Algorithms (SODA), 271–278.
• Foley (1967) Foley, D. 1967. Resource allocation and the public sector. Yale Economics Essays 7:45–98.
• Goldman and Procaccia (2014) Goldman, J., and Procaccia, A. D. 2014. Spliddit: Unleashing fair division algorithms. SIGecom Exchanges 13(2):41–46.
• Kurokawa, Lai, and Procaccia (2013) Kurokawa, D.; Lai, J. K.; and Procaccia, A. D. 2013. How to cut a cake before the party ends. In Proceedings of the 27th AAAI Conference on Artificial Intelligence (AAAI), 555–561.
• Kurokawa, Procaccia, and Wang (2018) Kurokawa, D.; Procaccia, A. D.; and Wang, J. 2018. Fair enough: Guaranteeing approximate maximin shares. Journal of the ACM 64(2): article 8.
• Lipton et al. (2004) Lipton, R. J.; Markakis, E.; Mossel, E.; and Saberi, A. 2004. On approximately fair allocations of indivisible goods. In Proceedings of the 6th ACM Conference on Economics and Computation (EC), 125–131.
• Moulin (2003) Moulin, H. 2003. Fair Division and Collective Welfare. MIT Press.
• Plaut and Roughgarden (2018) Plaut, B., and Roughgarden, T. 2018. Almost envy-freeness with general valuations. In Proceedings of the 29th Annual ACM-SIAM Symposium on Discrete Algorithms (SODA), 2584–2603.
• Procaccia and Wang (2017) Procaccia, A. D., and Wang, J. 2017. A lower bound for equitable cake cutting. In Proceedings of the 18th ACM Conference on Economics and Computation (EC), 479–495.
• Procaccia (2009) Procaccia, A. D. 2009. Thou shalt covet thy neighbor’s cake. In Proceedings of the 21st International Joint Conference on Artificial Intelligence (IJCAI), 239–244.
• Procaccia (2013) Procaccia, A. D. 2013. Cake cutting: Not just child’s play. Communications of the ACM 56(7):78–87.
• Robertson and Webb (1998) Robertson, J. M., and Webb, W. A. 1998. Cake Cutting Algorithms: Be Fair If You Can. A. K. Peters.
• Steinhaus (1948) Steinhaus, H. 1948. The problem of fair division. Econometrica 16:101–104.
• Stromquist (1980) Stromquist, W. 1980. How to cut a cake fairly. American Mathematical Monthly 87(8):640–644.
• Suksompong (2017) Suksompong, W. 2017. Fairly allocating contiguous blocks of indivisible items. In Proceedings of the 10th International Symposium on Algorithmic Game Theory (SAGT), 333–344.

## Appendix A Omitted Proofs

### Proof of Proposition 3.3

Assume that the common valuation is such that whenever . With this valuation, any envy-free allocation must give an equal number of goods to both agents. Since the values of subsets of size can be arbitrary, the algorithm must, in the worst case, query all such subsets in order to determine whether there exists a set such that . Hence the algorithm needs to query subsets in the worst case.

### Proof of Theorem 3.5

Let , and consider an algorithm that always uses at most queries. Whenever the algorithm queries a subset of size , we answer that the subset has value . Suppose that upon termination the algorithm outputs the allocation , where we assume without loss of generality that . If , then we assign to every good a value of 1; this is clearly consistent with our answers, but the allocation is not EFX.

Assume, therefore, that . We assign to every good in a value of 1; this is again consistent with our answers to queries on subsets of . Now, our answers give rise to at most linear constraints on the values of the goods in . Add the constraint that the sum of these values is . The allocation is EFX if and only if every good in has value 1. Since all of our constraints are satisfied when every good has value 1, our set of constraints is satisfiable. There are variables and at most

constraints, so if we compute the reduced row-echelon form of the constraint matrix, we can find a nonempty set of free variables. The remaining variables (i.e., the leading variables) can be written as a linear combination of these free variables. If all free variables are set to 1, all leading variables must also be 1. Hence, we can perturb one of the free variables by a small amount so that all of the leading variables are still nonnegative. This yields a valuation that is consistent with our answers but according to which the allocation returned by the algorithm is not EFX.

### Proof of Lemma 4.1

1. By symmetry it suffices to prove that . Suppose that . We have since otherwise we would have moved the cut point to the right. Then and ; hence is a more equal partition than , a contradiction. If then we also have , and the same argument yields a contradiction.

2. We use binary search to find the leftmost good such that . The left block of the partition will be either or . Indeed, if the left block is smaller than then having as the left block yields a more equal partition, while if it is larger than then having as the left block yields a more equal partition. Moreover, with this choice of partition, any good of value 0 next to the cut point will already belong to the block of lower value. The total number of queries required for the binary search is .

### Proof of Lemma 4.2

We first show that the algorithm computes an EF1 allocation. We consider two cases.

• Case 1: At the beginning of Step 3, (so we return the allocation from Step 2). We have , so and do not envy up to one good. Since , does not envy or , and does not envy . Moreover, if , then by definition of we have , which means that does not envy up to one good. If then , and again does not envy up to one good.

• Case 2: At the beginning of Step 3, . We also have . Since we partition into two blocks according to Lemma 4.1, both blocks are also worth at least , meaning that and do not envy up to one good. We claim that and also do not envy up to one good; the claim for and towards can be shown similarly. Let be the rightmost good in . (If , the claim holds trivially.) It suffices to show that and . By Lemma 4.1, we have and

 u(A′∖{g}) ≤u(A′∪B′)/2 =u(G)−u(C′)2 ≤u(G)/3 ≤u(C′),

Hence the allocation is EF1.

Next, we show that the algorithm can be implemented to use queries. By monotonicity, both finding and in Step 1 and finding in Step 2 can be done by binary search using queries. By Lemma 4.1, the partition in Step 3 can be found using queries. The remaining operations of the algorithm only require a constant number of queries. Hence the total number of queries is .

### Proof of Lemma 4.3

Before we establish the claim, we show an interesting property of Algorithm 2.

###### Lemma A.1.

Assume that the goods lie on a line, and let be a good such that and . Then belongs to the middle bundle in the allocation returned by Algorithm 2.

###### Proof.

By definition of in Algorithm 2, we have that is either itself or to the right of , so . Similarly, . If the allocation is returned, belongs to the middle bundle . Otherwise, we must have , and the algorithm partitions into two blocks according to Lemma 4.1. The subset of to the left of has value at least , while the subset to the right of together with has value at most . It follows that in the resulting partition, must belong to , which is the middle bundle in the allocation . ∎

We now proceed to establish the lemma. Denote by the common valuation of the agents, and assume without loss of generality that . We consider three cases.

• Case 1: There exists a good such that . Then it must be the case that . Set , arrange the remaining goods in a line with and at the two ends, and partition the goods into two contiguous blocks according to Lemma 4.1. Set and to be the two blocks and return the allocation . Clearly, all three goods belong to different bundles. By Lemma 4.1, and do not envy each other up to one good. As receives only one good, and do not envy her up to one good. Since , we have . By Lemma 4.1 again, there is a good in ’s bundle such that if we remove it, then the remaining value of is at most . This implies that does not envy up to one good. A similar argument holds for towards .

• Case 2: There exists a good such that . Set , arrange the remaining goods in a line with and at the two ends, and partition the goods into two contiguous blocks according to Lemma 4.1. Set and to be the two blocks and return the allocation . Clearly, all three goods belong to different bundles. By Lemma 4.1, and do not envy each other up to one good. Moreover, since , both agents do not envy when is removed from ’s bundle. A similar argument as in Case 1 shows that does not envy or up to one good.

• Case 3: for every good . Arrange the goods in a line starting with and at the left and right ends, respectively. Then, keeping aside, add one good at a time to the left end (to the right of ) until the total value of the goods at the left end exceeds . Since , this occurs when we add some good . Add to the right of . If and , add the remaining goods arbitrarily and run Algorithm 2; Lemma A.1 implies that belongs to the middle bundle of the resulting allocation. Else, . Set and remove these two goods from the line. Add the remaining goods arbitrarily to the line, and partition the goods into two contiguous blocks according to Lemma 4.1. Set and to be the two blocks and return the allocation . A similar argument as in Case 2 shows that the resulting allocation is EF1.

Algorithm 2 uses ) queries, and by Lemma 4.1, partitioning into two contiguous blocks according to the lemma also uses queries. In Case 3, we can find by adding all goods except to the line and using binary search; this takes queries. To determine whether there exists a good with , arrange the goods in a line, and use binary search to find the leftmost good such that and the rightmost good such that . Such a good must be one of and . This also takes queries. The remaining operations of the algorithm only requires a constant number of queries. Hence the total number of queries is .

### Proof of Theorem 4.4

We first show that the algorithm computes an EF1 allocation. We consider three cases. In Cases 2 and 3, assume without loss of generality that is the first bundle picked from among , followed by and then .

• Case 1: The algorithm terminates in Step 1. Both and get their favorite bundles and therefore do not envy any other agent, while does not envy any other agent up to one good no matter which bundle she gets.

• Case 2: The algorithm terminates in Step 2 or 3. This means that (either before or after finding large goods). In this case, the allocation is . Since gets her favorite bundles and , she does not envy any other agent. Next, gets her favorite bundle , and the allocation of is computed according to her valuation, so she does not envy any other agent up to one good. Furthermore, note that ’s bundle is a subset of , and would not envy up to one good even if were to get the whole bundle . Also prefers to and the allocation is computed according to her valuation, so she does not envy up to one good.

• Case 3: The algorithm terminates in Step 6. Denote by the bundle among allocated to agent . In this case, the allocation is . Note that any identified large good always remains large. Since and the allocation is computed according to ’s valuation, does not envy up to one good. Since prefers to , she also does not envy up to one good. Next, prefers to both and , and the allocation of is computed according to her valuation, so she does not envy any other agent up to one good. If there are fewer than three identified large goods, then consists of at most two (large) goods. Since prefers to and , and both and contain at most one good, does not envy any other agent up to one good. Else, each contains an identified large good; let be the large good in . We have . Moreover, chooses her favorite bundle from if we were to remove the identified large good from each bundle. Therefore she does not envy any other agent up to one good. Hence the allocation is EF1.

We now show that the algorithm can be implemented to use queries. Step 1 can be done using Algorithm 2 with queries. Step 2 can be done with queries by arranging the goods in in a line and using binary search to find the leftmost good such that , and by using Algorithm 2. Finding a large good in Step 3 can be done similarly using binary search. Step 4 can be done using Lemma 4.3 with queries, and Steps 5 and 6 can be done using a constant number of queries. Hence the total number of queries is .

### Proof of Theorem 5.1

1. Note that in the envy cycle elimination algorithm (Lipton et al., 2004), it suffices to query the value of each agent for the bundles in each partial allocation in order to construct the envy graph. Since there are partial allocations, this takes queries. The cycle elimination step does not require additional queries because the bundles remain the same and the algorithm already knows the value of every agent for every bundle.

2. Fix an ordering of the goods to be allocated, and assume that we allocate them from left to right. Let be an agent with no incoming edge in the envy graph corresponding to the current (partial) allocation. Let be the leftmost unallocated good such that if we allocate all goods up to and including to , then the value of some agent for ’s bundle increases. We then allocate all of these goods to at once. This is a correct implementation of the algorithm because before is allocated, the value of any agent for any bundle in the partial allocation (and thus also the envy graph) remains unchanged.

By monotonicity, we can find the good with queries using binary search. Since there are bundles and the value of each agent for each bundle can change up to times, the number of value changes is at most . Hence the total number of queries is .

## Appendix B Omitted Example

Assume that there are 14 goods lying on a line in this order. The common valuation is such that , , and for . In other words, the values of the goods on the line are

 8,10,1,1,1,1,1,1,1,1,1,1,1,1

in this order, where there are 12 goods of value 1.

In this example, the left cut point falls within , while the right cut point falls between and . Assume that the agents receive the left, middle, and right bundle respectively. If we round the left cut point to the left, then gets value 8 and envies even after removing any one good. On the other hand, if we round the left cut point to the right, then has value 18 and envies her even after removing any good. Note that even if we add the possibilities of rounding one cut point, ignoring the other cut point, and then dividing the remaining goods into two parts according to Lemma 4.1, the same example still shows that none of these additional possibilities works. On the other hand, Algorithm 2 returns the allocation , which is EF1.

## Appendix C Additional Results for Any Number of Agents

First, we consider the class of valuations where a subset of larger size is always weakly preferred to a subset of smaller size. In other words, getting a larger bundle cannot make an agent worse off. This class of valuations applies to settings where all of the goods are roughly equally valuable and there are only minor differences within each agent’s values for the goods. While this is a rather restricted class of valuations, the valuation used by Plaut and Roughgarden (2018) to show that computing an EFX allocation takes an exponential number of queries in the worst case belongs to this class. The following result says that if we relax the fairness notion to EF1, then it is possible to compute a fair allocation using a much smaller number of queries that does not even depend on the number of goods and is only quadratic in the number of agents.

###### Theorem C.1.

For any number of agents with monotonic valuations such that for all and all with , there exists a deterministic algorithm that computes an EF1 allocation using queries in the worst case.

###### Proof.

Let and . Divide the goods arbitrarily into bundles of goods and leftover goods. Order the agents in arbitrary order, and let each of the first agents choose the bundle for which she has the most value among the remaining bundles. Then, give each of the remaining agents one of the remaining bundles along with one of the leftover goods. Since we only need to know the value of the agents for at most bundles, the algorithm can be implemented using queries.

We claim that the resulting allocation is EF1. Indeed, it follows from the assumption on the agents’ valuations that no agent envies another agent with fewer or the same number of goods when a good is removed from the latter agent’s bundle. Moreover, because of the agents’ choices, each agent among the first agents does not envy any agent among the last agents when the leftover good is removed from ’s bundle. This completes the proof. ∎

Next, we consider the setting where the agents have identical monotonic valuations. It is known that an EFX allocation always exists in this setting (Plaut and Roughgarden, 2018). The following lemma shows that if we relax the fairness notion to EF1, we can find a fair allocation that is moreover contiguous. Since contiguity is useful in several situations (see the remark preceding Algorithm 2), the result may also be of independent interest.

###### Lemma C.2.

Assume that the goods lie on a line. For any number of agents with identical monotonic valuations, there exists a contiguous EF1 allocation.

###### Proof.

Suppose that the goods lie in the order , and denote by the common valuation. For any block of consecutive goods with and as the leftmost and rightmost goods respectively, let . (If is empty, set .) One can check that for any two blocks . Let be the set of values of all blocks of consecutive goods (including the empty block, of which we define the value to be 0). For any value and any , define to be the set of all for which there exists consecutive blocks starting from the leftmost good such that for all and the block ends with the good . Our goal is to show that for some ; this will immediately imply the desired result.

We claim that for any and , forms a (possibly empty) block of consecutive integers. To prove the claim, we fix and induct on . The base case follows from the observation that both and are monotonic. For the inductive step, assume that for some and . Then consists of all such that the block from to satisfies for some . Hence it suffices to show that if and is the rightmost good such that the inequalities are still satisfied when the block starts at and ends at , then the inequalities are still satisfied when the block starts at and ends at , for at least one . We consider three cases.

• Case 1: . By definition of , we have