1 Introduction
The ShapleyScarf housing market is a wellstudied formal model for barter markets where the goods can be dormitory rooms or kidneys [Sönmez and Ünver2011]. In the market, each agent owns a single good referred to as a house. The goal is to redistribute the houses to the agents in the most desirable fashion. ShSc74a ShSc74a showed that under strict preferences, a simple yet elegant mechanism called Gale’s Top Trading Cycle (TTC) is polynomialtime, strategyproof and find an allocation that is Pareto optimal and core stable. Even if the preferences are not strict, the algorithm can be suitably generalized while not losing any of the properties (see e.g., [AlcaldeUnzu and Molis2011, Aziz and de Keijzer2012, Saban and Sethuraman2013, Jaramillo and Manjunath2012]). There has also been work where agents have multiunit demand and endowments [Sonoda et al.2014, Papai2007, Konishi et al.2001]. In this paper we focus on singleunit demands.
In the ShapleyScarf market, agents only have preferences over houses. This is a reasonable assumption especially when the exchange is irrevocable. However, if the exchange is temporary, and the original house of an agent will be returned to her, the agent may care as to who temporarily used her house. In order to capture this additional issue, we consider the temporary exchange problem that is a generalisation of the ShapleyScarf housing market. In this generalisation, an agent has preferences over outcomes that take into account both what house the agent gets and also who gets her own house. The assumption of the temporary exchange also makes sense when for example a kidney patient not only cares about getting a suitable kidney but also has preference over who should get his or her donor’s kidney. The setting also applies to reinsurance markets in which the identity of the insurers affects the preferences over arrangements. For this more general setting, we want to study fundamental questions as follows: does a core stable allocation exist and what is the complexity of finding it? What is the complexity of finding a Pareto optimal allocation?
Contributions
We formulate an exchange market setting that is more general than the wellstudied ShapleyScarf market. It models several scenarios where agents are performing a temporary exchange or they care about who gets their resource.
We first focus on core allocations in such settings and show that the core can be empty and it is NPhard to check whether a core stable allocation exists. We also prove that finding a Pareto optimal allocation is NPhard and testing Pareto optimality and weak Pareto optimality is coNPcomplete.
We complement the computational hardness results by presenting succinct ILP and quadratic programming formulations for finding a Pareto optimal allocation. We then consider a weakening of Pareto optimality called Pareto optimality with respect to the responsive set extension. For this particular concept, we propose a general class of polynomialtime algorithms that return any allocation that is individually rational and Pareto optimal with respect to the responsive set extension.
We also consider strategic aspects and present two key impossibility results. Firstly, there exists no coreconsistent and strategyproof mechanism. Secondly, there exists no individually rational, Pareto optimal, and strategyproof mechanism. We then identify restrictions on the preferences in particular housepredominant and tenantpredominant preferences under which we regain the positive axiomatic and computational results that hold for the ShapleyScarf market.
2 Temporary Exchange Problem
An instance of Temporary Exchange Problem is a tuple
where

is the set of agents.

is the set of houses.

Endowment function maps each agent to a house. Each agent owns exactly one house . We will denote by .

is the preference profile that specifies for each agent , the weak order preference relation over .^{*}^{*}*Note that in the standard housing market, the preferences are simply over the set of houses. Our model allows for more complex preferences. The symbol denotes “prefer at least as much”, denotes “strictly more prefer”, and denotes indifference.
A feasible outcome for the setting is an allocation of the houses to the agents. An allocation is a onetoone mapping from to . If is the allocation, we will denote by as the house agent gets. We will denote by the agent who gets house .
Each agent cares about the combination of two things: which house she gets and who gets her own house. We will refer to this combination as the outcome for the agent.
For an agent , the outcome represents the scenario where gets house and gives house to agent . For an agent , the outcome represents the situation where keeps her own house. The outcome represents the situation where swaps her house with . When we write that , it means that prefers outcome to .
Therefore for any allocations and , an agent compares them only from the point of view of what house she gets and who gets her house: Note that an agent will be interested in the outcome only if is it more preferred by her than . Otherwise agent would rather not be part of the exchange. Note that there could be multiple allocation for which the outcome for an agent is the same.
3 Properties of allocations and mechanisms
We consider the standard properties in market design: (i) Pareto optimality: there should be no allocation in which each agent is at least as happy and at least one agent is strictly happier (ii) individual rationality (IR): no agent should have an incentive to leave the allocation program (iii) strategyproofness: no agent should have an incentive to misreport her preferences; and (iv) core stability: an allocation should be such that no set of agents can form a coalition where they just exchange among themselves to get a better outcome than the the allocation. We define these properties as follows.
An allocation is Pareto optimal if there exists no other allocation such that for all and for some . An allocation is weakly Pareto optimal if there exists no other allocation such that for all .
An allocation is individually rational if .
A coalition blocks an allocation on if there exists an allocation on such that for all , it is the case that and . An allocation is core stable if it admits no blocking coalition.
A allocation algorithm is strategyproof if no agent can misreport and get a better outcome.
4 Core stability
We first show that unlike the ShapleyScarf housing market, the Temporary Exchange market may not admit a core stable allocation.
Proposition 1
The core of a Temporary Exchange setting instance can be empty.
Proof.
Consider an instance where



