1 Introduction
The resource allocation problem has been widely studied in mathematics and economics for almost a century, Ste48; Ste49; Nash50; AzizCaragiannis2018; caragiannis2019; Camacho2020. The main elements in the problem are agents and resources. The goal is to distribute (or allocate) the resources among the agents in a “good manner.” The agents can represent individuals, objects, government institutions, among others, depending on the application. The set of resources or goods to be distributed can be divisible or indivisible. In general, these sets are considered finite. In this work we study the problem of allocating indivisible resources among a group of agents, with the aim of satisfying both the group and each individual in the best possible way.
This topic has many applications, for instance in solving divorce disputes, dividing an inheritance, sharing apartment rents, or even assigning household chores. In the last decade, there has been a considerable interest in computational aspects of this problem. In particular, in Artificial Intelligence and more specifically in MultiAgent Systems, these problems are studied and renamed MultiAgent Resource Allocations (MARA) problems
Aziz2016; CEM17.Finding a correct distribution of resources consists of distributing all the resources among the agents fairly and efficiently.
To establish efficiency and some criterion of fairness, it is necessary to consider the preferences that each agent has over resources. In general, these preferences over resources are established through additive utility functions.
Traditionally, fairness is established through properties such as envyfreeness or proportionality. However, there are situations where it is impossible to find allocations that meet any of these properties. Thus, other weaker versions of fairness, such as envyfree up to one good Budish2011 or proportionality up to one good conitzer2017fair are considered. Although there are results that, under certain conditions, guarantee the existence of allocations with some fairness property (see caragiannis2019), finding such allocations is a computationally hard problem dekeijzer2009.
Efficiency, also known as Pareto efficiency or Pareto optimality, is related to the group satisfaction by an allocation. One way to find efficient allocations is through social welfare functions. Caragianis et al, caragiannis2019, showed that, under additive utility functions, it is always possible to find an allocation that is Pareto optimal and envyfree up to one good. Actually, they prove that some of the allocations that maximize the Nash welfare are Pareto optimal and envyfree up to one good. Unfortunately, finding allocations which maximize the Nash welfare is also an NPHard problem dekeijzer2009 (see also Aziz2016).
Searching allocations which maximize the utilitarian social welfare is in general a more tractable problem from the computational point of view and, because of that, commonly used. A wellknown result is that, under additive utility functions, allocations that maximize this social welfare are Pareto optimal (see Theorem 2). However, the converse is not true. In Example 1 is proposed an allocation that is Pareto optimal and does not maximize utilitarian social welfare. In general, allocations that maximize this social welfare do not always satisfy fairness properties. In Example 1, we find that no allocation that maximizes utilitarian social welfare is envy free up to one good.
When we consider additive utility functions, it is possible to define a procedure that allows to find all the allocations that maximize utilitarian social welfare, see Camacho2020. Moreover, finding these allocations is a computationally tractable problem. Actually, in this work we propose a very simple algorithm in polynomial time, for scenarios of additive utilities, that finds an allocation which maximizes the utilitarian social welfare.
Unlike the allocations that maximize the Nash social welfare which are EF, the allocations that maximize the utilitarian social welfare are not, in general, EF. Moreover, there are additive scenarios in which the property EF fails for every allocation which maximizes the utilitarian social welfare (see Example 1). Indeed, in that example we can see that the Nash and the utilitarian social welfare are independent.
However, for some specialized scenarios, there are very simple algorithms in polynomial time which find EF even EFX allocations. That is the case of identical utilities (see Barman et al. Barman2018). In this work, we consider a class of additive functions, called the buyer utility functions. This class is more general than the class of identical utilities. In the framework of these utility functions, the following results are established:
Moreover, we propose a basic algorithm in which finds, under additive utility functions, an allocation that maximizes the utilitarian social welfare (Theorem 4).
The rest of this work is organized as follows. Section 2 introduces the concepts and problems studied in this paper. In Section 3, we propose a very simple and tractable algorithm for maximizing the utilitarian social welfare and study its justice properties in the case of buyer utilities. In Section 4, we show some experimental results of our algorithm at work and make some comparisons with the algorithms proposed by Bartman et al. Barman2018. We conclude in Section 5 with some final remarks. The proofs can be found in Appendix A.
2 Preliminaries
The set of agents is denoted by and the set of resources is denoted by . So, and .
An allocation of resources is a function . For all agent , is the set of resources (or bundle) assigned to . The set of all possible allocations is denoted by . The number of possible allocations depends on and , given that . The set of all subsets of is denoted by . The preference of agents over resources is established through utility functions, as defined below:
Definition 1.
A function is an additive utility function if:

, ;

;

with , .
For each , denotes the additive utility function associated to . For simplicity, will be denoted by . If every agent establishes its preferences through an additive utility function in a problem of indivisible resource allocation, we say that it is an additive scenario.
Definition 2.
Let be a function . We say that is a buyer utility function if:

is an additive utility function;

for every there exists an unique such that .
We say that we are in a buyer scenario when every agent of the resource allocation problem has a buyer utility function. A buyer scenario in which the value is not taken by the utility functions is called a scenario of identical utility functions. These scenarios were considered by Barman et al. Barman2018
Note that the buyer scenario is a simplification of the Fisher market model in economy BS00.
Clearly, if is an additive utility function such that for each , , then is a buyer utility function. This type of function is known as binary utility function, see amanatidis2020. Thus, the buyer scenarios are a generalization of identical scenarios and a generalization of binary scenarios.
2.1 Fairness, efficiency, and social welfare
An attractive fairness criterion in additive scenarios is the absence of envy. If no agent strictly prefers the bundle assigned to another agent instead of its own bundle, the allocation is envyfree. The following is the formal definition:
Definition 3.
Let be in , is an envyfree allocation (EF) if:
(1) 
If there exists an agent such that for some , then the agent envies the agent . The property EF is the most desirable property, but in a simple example of an indivisible resource with two agents it is impossible to find an allocation without envy. In the literature Budish2011; caragiannis2019; amanatidis2020, weaker versions of the envy free property can be found. The weakest among these is envy free up to one good. The following definition establishes the main weak envy free notions.
Definition 4.
Let be in , is an envyfree up to one good (EF) allocation if
(2) 
is an envyfree up to any positively valued good (EFX) allocation if
(3) 
is an envyfree up to any good (EFX) allocation if
(4) 
It is clear that in the case of additive utilities we have:
The efficiency, also known as Pareto efficiency or Pareto optimality, aims at characterizing when the allocation best satisfies the group.
Definition 5.
Let and be in .

is Pareto dominated by , if:


is Pareto optimal (PO), if it is not Pareto dominated by another allocation.
One way to measure the social satisfaction of the agents is through the Nash and utilitarian social welfare functions.
Definition 6.
Let .

The utilitarian social welfare of , denoted by , is defined by
(5) and .

The Nash social welfare, denoted by , is defined by
(6) and .
Fortunately, Caragiannis and colleagues caragiannis2019 showed that under an additive scenario it is possible to find EF1 and PO resource allocations. Actually, they prove the following theorem:
Theorem 1.
[Caragianis et al. caragiannis2019] Under additive scenario, every allocation^{1}^{1}1Actually, the Theorem as stated is true when the maximum Nash social welfare is strictly positive. When it is zero it is necessary to impose that the set of agents having a good is a maximal set (see caragiannis2019). that maximizes Nash social welfare is EF1 and PO.
Another wellknown result is that any allocation that maximizes utilitarian social welfare is PO:
Theorem 2.
Under additive scenario, let be in , if , then is PO.
Example 1.
Let be the set of resources and the set of agents where each agent establishes its preferences over every resource, with utility functions according to Table 1.
10  10  
3  2 
Let and be the allocations defined by Table 2.
1  1  
2  1 
The utility by bundle received by each agent and social welfare are showed in Tab 3.
1  2  

20  0  20  0  
10  3  13  30 
It is easy to see that is the only allocation which maximizes utilitarian social welfare. However, is not because the agent 2 envies agent 1, , but even after removing or from , envy does not disappear:
The maximum Nash social welfare is reached at 30, so maximizes the Nash social welfare. By Theorem 1 is , but it does not maximize the utilitarian social welfare. In the following table, we identify the properties that satisfy and ; if an allocation satisfies a property we use ✓ and ✕ otherwise.
PO  EF1  

✓  ✕  ✓  ✕  
✓  ✓  ✕  ✓ 
The following result establishes that if an allocation distributes resources to the agents that maximize them, then this allocation maximizes the utilitarian social welfare. One can find a straightforward proof of this result, using a matrix approach, in Camacho2020.
Theorem 3.
Under an additive scenario, if and for all , , then .
3 An algorithm to find maximum utilitarian social welfare and its behavior in buyer scenarios
In this section, we present first an algorithm to build a resource allocation which maximizes the utilitarian social welfare. We assume an additive scenario, and . Let be the real numbers defined in the following way: for each , . We will assume that every is strictly positive.
Remark 1.
Note that the requirement that every is strictly positive has no impact. Indeed if there is a resource such that , that is, all the agents give 0 as valuation to this particular resource, we can suppress in the set of resources because an allocation that maximizes the utilitarian social welfare in the set of modified resources can be extended in any way to the set of original resources preserving this property of being maximal.
The allocation which maximizes the utilitarian social welfare, denoted , is built following the next algorithm:
Definition 7 (Algorithm for building the allocation ).