for all

The preferences are as follows.
Our first claim is that for an allocation to be individually rational, it must be that an agent makes no exchange or she makes a pairwise exchange with agent or agent . An agent is only interested in outcomes or or . Suppose gets a house different than . Then she gets either or . Suppose that agent gets house . Then the outcome is only acceptable to only if gets house . Similarly, if agent gets house , then the outcome is only acceptable to only if gets house .
Now consider any individually rational allocation. From the claim established it follows that the allocation involves zero or more pairwise exchanges. Since there are an odd number of agents, at least one agent will not be part of any exchange. Let such as agent be
. Note that is interested to make an pairwise exchange with . Agent also prefers outcome over or . Hence agents in form a blocking coalition. ∎Next, we show that it is NPhard to check whether a core stable allocation exists. The proof uses the example in the proof of Proposition 1.
Proposition 2
Checking whether there exists a core stable allocation is NPhard if there are indifferences in the preferences and even if each agent has at most 6 acceptable outcome pairs.
Proof.
We reduce from the following NPcomplete problem.
Name: ExactCoverBy3Sets (X3C):
Instance: A pair , where is a set and is a collection of subsets of
such that for some positive integer and for each
and each element in appears three times in .
Question: Is there a subcollection that is a partition of ?
For each integer , we have a corresponding gadget instance where ; ; for all The preferences are as follows.
Note that agent is interested to perform exchanges with other agents and from other gadgets.
The overall allocation instance involves agents and houses from all the gadgets so that and .
We claim that there exists a core stable allocation if and only if we have a yes instance of X3C. If we have a no instance of X3C, not every agent can form an exchange with other zero type agents so we have core deviation within gadget such as had in the proof of Proposition 1. Suppose we have a yes instance of X3C. In that case there is a partition of agents in who all get one of their most preferred outcomes. ∎
5 Pareto optimality
We now turn to the problem of finding Pareto optimal allocations.
5.1 Complexity of Pareto optimality
Since a Pareto optimal allocation is guaranteed to exist, we focus on computing such an allocation.
Proposition 3
Checking whether there exists an allocation that is most preferred for each agent is NPcomplete if we allow indifferences in the preferences and even if each agent has at most 4 acceptable outcome pairs.^{†}^{†}†Note that the problem is trivial if each agent has a unique most preferred outcome.
Proof.
We reduce from the following NPcomplete problem.
Name: ExactCoverBy3Sets (X3C):
Instance: A pair , where is a set and is a collection of subsets of
such that for some positive integer and for each
and each element in appears three times in .
Question: Is there a subcollection that is a partition of ?
Consider the setting instance in which ; ; for all . The preferences are as follows.
Then there exists an allocation in which each agent gets a most preferred allocation if and only if there is a yes instance of X3C. ∎
Proposition 4
Finding a Pareto optimal allocation is NPhard if there are indifferences in the preferences even if each agent has at most 4 acceptable outcome pairs.
Proof.
If there exists a polynomialtime algorithm to find a Pareto optimal allocation, then it will return an allocation that is most preferred for each agent if such an allocation exists. ∎
Proposition 5
Checking whether a given allocation is weakly Pareto optimal is coNPcomplete even if preferences are strict and even if each agent has at most 4 acceptable outcome pairs.
Proof.
Use the same proof as the previous one but consider the endowment allocation. We can also make preferences strict. ∎
5.2 ILP and Quadratic programming formulations
Although computing a Pareto optimal allocation is NPhard, one can still write an ILP to compute a maximum utility and hence Pareto optimal allocation. Since agents only express ordinal preferences, one can suppose that each agent has utility for receiving house and having a visitor in her own house .
where is a weighted value corresponding to the preference of agent , receiving house and a visitor in her own house .
One can also write a quadratic program that is even more compact.
Quadratic programming for maximum utility
5.3 Responsive extension preferences
In certain scenarios, an agent may have underlying preferences over houses and over tenants . Her preferences over the combinations of houses and tenants may depend naturally on their underlying preferences. In particular, we study the situation where the preferences are based on the responsive set extension. We consider the responsive set extension that is a subset of responsive preferences that only relates allocations when one allocation is unambiguously at least as preferred as another. We say that agent ’s preferences over are responsive if for any and ,
We say that allocation is RSPO (Pareto optimal with respect to the responsive set extension) if there exists no other allocation such that for all and for some . Note that if an allocation is not RSPO, it admits an unambiguous improvement for the agents.
We say that an allocation is RSIR (individually rational with respect to the responsive set extension) if . Our main result in this section is that there exists a polynomialtime algorithm to compute an RSIR and RSPO allocation.
Proposition 6
There exists a polynomialtime algorithm that returns an individually rational and Pareto optimal allocation with respect to responsive set extension.
First we outline a new problem called RSAA. In this problem an agent gets an acceptable allocation if it gets some tenant agent that is one of the acceptable agents and a house that is one of the acceptable houses.
Lemma 1
RSAA can be solved in polynomial time.
Proof.
In the algorithm we first force symmetry in multiple ways. If an agent does not have as one of his acceptable tenants, then cannot be one of ’s acceptable houses and is removed from ’s list if does not have house as one of this acceptable houses, then is removed from ’s acceptable set of agents. After making the preferences symmetric in this way, we can simply check whether there is a perfect matching that matches each agent to one his acceptable houses. We argue why this sufficient.
We will frame the problem in a perfect matching context. Suppose there is a RSAA problem with a set of agents and a set of houses . Every agent has two most preferred sets, , the preferred houses for the agent, and , the preferred tenants to their own house. A RSAA solution requires that an agent is matched to a house owned by agent iff finds acceptable as a tenant and agent considers house acceptable. Hence the setup of a matching problem over the bipartite graph with vertices with edges existing iff agent prefers house and agent prefers tenant . Then a perfect matching on corresponds onetoone with a solution of RSAA. ∎
Lemma 1 is interesting because similar problems are NPcomplete for several matching settings in which a match has three dimensions [Chan et al.2016, Huzhang et al.2017, Ng and Hirschberg1991]. We now show that the polynomialtime algorithm for RSAA can be used as a subroutine to compute an RSIR and RSPO allocation. In order to do so we present an adaptation and generalisation of the Preference Refinement Algorithm [Aziz et al.2013] that is defined for hedonic coalition formation and that requires complete preferences. For our problem we do not have complete preferences but each preference relation has multidimensional components—one involving a house and one involving a tenant agent.
Lemma 2
If RSAA runs in polynomial time for any allocation problem, then a RSParetoOptimal allocation can be computed in polynomial time.
Proof.
An oracle to solve RSAA can be used to compute an RSParetoOptimal and RSIR allocation. The details are specified in Algorithm 1.
We first start with the agent’s actual preferences. An acceptable allocation indeed exists: one in which each agent stays where she is. We now start changing the agents’ preferences, one component preference of one agent at a time. For any given agent , we see whether an acceptable allocation still exists if the least preferred acceptable elements of the component preference are now unacceptable. If an allocation exists, in that case those elements are permanently marked as unacceptable and the algorithm proceeds. We do so until no agent’s preference can be modified. At this point, we know that a perfect allocation is Pareto optimal with respect to the responsive preferences. ∎
6 Incentives
Up till now we have assumed that agents act sincerely and report their truthful preferences. In this section, we explore scenarios where agents may misreport their preferences. We show that for the Temporary Exchange markets, strategyproofness is incompatible with other desirable axioms.
Proposition 7
There exists no individually rational, Pareto optimal, and strategyproof mechanism.
Proof.
Consider the following instance of the problem.



for all

The preferences are as follows.
The only two individually rational allocations are and .
Allocation :
Allocation :
If the outcome under the original preferences is , then agent 2 can misreport as follows to obtain an outcome in bold which is the only Pareto optimal and individually rational allocation under the misreported preferences.
In an individually rational allocation either gets outcome or . If gets outcome , then gets outcome or . If gets outcome , then the outcome is which is not Pareto optimal. If gets outcome , then gets outcome . Then gets outcome which implies that and can swap each others’ houses to get a Pareto improvement. Thus in an individually rational allocation, gets outcome . Hence gets outcome . By Pareto optimality, gets outcome and gets . Under the allocation in bold, gets outcome thereby violating strategyproofness.
We now suppose that the outcome of the original preferences is . If the outcome is , then 1 can misreport to obtain an outcomes or in bold which are the only Pareto optimal and individually rational allocations under the following preferences.
Allocation
Allocation
Allocation already provides a beneficial outcome for agent thereby violating strategyproofness. Suppose the outcome is allocation . In that case agent can misreport as follows to obtain the only Pareto optimal and individually rational allocation which provides an improvement for agent thereby violating strategyproofness.
This concludes the proof.
∎
We say that a mechanism is coreconsistent if it returns a core stable allocation whenever a core stable allocation exists. The same argument can be used to prove that there exists no mechanism that is coreconsistent and strategyproof.
Proposition 8
There exists no coreconsistent and strategyproof mechanism.
In the subsequent sections, we show negative results from the previous sections can be circumvented if we consider special structure on the preferences.
7 Predominant Preferences
In this section, we consider preference restrictions under which we obtain positive axiomatic results.
7.1 Housepredominant Preferences
A particularly restricted version of consistent preferences is in which agents have strict underlying preferences over the houses, care predominantly about the houses and use the preferences over agents as a tiebreaker. We will refer to these preferences as housepredominant preferences. The core is nonempty for these preferences. This follows from the fact that the TTC mechanism designed for basic housing markets works for our setting. We first describe the TTC mechanisms.
TTC: For a housing market with strict preferences, we first construct the corresponding directed graph where and is specified as follows: each house points to its owner and each agent points to the most preferred house in the graph. Then, we start from an agent and walk arbitrarily along the edges until a cycle is completed. This cycle is removed from . Within the removed cycle, each agent gets the house he was pointing to. The graph is adjusted so that the remaining agents point to the most preferred houses among the remaining houses. The same step is repeated until the graph is empty.
Proposition 9
For housepredominant preferences in which agents have strict preferences over houses, the TTC rule is core stable and Pareto optimal.
Proof.
We first argue for core stability. When any agent is removed from the graph along with his allocated house , then is a maximally preferred house for from among the remaining houses. Therefore cannot be in a blocking coalition with the agents remaining in the graph.
We now argue for Pareto optimality. Let be the th trading cycle that is removed from the trading cycle graph. In any allocation in which none of the agents are worse off than in the allocation produced by TTC, these agents must be allocated to houses in . Taking this as the base case, it follows by easy induction that in , the agents of must be allocated to houses in the th trading cycle. Next, suppose that is a agent in for some . Then no house in is more preferred by than the house that the TTC mechanism assigns him to. It follows that no agent is strictly better off in than in the allocation produced by TTC. ∎
Proposition 10
For housepredominant preferences in which agents have strict preferences over houses, the TTC rule is strategyproof.
The argument is similar to the strategyproof argument for TTC for the standard ShapleyScarf market. An agent cannot get a better house by misreporting. Suppose the agent gets the same house but a different agent takes her house. But this is not possible by the specification of TTC because the agent gets the house she points to in a cycle.
7.2 Tenantpredominant Preferences
We can also turn around the problem completely so as to consider a setting in which agents have strict underlying preferences over other agents, care predominantly about the tenants and use the preferences over houses as a tiebreaker. We will refer to such preferences as “tenantpredominant preferences.”
TTTC: For a housing market with strict preferences, we first construct the corresponding directed graph where and is specified as follows: each agent points to its house and each house points to the agent most preferred by its owner. Then, we start from an agent and walk arbitrarily along the edges until a cycle is completed. This cycle is removed from . Within the removed cycle, each house it taken by the agent it was pointing to. The graph is adjusted so that the remaining houses point to the agent most preferred by its owner. The same step is repeated until the graph is empty.
The following propositions can be proved for TTTC and tenantpredominant preferences. The arguments for the propositions above are very similar to those of TTC for housepredominant preferences.
Proposition 11
For tenantpredominant preferences which agents have strict preferences over other agents, the TTTC mechanism is core stable and Pareto optimal.
Proposition 12
For tenantpredominant preferences which agents have strict preferences over other agents, the TTTC rule is strategyproof.
The same results also hold for “tenantonly preferences” in which agents have strict preferences over tenants and do not care about which house they get.
8 Conclusions
We considered a natural generalization of the ShapleyScarf housing market with ordinal preferences. Several positive axiomatic and computational results that hold for the ShapleyScarf housing market no longer hold for the temporary exchange market. On the other hand, we present some positive algorithmic and axiomatic results when preferences have more structure.
The problem can be extended in several ways. Typically when exchanging holiday homes, it may be the case that the exact duration of holidays may not coincide for the people in the market. An extended model would allow for time windows and having back to back bookings.
We presented an algorithm to compute an RSPO allocation. One can also consider the core. A coalition RSblocks an allocation on if there exists an allocation on such that for all , it is the case that and . An allocation is RS core stable if it admits no RS blocking coalition. If all preferences over houses are strict, then TTC returns an RS core stable outcome and if all preferences over agents are strict, then TTTC returns an RS core stable outcome. For weak preferences, the following problems appear to be interesting. Does an RS core stable allocation always exist? What is the complexity of computing such an allocation?
References
 [AlcaldeUnzu and Molis2011] J. AlcaldeUnzu and E. Molis. Exchange of indivisible goods and indifferences: The top trading absorbing sets mechanisms. Games and Economic Behavior, 73(1):1–16, 2011.