For to :

We take .

.

Let and be the sets given by:
(7) and
(8) where is the position of .

Let be the minimum of .

Allocation of :
(9) 
Updating the vector of partial utilities, for all :

Notice that, . Therefore, and ; so, there exists a minimum for . On the other hand, , is an additive utility function, then each position of , , is the partial valuation given by agent to its assigned bundle up to step .
The interesting feature about is that it maximizes utilitarian social welfare. More precisely, we have the following theorem:
Theorem 4.
Under an additive scenario, and it is obtained in operations.
Corollary 1.
Under an additive scenario, is .
3.1 The utilitarian social welfare and fairness
In this subsection, we will show that in buyer scenarios it is possible to build an allocation that maximizes utilitarian social welfare and that is also envyfree up to one good. Remember that in general additive scenarios this is not always possible, as we could see in Example 1. Indeed, in these scenarios, the allocation, defined in (9), satisfies EF1 and PO.
Moreover, with a very slight modification of the algorithm for building , we will obtain another allocation, , which is EFX.
The following example shows the behavior of some allocations in a buyer scenario.
Example 2.
Suppose that and that each resource is valued as according to Table 5.
500  200  50  100  250 
Let e b the set of agents; each agent establishes its preferences over each resource using Table 6.
500  200  50  0  0  
500  0  50  100  250  
500  200  0  100  0 
Note that all agents prefer the resource and they are willing to pay the value of 500. The resource is preferred by agents 1 and 3, and they are willing to pay the value of 200; the resource , whose value is 50, is preferred by agents 1 and 2. The value of resource is 100 and is preferred by agents 2 and 3; whereas, resource , with a value of 250, is only preferred by agent 2. If for , the function is extended additively over each subset ; that is, , , then each is a buyer utility function, i.e., it is a buyer scenario.
In this scenario, we will consider four allocations in order to illustrate their behavior with respect to the properties EF1, PO, and . Let , , and be the allocations defined by Table 7, that shows the agent number who receives the resource.
1  3  3  3  2  
1  3  2  3  2  
1  3  2  2  2  
1  1  2  3  2 
In Table 8, we show the utility assigned by each agent to its received bundle, and the social welfare in each allocation.
1  2  3  

500  250  300  1050  37500000  
500  300  300  1100  45000000  
500  400  200  1100  40000000  
700  300  100  1100  21000000 
The properties of each allocation are described in Table 9. For more details about the verification of these properties see Appendix.
PO  EF1  

✕  ✓  ✕  ✕  
✓  ✓  ✓  ✓  
✓  ✓  ✓  ✕  
✓  ✕  ✓  ✕ 
It is important to note that is an allocation EF1 and it is not in . satisfies all the properties. is EF1, PO, it is in but it is not in . Finally, is and it is in but it is neither EF1 nor in .
The following theorem shows that under a buyer scenario, the converse of Theorem 2 is satisfied; i.e., having the property PO and belonging to are equivalent.
Theorem 5.
Assume a buyer scenario and let be an allocation in . Then, is PO if, and only if, .
We have seen in Example 1 that . However, under buyer scenarios, Theorems 1 and 5 together, tell us that . This is important and will be stated in the following result.
Theorem 6.
Under a buyer scenario, each allocation that maximizes Nash social welfare also maximizes utilitarian social welfare.
Now, we give a result which guarantees the existence, under buyer scenarios, of allocations maximizing the utilitarian social welfare and satisfying the EF1 property.
Theorem 7.
Under a buyer scenario, there exists an allocation that is EF1 and maximizes utilitarian social welfare.
Note that, in general additive scenarios, the previous result does not hold as Example 1 reveals.
Consider the allocation from Definition 7. By Corollary 1, is PO. Unfortunately, in general additive scenarios, does not satisfy the EF1 property. This can be seen through Example 1: the allocation , the unique allocation that maximizes the utilitarian social welfare, is indeed the allocation , which is not EF1, see Table 4. However, under a buyer scenario, Theorem 7 guarantees the existence of allocations that maximize utilitarian social welfare and satisfy property EF1. Note that the existential proof of Theorem 7 is based in finding an allocation that maximizes the Nash social welfare. In the following theorem, we will show that under a buyer scenario, the allocation is EF1 and PO.
Theorem 8.
Under a buyer scenario, there exists an allocation which is EF and PO and is obtained in . Indeed is such an allocation.
A slight modification of the algorithm given by Definition 7 which consists in taking one more step: reordering the resources in descending ordering (after the “prices" ) produces an allocation which is furthermore EFX. This is stated in the following result.
Theorem 9.
Under a buyer scenario, there exists an allocation which maximizes the utilitarian social welfare and is EFX and PO. Moreover, if is the number of resources and is the number of agents, this allocation is produced by an algorithm in .
It is interesting to observe that the algorithm producing is quite similar to Barman et al. algorithm Barman2018 producing an allocation EFX, in the case of identical scenarios. In fact, in identical scenarios, the notions EFX and EFX coincide. This is not the case in buyer scenarios. The following example, in the framework of a buyer scenario, shows that , the allocation given by the algorithm of Definition 7 modified, is EFX but it is not EFX.
Example 3.
Let’s consider the following Buyer scenario where , . Table 10 shows the preferences that each agent gives to each resource.
20  0  10  2  0  0  3  1  
20  0  10  2  11  19  0  1  
20  9  0  2  0  19  3  1 
Now, using the algorithm of Definition 7 modified, we get the following allocation .
1  3  1  3  2  2  3  3 
Then, in Table 12 we show the utility assigned by each agent to its received bundle, and the social welfare in each allocation.
30  30  15  75  13500 
Notice that agent envies agent because
which means that
Since was obtained using the modified algorithm of Definition 7, we obtain that is . Now we check that does not satisfy . Observe that
so, it follows that
(10) 
Thus, the property is not satisfied.
In the following result, we will establish conditions to guarantee that is .
Theorem 10.
Under a buyer scenario, if is an allocation and for all such that we have that , then is .
4 Efficiency of the proposed algorithm in buyer scenarios with identical valuations
In this section, we compare our proposed algorithm with AlgIdentical algorithm proposed in Barman2018, which is a greedy algorithm for buyer scenarios with identical valuation functions. In these scenarios, for any good and any pair of agents , the valuation of to the good is equal to the valuation of ; . We compare both algorithms under identical valuation functions and get their computational cost.
In definition 7, we presented a general algorithm to build the allocation ; Algorithm 1 presents the respective pseudocode under buyer scenarios, see Definition 2. Notice that the ,, and sets are implemented through the operator for buyer scenarios. In this algorithm we code the information of agent utilities through a valuation matrix in which the entry contains the utility that the agent gives to the resource .
We implemented a version of Buyer algorithm to receive identical valuations, called BuyerIdentical, Algorithm 2 shows the pseudocode of this version. Note that this version does not check that the utility is different from .
AlgIdentical algorithm follows a greedy approach that starts sorting the resources; later, it allocates each resource to the agent with minimal sum of received utilities. AlgIdentical guarantees to find EFX allocations, which are also EF1. Both AlgIdentical and our algorithm, under buyer scenarios with identical valuations, find EF1 and PO allocations.
Remember that Buyer algorithm runs in and AlgIdentical runs in . We implemented the BuyerIdentical and AlgIdentical using Google Colaboratory, the last as is described in Barman2018.
We experimentally compared the implementations in order to visualize which algorithm is faster. With the aim of having a just comparison, we generate random scenarios. Each scenario has different number of resources and agents, this is the problem size . The evaluation set has different combinations varying the size of and . The evaluations were repeated times with each size, in order to obtain the average measurement of the running time.
Table 13
shows the results on average with their standard deviation only for the problems size
where we note that for this case . The first column has the problem size, which is the number of agents and the number of resources. The next columns show the time of BuyerIdentical and AlgIdentical algorithms. It is important to note that the BuyerIdentical and AlgIdentical algorithm run in a similar time to problems of small size. However, from problems of big size onward, the running time difference grows considerably.BuyerIdentical  AlgIdentical  

[s]  [s]  
[s]  [s]  
[s]  [s]  
[s]  [s]  
[s]  [s]  
[s]  [s]  
[s]  [s]  
[s]  [s]  
[s]  [s]  
[s]  [s] 
Figure 1 shows the comparison of running time between BuyerIdentical and AlgIdentical, varying the problem size. We can see that the extra cost of the sorting step added by AlgIdentical has a computational cost when the problem size grows.
5 Concluding remarks
In this work, we have studied fair and efficient allocation for indivisible resources when the valuations are defined through buyer utility functions. We showed that there exists an allocation that is envyfree up to one good (EF1) and maximizes utilitarian social welfare () using buyer utility functions. This result can slightly be modified to produce an allocation that is envyfree up to any positively valued good (EFX). In this framework some relationships between fairness and efficiency notions are characterized. These relationships were foreseen in [Camacho et al. Camacho2020].
Actually, we build algorithms for finding an allocation which are and and and at the same time are . They run in polynomialtime. However, the algorithm finding an allocation is computationally slightly better than the algorithm finding an allocation .
As a matter of fact, the difference between the two algorithms is captured in the experimental study in Section 4.
As future work related to this research is the quest of simple algorithms for finding allocations that maximize the Nash social welfare in the case of buyer scenarios.
Appendix A Proofs
The following observation is very useful in the proofs. Its proof is obvious by equations (9), (7) and (8).
Remark 2.
We assume an additive scenario. Let be the allocation of Definition 7. For every and every such that , we have
Proof of Theorem 4: Let be the allocation of Definition 7. By Remark 2, part 2, and Theorem 3, we have that . The proposed algorithm starts initializing the vector of partial utilities with zeros, which has one position by each one of the agents. This step demands operations. The step2 allocates the resources finding the agent with minimum partial utility in each iteration, following (8). Allocating resources, finding the minimum of agents demands operations. In the next steps, the agent receives the resource in (9); for all the resources, this step and the updating of the vector of partial utilities runs in . Building the resource allocation runs in , thus, we have that the proposed algorithm is in .
Proof of Theorem 5: Let , and we suppose that does not maximize utilitarian social welfare. We want to show that is not Pareto optimal. Since all agents consider buyer utility functions and does not maximize utilitarian social welfare, by Theorem 3, there exist and such that and with and . Let given by
note that for all with , ; but and , then . Therefore, is Pareto dominated by . So, is not PO.
Conversely, we suppose that is not PO. We want to show that does not maximize the utilitarian social welfare. As is not PO, there is such that is Pareto dominated by ; that is, for all , and there is an agent such that . Given that preferences of agents are established by additive utility functions, then
Thus, does not maximize utilitarian social welfare.
Proof of Theorem 7: Let be an allocation that maximizes Nash social welfare. By Theorem 6, maximizes utilitarian social welfare. And, by Theorem 1, is EF1.
In order to prove Theorem 8, we establish the following technical lemma.
Lemma 1.
Proof: Agents have buyer utility functions, then for each , there exists such that . Let and we define the following sets:
As and are buyer utility functions, then and, in consequence,
As is defined by equation (9) and is additive, then
Again, by additivity of
Proof of Theorem 8: We suppose that , is a buyer utility function. We consider the allocation defined as (9). By Theorem 4, maximizes utilitarian social welfare in operations, by Theorem 5, is PO. We want to show that is EF1. Suppose that there exists such that
(12) 
for some agent . As is a buyer utility, by Lemma 1, it is enough to show that there exists such that . Clearly, . Otherwise, by (11) and (12), we have , which is a contradiction because is non negative. Let , where is the last resource assigned to and it is preferred by and . Since and , by Remark 2, in part 1,
By additivity of ,
Using the transitivity of , we have
(13) 
As and are buyer utility functions, then the utility that agents and assign to each resource in is equal, so
(14) 
(15) 
Now, by equation (11) and additivity of ,
and, by equation (15),
so,
But, , and using transitivity,
(16) 
Therefore, is EF1.
Proof of Theorem 9: The argument of the proof is similar to the proof of the Theorem 8. Let be in such that . By Lemma 1,
As is sorted in descending order after the prices of each resource, then for all ,
by equation (16)
So, for all
Thus, is .
Proof of Theorem 10: Let be allocation. Let and be in such that envies . By hypothesis, for all , we have that . And, as is , then is .
Proof of Properties in Example 2: We give details of the properties fulfilled by the allocations in Table 9.
From Theorem 3 and Table 5, it is easy to see that the maximum utilitarian welfare is reached in 1100. Moreover; , and maximize . For Theorem 2 and Table 8, we have that , , and are PO. On the other hand, from Table 8, we can observe that agents 1 and 3 in the allocations and , have the same utility for the received bundle; but, in , agent 2 improves its utility. Then, is Pareto dominated by . Therefore, is not PO.
A search determined that the maximum Nash social welfare is reached at 45000000. Then is a maximum Nash social welfare and, by Theorem 1, is EF1. Moreover, allocations and are EF1. In fact, is EF by Theorem 4. For , agents and envy agent , however, the envy disappears when eliminating . Finally, is no EF1, because agent 3 envy agent 1, and