[Aziz and de Keijzer2012]
H. Aziz and B. de Keijzer.
Housing markets with indifferences: a tale of two mechanisms.
In
Proceedings of the 26th AAAI Conference on Artificial Intelligence (AAAI)
, pages 1249–1255, 2012.  [Aziz et al.2013] H. Aziz, F. Brandt, and P. Harrenstein. Pareto optimality in coalition formation. Games and Economic Behavior, 82:562–581, 2013.
 [Chan et al.2016] P. H. Chan, X. Huang, Z. Liu, C. Zhang, and S. Zhang. Assignment and pricing in roommate market. In Proceedings of the 30th AAAI Conference on Artificial Intelligence (AAAI), pages 446–452. AAAI Press, 2016.
 [Huzhang et al.2017] G. Huzhang, X. Huang, S. Zhang, and X. Bei. Online roommate allocation problem. In Proceedings of the TwentySixth International Joint Conference on Artificial Intelligence, IJCAI17, pages 235–241, 2017.
 [Jaramillo and Manjunath2012] P. Jaramillo and V. Manjunath. The difference indifference makes in strategyproof allocation of objects. Journal of Economic Theory, 147(5):1913–1946, September 2012.
 [Konishi et al.2001] H. Konishi, T. Quint, and J. Wako. On the ShapleyScarf economy: the case of multiple types of indivisible goods. Journal of Mathematical Economics, 35(1):1–15, 2001.
 [Ng and Hirschberg1991] C. Ng and D. S. Hirschberg. Threedimensional stable matching problems. SIAM Journal on Discrete Mathematics, 4(2):245–252, 1991.
 [Papai2007] S. Papai. Exchange in a general market with indivisible goods. Journal of Economic Theory, 132:208–235, 2007.
 [Saban and Sethuraman2013] D. Saban and J. Sethuraman. House allocation with indifferences: a generalization and a unified view. In Proceedings of the 14th ACM Conference on Electronic Commerce (ACMEC), pages 803–820. ACM Press, 2013.
 [Shapley and Scarf1974] L. S. Shapley and H. Scarf. On cores and indivisibility. Journal of Mathematical Economics, 1(1):23–37, 1974.
 [Sönmez and Ünver2011] T. Sönmez and M. U. Ünver. Matching, allocation, and exchange of discrete resources. In J. Benhabib, M. O. Jackson, and A. Bisin, editors, Handbook of Social Economics, volume 1, chapter 17, pages 781–852. Elsevier, 2011.
 [Sonoda et al.2014] A. Sonoda, T. Todo, H. Sun, and M. Yokoo. Two case studies for trading multiple indivisible goods with indifferences. In Proceedings of the 28th AAAI Conference on Artificial Intelligence (AAAI), pages 791–797. AAAI Press, 2014.