The Thirty-Third AAAI Conference on Artificial Intelligence (AAAI-19)
Object Reachability via Swaps along a Line
Sen Huang, Mingyu Xiao
∗School of Computer Science and Engineering University of Electronic Science and Technology of China
{huangsen47, myxiao}@gmail.com
Abstract
The HOUSING MARKET problem is a widely studied re-sources allocation problem. In this problem, each agent can only receive a single object and has preferences over all ob-jects. Starting from an initial endowment, we want to reach a certain assignment via a sequence of rational trades. We consider the problem whether an object is reachable for a given agent under a social network, where a trade between two agents is allowed if they are neighbors in the network and no participant has a deficit from the trade. Assume that the preferences of the agents are strict (no tie is allowed). This problem is polynomially solvable in a star-network and NP-complete in a tree-network. It is left as a challenging open problem whether the problem is polynomially solvable when the network is a path. We answer this open problem posi-tively by giving a polynomial-time algorithm. Furthermore, we show that the problem on a path will become NP-hard when the preferences of the agents are weak (ties are al-lowed).
Introduction
Allocating indivisible objects to agents is an important prob-lem in both computer science and economics. A widely stud-ied setting is that each agent can only receive one single ob-ject and each agent has preferences over obob-jects. This prob-lem was previously called ASSIGNMENTproblem (Garden-fors 1973; Wilson 1977) and now we prefer to call it HOUSE ALLOCATIONproblem (Abdulkadiro˘glu and S¨onmez 1998; Manlove 2013). When each agent is initially endowed with an object and we want to reallocate objects under some conditions without any monetary transfers, the problem is known as HOUSING MARKET problem (Shapley and Scarf 1974). HOUSING MARKET has several real-life ap-plications such as allocation of housings (Abdulkadiro˘glu and S¨onmez 1999), organ exchange (Roth, S¨onmez, and
¨
Unver 2004) and so on. There are two different prefer-ence sets for agents. One isstrict, which is a full ordinal list of all objects, and the other one isweak, where agents
∗The corresponding author and supported by the National Nat-ural Science Foundation of China, under grants 61772115 and 61370071.
Copyright c2019, Association for the Advancement of Artificial Intelligence (www.aaai.org). All rights reserved.
are allowed to be indifferent between objects. Both erence sets have been widely studied. Under strict pref-erences, the celebrated Top Trading Cycle rule (Shapley and Scarf 1974) has several key desirable properties. Some modifications of Top Trading Cyclerule, called Top
Trad-ing AbsorbTrad-ing Sets rule and Top Cycles rule, were
intro-duced for weak preferences (Alcalde-Unzu and Molis 2011; Jaramillo and Manjunath 2012), which also hold some good properties. More studies of HOUSING MARKET un-der the two preference sets from different aspects can be found in the literature (Jaramillo and Manjunath 2012; Aziz and De Keijzer 2012; Saban and Sethuraman 2013; Ehlers 2014; Sonoda et al. 2014; Ahmad 2017).
Some rules allow a single exchange involving many agents. It is natural and fundamental to consider exchanges being bilateral deals (swaps), i.e., each exchange of ob-jects happens only between two agents. A swap between two agents is allowed when they are mutually beneficial from the exchange. This natural rule for HOUSINGMARKET has been studied in the literature (Damamme et al. 2015; Gourv`es, Lesca, and Wilczynski 2017).
In some models, it is implicitly assumed that all agents have a tie with others. However, some agents often do not know each other and do not have the capacity to exchange even they can mutually get benefits. So Gourv`es, Lesca, and Wilczynski (2017) studied HOUSING MARKET where the agents are embedded in a social network to denote the ability to exchange objects between them. In fact, recently it is a hot topic to study resources allocation problems over social net-works and analyze the influences of netnet-works. Abebe, Kleberg, and Parkes (2017) and Bei, Qiao, and Zhang (2017) in-troduced social network of agents into the FAIRDIVISION problem of cake cutting. Bredereck, Kaczmarczyk, and Nie-dermeier (2018) and Beynier et al. (2018) also considered network-based FAIR DIVISIONin allocating indivisible re-sources.
their ability to exchange their objects. Two agents may swap their items under two conditions: they are neighbors in the social network, and they find it mutually profitable (or no one will become worse under weak preferences). We focus on OBJECTREACHABILITYunder this model: to determine whether an object is reachable for a given agent from the initial endowment via swaps. Damamme et al. (2015) firstly proved that the problem is NP-hard even to decide whether any one of a subset of objects is reachable for each agent. Gourv`es, Lesca, and Wilczynski (2017) further showed that OBJECT REACHABILITY is polynomially solvable under star-structures and NP-complete under tree-structures. For the network being a path, they solved the special case where the given agent is an endpoint (a leaf) in the path and left it unsolved for the general case. All the above results are un-der strict preferences. In this paper, we will answer this open problem positively by giving a polynomial-time algorithm for OBJECT REACHABILITY in a path under strict prefer-ences, and also prove that OBJECTREACHABILITYin a path under weak preferences is NP-hard.
Although paths are rather simple graph structures, OB -JECT REACHABILITY in a path is not easy at all, as mentioned in (Gourv`es, Lesca, and Wilczynski 2017) that “Despite its apparent simplicity, REACHABLE OBJECT (OBJECT REACHABILITY) in a path is a challenging open problem when no restriction on the agent’s location is made. We believe that this case is at the frontier of tractability.” Our algorithm involves several techniques and needs to call solvers for the 2-SATproblem, but it is still interesting.
The following part of the paper is organized as follows. Section 2 provides some backgrounds. Section 3 tackles the reachability of an object for an agent in a path-network un-der strict preferences. Section 4 shows the NP-hardness of OBJECTREACHABILITYin a path under weak preferences. The proofs of the lemmas and theorems marked with “?” are omitted due to the limitation of space, which can be found in the full version of this paper.
Background
Model. There are a setN = {1, ..., n} of nagents and a setO = {o1, ..., on} of n objects. An assignment σ is a
mapping fromNtoO, whereσ(i)is the object held by agent iinσ. We also useσT(o
i)to denote the agent who holds
objectoi in σ. Each agent holds exactly one object at all
time. Initially, the agents are endowed with objects, and the initial endowment is denoted byσ0. We assume w.l.o.g that σ0(i) =oifor every agenti.
Each agent has preferences regarding objects. A strict
preferenceis expressed as a full linear order of all objects.
Agenti’s preference is denoted byi, andoa i ob
indi-cates the fact that agenti prefers objectoa than object ob.
The whole strict preference profile for all agents is repre-sented by. Forweak preferences, agents are allowed to be indifferent between objects. For two disjoint subsets of ob-jectsS1andS2, we useS1iS2to indicate that all objects
inS1(resp.,S2) are indifferent for agentiand agentiprefer any object inS1than any object inS2. We useoa i obto
denote that agentilikesoa at least as same asob. Two
re-lationsoa i ob andob i oa together imply thatoa and
ob are indifferent for agent i. We may useto denote the
whole weak preference profile for all agents.
LetG= (N, E)be an undirected graph as the social net-work among agents, where the edges capture the capability of communication and exchange between two agents. An in-stance of HOUSINGMARKETis a tuple(N, O,, G, σ0)or (N, O,, G, σ0)according to the preferences being strict or weak.
Dynamics.The approach we take in this paper is dynamic, and we focus on individually rational trades between two agents. A trade isindividual rationalif each participant re-ceives an object at least as good as the one currently held, i.e., for two agentsiandj and an assignmentσ, the trade betweeniandjonσis individual rational ifσ(j)i σ(i)
andσ(i)j σ(j).
We require that every trade is performed between neigh-bors in the social networkG. Individual rational trades de-fined according to G are called swaps. A swap is an ex-change, where two participants have the capability to com-municate.
A sequence of swaps can be represented as a sequence of assignments (σ0, σ1, σ2, ..., σt) such that for any i ∈
{1, ..., t}, σi results from a swap from σi−1. An
assign-ment σ0 is reachable if there exists a sequence of swaps
(σ0, σ1, σ2, ..., σt)such thatσt = σ0. An objecto ∈ O is
reachablefor an agenti∈Nif there is a sequence of swaps
(σ0, σ1, σ2, ..., σt)such thatσt(i) =o.
Problems.We consider the problem of checking whether an object is reachable for an agent from the initial endowment via swaps.
OBJECTREACHABILITY
Instance:(N, O,, G, σ0), an agentk∈N, and an object ol∈O.
Question:Whether is objectolreachable for agentk?
When the preferences are strict, we call the problem STRICT OBJECT REACHABILITY. When the preferences are weak, we call the problem WEAK OBJECT REACHA -BILITY. When the social network is a path P, we call the problem OBJECT REACHABILITY in a path. For OBJECT REACHABILITY in a path, an instance will be denoted by I = (N, O,, P, σ0, k ∈ N, ol ∈ O), where we assume
w.l.o.g thatl < k. For path structures, we always assume w.l.o.g that the agents are listed as 1,2, . . . , n on a line from left to right with an edge between any two consecutive agents. Below is an example for OBJECT REACHABILITY in a path.
Example 1. There are four agents. The path structure, pref-erence profile and a sequence of swaps are given below.
P : 1 2 3 4 1 :o2o1o3o4
σ0: o1 o2 o3 o4 2 :o4o3o1o2 σ1: o2 o1 o3 o4 3 :o1o4o3o2 σ2: o2 o3 o1 o4 4 :o3o1o2o4
within the preferences. After a swap between agents 1 and 2
fromσ0we getσ1and after a swap between agents 2 and 3
fromσ1we getσ2. The objecto1is reachable for agent3.
STRICT
OBJECT
REACHABILITY
in a Path
STRICT OBJECT REACHABILITY is known to be NP-complete when the network is a tree and polynomially solvable when the network is a star (Gourv`es, Lesca, and Wilczynski 2017). It is left unsolved whether the problem with the network being a path is NP-hard or not. We reveal some properties of STRICTOBJECTREACHABILITYunder the path structure and design a polynomial time algorithm for it. In the remaining part of this section, we assume that the preferences are strict and the network is a path.
Recall that the problem is to check whether an objectol
is reachable for an agent kwithl < k. The main idea of our algorithm is as follows. First, we show that the instance is equivalent to the instance after deleting all agents (and the corresponding endowed objects) on the left of agentl. Thus, we can assume the problem is to check whether ob-jecto1is reachable for an agentk. Second, we prove that if o1 is reachable for agentkthen there is an objecton0 with n0
≥ k that should be moved to agentk−1 in the final assignment and we can ignore all agents and objects on the right of agentn0. We guessn0by letting it be each possible
value betweenkandnand get at mostncandidate instances. These instances are calledneat(o1, on0, k)-CONSTRAINED instances. A neat(o1, on0, k)-CONSTRAINEDinstance con-tains only n0 agents and it is to check whether there is
a reachable assignment σ0, calledcompatible assignment, such thatσ0(k) = o1 andσ0(k
−1) = on0. Third, we are going to find compatible assignments. In a neat(o1, on0, k) -CONSTRAINED instance, in every compatible assignment each objectoi will be moved to either the left or the right
of its original position in the path. We prove that for each direction, there is at most one possible position il (or ir
for the right direction) for each objectoi. We can compute
il andir directly in polynomial time. Since there are still
two possible final positions for each object, we do not get a feasible assignment yet. Fourth, we reduce the subprob-lem to 2-SAT and determine which ofil andir should be
chose for each agentiby solving a 2-SATinstance. We show that each feasible assignment obtained in this step is corre-sponding to a reachable assignment for the neat(o1, on0, k) -CONSTRAINEDinstance. Finally, we can solve the original problem in polynomial time, because the original instance is a yes-instance if and only if at least one of the candidate neat (o1, on0, k)-CONSTRAINEDinstances is a yes-instance.
In fact, when the preferences are strict, we have the fol-lowing observations and lemmas.
Observation 1. Given a sequence of swaps(σ0, σ1, . . . , σt)
and an agentj ∈N. For anyi∈ {0,1, . . . , t−1}, it holds eitherσi+1(j) =σi(j)orσi+1(j)jσi(j).
It implies the following lemma.
Lemma 1. Given a sequence of swaps(σ0, σ1, . . . , σt). For
any two integersi < j in{0,1, . . . , t} and any agentq ∈ N, ifσi(q) = σj(q), thenσd(q) = σi(q)for any integer
i≤d≤j.
Lemma 1 also says that an object will not ‘visit’ an agent twice. This property is widely used in similar allocation problems under strict preferences.
Next, we analyze properties under the constraint that the social network is a path. In a swap, the moving of an object is on theright directionif it is moved from agentito agent i+ 1, and the moving of an object is on theleft direction if it is moved from agent i to agenti−1. In each swap, one object is moved on the right direction and one object is moved on the left direction. We study the tracks of the objects in a feasible assignment sequence.
Lemma 2. ? For a sequence of swaps(σ0, σ1, . . . , σ t), if
σT
t(oi) = j for an objectoi, then there are exactly|j−i|
swaps includesoi. Furthermore, all the|j−i|movings ofoi
are on the right direction ifi < j, and all the|j−i|movings ofoiare on the left direction ifi > j.
Lemma 3. ?Let(σ0, σ1, . . . , σt)be a sequence of swaps,
andoa andobbe two objects witha < b. Leta0 =σTt(oa)
andb0=σT
t(ob). Ifa0≤aorb0≥b, thena0< b0.
Lemma 1 shows that any object can only move on one direction. Lemma 3 shows that when an object moves on the right direction, all objects initially allocated on the left of it can not move to the right of it at any time; when an object moves on the left direction, all objects initially allocated on the right of it can not move to the left of it at any time.
In fact, if we want to move an objectolto an agentkwith
k > l, we may not need to move any object on the left ofol,
i.e., objectsol0withl0< l. Equipped with Lemma 3, we can prove
Lemma 4. ?If objectolis reachable for agentk, then there
is a feasible assignment sequence(σ0, σ1, . . . , σt)such that
σT
t(ol) =k, andσt(i) =σ0(i)for alli < lifl≤kand for
alli > lifl≥k.
For an instance I = (N, O,, P, σ0, k, ol) of STRICT
OBJECT REACHABILITY in a path with l < k, let I0= (N0, O0,0, P0, σ00, k, o
l)denote the instance obtained
from I by deleting agents {1,2, . . . , l − 1} and objects {o1, o2, . . . , ol−1}. In other words, we let N0 = {l, l+ 1, . . . , n},O0 =
{ol, ol+1, . . . , on}, and0, P0 andσ00 be the corresponding subsets of, P andσ0.
Lemma 5. Objectolis reachable for agentkin the instance
Iif and only if objectol is reachable for agentkin the
in-stanceI0.
By Lemma 5, we can always assume that the instance of STRICT OBJECT REACHABILITY in a path is to check whether the objecto1is reachable for an agentk.
Assume that objecto1is reachable for agentk. For a se-quence of swaps(σ0, σ1, . . . , σt)such thatσt(o1) =k, there
are in the left direction. Therefore, we have the following observation.
Observation 2. It holds thatn0≥k.
Our idea is to transform our problem to the following con-strained problem: to determine whether there is a reachable assignment σsuch that σ(k−1) = on0 andσ(k) = o1, wheren0
≥ k. We do not know the exact value ofn0. So
we search by lettingn0 be each value in{k, k+ 1, . . . , n}.
This will only increase the running time bound by a factor of n. We denote the above constrained problem by(o1, on0, k) -CONSTRAINEDproblem.
Lemma 6. An instanceI = (N, O,, P, σ0, k, o1)is yes if and only if at least one of the(o1, on0, k)-CONSTRAINED instances forn0
∈ {k, k+ 1, . . . , n}is yes.
For an (o1, on0, k)-CONSTRAINED instance I, we use I−n0 to denote the instance obtained from I by deleting agents {n0 + 1, n0 + 2, . . . , n
} and objects {on0+1, on0+2, . . . , on}.
Lemma 7. ? An(o1, o
n0, k)-CONSTRAINED instanceI is yes if and only if the instanceI−n0 is yes.
By Lemma 7, we can ignore all agents on the right ofn0
in an(o1, on0, k)-CONSTRAINEDinstance. An(o1, on0, k) -CONSTRAINEDinstance is calledneatifn0is the last agent.
We may simply consider neat (o1, on0, k)-CONSTRAINED instances only. For any two integersaandb, we use[a, b] to denote the set of integers betweenaandb(including a andb).
Lemma 8. ? Let(σ0, σ1, . . . , σt)be a sequence of swaps,
andoaandobbe two objects witha < b. Leta0 =σtT(oa),
b0 =σT
t(ob)andQ= [a, a0]∩[b, b0]. Assume thatQ6=∅.
(a)Ifa0> aandb0 > b, it holds thato
aq obfor allq∈Q.
(b)Ifa0< aandb0 < b, it holds thato
bqoafor allq∈Q.
See Figure 1 for an illustration for Lemma 8(a).
1 . . . a . . . b . . . q . . . a0 . . . b0 . . . n
Q oaq ob
oa ob
Figure 1: An illustration for Lemma 8(a)
Lemma 9. ? Let (σ0, σ1, . . . , σ
t)be a sequence of swaps
for a neat (o1, on0, k)-CONSTRAINED instance such that
σT
t(o1) = kandσTt(on0) =k−1, andoa andob be two objects witha < b. Leta0 =σT
t(oa)andb0 =σtT(ob).
As-sume thata0 > a,b0 < bandQ= [a, a0]
∩[b, b0]
6
=∅. Let
Q0= [a+ 1, a0]∩[b, b0].
(a)There is a swap includingoa andobwhich happens
be-tween agentc−1andc, wherec=a0+b0−k+ 1∈Q0.
(b)It holds thatob q oafor allmax(a, b0) ≤q < c, and
oa q obfor allc≤q≤min(a0, b).
See Figure 2 for an illustration for Lemma 9.
1 . . . a . . . b0 . . .c−1 c . . . a0 . . . b . . . n0
q ob q oa
q oaq ob
oa ob
Figure 2: An illustration for Lemma 9
Given a neat(o1, on0, k)-CONSTRAINEDinstance and an assignmentσtsuch thatσTt(o1) =kandσtT(on0) =k−1. We show some conditions for σt to be a feasible
assign-ment. For any two objects oa andob, we leta0 = σTt(oa)
and b0 = σT
t(ob). We say oa and ob are intersected if
Q= [a, a0]
∩[b, b0]is not an empty set. There are three kinds
of intersections, which are corresponding to Lemma 8(a), Lemma 8(b) and Lemma 9. We say a pair of objectsoaand
ob (a < b) arecompatiblein assignmentσtif there are
ei-ther not intersected or intersected and satisfying one of the follows:
1. whena0 > aandb0 > b, it holds that a0 < b0
(corre-sponding to Lemma 3) andoa q obfor all agentsq ∈ Q
(corresponding to Lemma 8(a));
2. whena0 < aandb0 < b, it holds that a0 < b0
(corre-sponding to Lemma 3) andob q oafor all agentsq ∈ Q
(corresponding to Lemma 8(b));
3. whena0 > aandb0< b, it holds thatc=a0+b0−k+ 1∈
Q0 = Q
\ {a},ob q oa for allmax(a, b0) ≤ q < c, and
oa q ob for all c ≤ q ≤ min(a0, b) (corresponding to
Lemma 9).
An assignmentσiscompatibleif it holdsσ(i)6=oifor any
agentiand any pair of objects in it are compatible. Lemma 3, Lemma 8 and Lemma 9 directly imply that
Lemma 10. If σt is a reachable assignment for a neat
(o1, on0, k)-CONSTRAINEDinstance such thatσT
t(o1) =k
andσT
t(on0) =k−1, thenσtis compatible.
Lemma 11. ?Letσ
tbe a compatible assignment for a neat
(o1, on0, k)-CONSTRAINEDinstance such thatσT
t(o1) =k
andσT
t(on0) =k−1. For any two objectsox−1andox, if σT
t(ox−1)> x−1andσtT(ox)< x, then the swap between
agentsx−1andxinσ0is feasible. Letσ1denote the
as-signment after the swap betweenx−1andxinσ0. Thenσt
is still compatible by takingσ1as the initial endowment.1
Based on Lemma 11 we will prove the following lemma.
Lemma 12. ? Let σ
t be an assignment for a neat
(o1, on0, k)-CONSTRAINEDinstance such thatσtT(o1) =k
andσT
t(on0) =k−1. Ifσtis compatible, thenσtis a reach-able assignment.
By Lemma 12, to solve a neat(o1, on0, k)-CONSTRAINED instance, we only need to find a compatible assignment.
1
If the swap is happened between agents1and 2, then objecto1
will be moved to agent2inσ1and we will may not be able to get
an(o1, on0, k)-CONSTRAINEDinstance by lettingσ1be the initial
endowment. For this case, we will delete agent1and objectσ1(1)
to keep objecto1in the first agent. More details will be given in the
Computing Compatible Assignments
In a compatible assignment, object o1 will be assigned to agentkand objecton0 will be assigned to agentk−1. We consider other objectsoifori∈ {2,3, . . . , n0−1}. In a
com-patible assignment, objectoiwill not be assigned to agenti
since each agent will attend in at least one swap including objecto1oron0. There are two possible cases:oiis assigned to agenti0such thati0 < i;o
iis assigned to agenti0such that
i0 > i. We say thato
iis moved to theleft sidefor the
for-mer case and moved to theright sidefor the latter case. We will show that for each direction, there is only one possible position for each objectoiin a compatible assignment.
First, we consideri∈ {2,3, . . . , k−1}. Assume that ob-jectoiis moved to the left side in a compatible assignment.
Thus,o1andoiare intersected and the intersection is of the
case in Lemma 9. We find the index i0 such that i0
≤ i, oi i0−1 o1 ando1 j oifor each j ∈ {i0, i0+ 1, . . . , i}. We can see thati0 is the only possible agent for object o
i
to makeo1 andoi are compatible ifoiis moved to the left
side. We useilto denote this agent if it exists fori. Assume
that objectoiis moved to the right side in a compatible
as-signment. Sinceo1will be moved to agentkandoiwill be
moved to the right side, by Lemma 3 we know thatoiwill be
moved to the right ofo1, i.e., an agenti00withi00> k. Thus,
oiandon0 are intersected and the intersection is of the case in Lemma 9. We find the indexi0such thati0> k,o
i i0 on0 andon0 j oifor eachj ∈ {k−1, k, . . . , i0−1}. We can see thati0 is the only possible agent for object o
i to make
on0andoiare compatible ifoiis moved to the right side. We useirto denote this agent if it exists fori.
Second, we consideri∈ {k, k+ 1, . . . , n0−1}. In fact, the structure of neat (o1, on0, k)-CONSTRAINED instances is symmetrical. We can rename the agents on the path from left to right as{n0, n0−1, . . . ,1}instead of{1,2, . . . , n0}
and then this case becomes the above case. We can com-pute il and ir for each i ∈ {k, k+ 1, . . . , n0 −1} in a
similar way. Therefore, we can compute il andir for all
i∈ {2,3, . . . , n0−1}if they exist.
If none ofilandirexists for somei, then this instance is
a no-instance. If only one ofilandir exists, then objectoi
must be assigned to this agent in any compatible assignment. The hardest case is that both of il andir exist, where we
may not know which agent the object will be assigned to in the compatible assignment. For this case, we will rely on algorithms for 2-SATto find possible solutions.
For each agentj, we will useRjto store all possible
ob-jects that may be assigned to agent j in a compatible as-signment. We use the following procedure to maintainRj.
Initially, we letRk−1 ={on0},Rk ={o1}, andRi =∅for all other agenti. Then for eachi ∈ {2,3, . . . , n0−1}, we
computeilandirand addoi intoRil andRir. After this, we can do the following to make the size of eachRjat most
2. While there is a setRj0becoming an empty set, stop and
report the instance is a no-instance; while there is a setRj0
containing only one objectoi0 and the objectoi0appears in
two setsRj0 andRj00, deleteoi0 fromRj00.
The correctness of the third step is based on the fact that agentj0should get one object. If there is only one candidate objectoi0for agentj0, thenoi0can only be assigned to agent
j0, no possible to agentj0
0.
We also analyze the running time of the above procedure to computeRj. For each objectoi, we can computeilandir
inO(n). Therefore, we useO(n2)time to set the values for all setsRjin the first two steps. To updateRi, we may
exe-cute at mostniterations in the third step and each iteration can be executed inO(n). Therefore, the procedure running times inO(n2)time.
Lemma 13. ?After the above procedure, either the instance
is a no-instance or it holds that 1 ≤ |Rj| ≤ 2 for each
j∈ {1,2, . . . , n0}.
For a setRjcontaining only one objectoi, we know that
the objectoishould be assigned to agentjin any compatible
assignment. For setsRjcontaining two objects, we still need
to design which object is assigned to this agent such that we can get a compatible assignment.
We will reduce the remaining problem to 2-SAT. The in-stance contains n0 variables
{x1, x2, . . . , xn0} correspond-ing to the n0 objects. Whenx
i = 1, it means that the
ob-jectoi moves on the right direction, i.e, we will assign it to
the agentirin the compatible assignment. Whenxi = 0, it
means that the objectoimoves on the left direction and we
will assign it to the agentil in the compatible assignment.
We have two kinds of clauses, called agent clauses and com-patible clauses.
For each setRj, we associate|Rj|literals with it. If there
is an objectoisuch thatil =j, we associate literalxiwith
Rj; if there is an objectoisuch thatir=j, we associate
lit-eralxiwithRj. For each setRjof size 1 (let the associated
literal be`j), we construct one clause containing only one
literalcj : `j. For each setRj of size 2 (let the associated
literals be`1
j and`2j), we construct two clausescj1:`1j∨`1j
andcj2 : `1j ∨`2j. These clauses are calledagent clauses.
The agent clauses are to guarantee that exactly one object is assigned to each agent.
For each pair of sets Rj and Ri, we construct several
clauses according to the definition of compatibility. For any two objectsoj0 ∈ Rj (the corresponding literal associated toRj is`j) andoi0 ∈ Ri(the corresponding literal associ-ated toRi is`i), we say that`j and`iarecompatibleifoj0 andoi0 are compatible whenoj0 is assigned to agentjand oi0 is assigned to agentiin the assignment. If`jand`i are not compatible, then eitheroj0 cannot be assigned to agent joroi0 cannot be assigned to agentiin any compatible as-signment. So we construct one compatible clause:`j ∨`i
for each pair of incompatible pair`j and`i. Since each set
contains at most two objects, for each pair of sets Rj and
Ri, we will create at most2×2 = 4clauses. In fact, when
there are four clauses for a pair, the instance will become a no-instance, since no matter what objects assigned to agents jandi, there is no compatible assignment. In the following example, we will illustrate the construct of agent clauses and compatible clauses.
We can see that each clause contains at most two literals and then the instance is a 2-SATinstance. The construction of 2-SATinstances implies that
assign-ment if and only if the corresponding neat (o1, on0, k) -CONSTRAINEDinstance has a compatible assignment.
The main steps of the whole algorithm to solve STRICT OBJECTREACHABILITYin a path are listed in Algorithm 1. The correctness of the algorithm follows from Lemma 5, Lemma 6, Lemma 7 and Lemma 14. Next, we analyze the running time bound of it. The dominating part of the run-ning time is taken by the computation for neat(o1, on0, k) -CONSTRAINED instances. Next, we consider the running time used for solving each neat(o1, on0, k)-CONSTRAINED instance. By the above analysis, we useO(n2)time to com-pute the final values for all sets Rj. To construct 2-SAT
instance, we construct at most 2n agent clauses in O(n) time and construct at most4 n2
compatible clauses, each of which will takeO(n)time to check the compatibility. So the 2-SAT instance can be constructed inO(n3)time. We use theO(n+m)-time algorithm for 2-SAT(Aspvall, Plass, and Tarjan 1979) to solve our instance, wherem=O(n2). There are at most n neat (o1, on0, k)-CONSTRAINED in-stances. In total, we useO(n4)time.
Theorem 1. STRICT OBJECT REACHABILITY in a path can be solved inO(n4)time.
Algorithm 1: Main steps to solve STRICT OBJECT REACHABILITYin a path
Input:An instance(N, O,, P, σ, k∈N, o1∈O) Output:To determine whethero1is reachable fork
1 fork≤n0≤ndo
2 Construct the neat(o1, on0, k)-CONSTRAINED instance by deleting agentiand objectoifor all
n0 < i
≤n;
3 Computeirandilfor all1≤i≤n0if it exist
according to Lemma 9;
4 Construct the setRj of all possible objects that may
be assigned to each agentjaccording to the result in the above step, whereRk−1={on0}and Rk={o1};
5 Iteratively updateRjaccording to the procedure
before Lemma 13;
6 Construct a 2-SATinstance as follows: construct a variable for each object, construct agent clauses according toRj, and construct compatible clauses
for all incompatible pairs;
7 Determine whether the 2-SATinstance is satisfiable;
8 ifthe2-SATinstance isyesthen
9 return yes;
10 return no.
We give an example to show the steps to compute a com-patible assignment for a neat(o1, on0, k)-CONSTRAINED in-stance.
Example 2. Consider a neat (o1, on0, k)-CONSTRAINED
instance with n0 = 8 and k = 5as the top right figure.
We computeirandilfor all1 ≤i ≤n0 by the above
pro-1 2 3
4 5
6 7
8
1 :o2o8o7o1
2 :o5o3o4o1o8o2
3 :o6o4o1o8o5o3
4 :o8o1o6o3o2o7o5o4
5 :o1o8o3o7o6o4o2o5
6 :o3o2o5o8o4o6
7 :o4o6o2o8o1o3o7
8 :o7o3o5o4o1o8
cedure, the values of which are listed in the top right table.
agenti 1 2 3 4 5 6 7 8
il - 1 2 3 2 3 - 4
ir 5 6 6 7 6 7 8
-We constructRjfor each agentjaccording to this table,
and then update them as doing in the procedure. After the
update, it holds that1 ≤ |Rj| ≤ 2for all1 ≤j ≤n0. We
reduce the remaining problem to2-SAT. The agent clauses
for each setRjare given in the last column of the table.
Set Initial Updated Agent clauses
R1 {o2} {o2} x2
R2 {o3, o5} {o3, o5} x3∨x5, x3∨x5 R3 {o4, o6} {o4, o6} x4∨x6, x4∨x6
R4 {o8} {o8} x8
R5 {o1} {o1} x1
R6 {o2, o3, o5} {o3, o5} x3∨x5, x3∨x5 R7 {o4, o6} {o4, o6} x4∨x6, x4∨x6
R8 {o7} {o7} x7
Next, we construct compatible clauses for all incompat-ible pairs. We check all pairs of objects and find that there
are only two incompatible cases:o4ando5are incompatible
ifo4ando5are moved to agent3and agent2, respectively;
o4ando5are incompatible ifo4ando5are moved to agent
7and agent6, respectively. The compatible clauses are
x4∨x5 and x4∨x5.
By using the O(n+m) time algorithm for 2-SAT
(As-pvall, Plass, and Tarjan 1979), we get a feasible variables assignment(1,0,0,0,1,1,1,0)for the2-SATinstance. The corresponding swap sequence constructed via variables as-signment above is given below.
Remark:Although Step 4 of our algorithm will compute possible valuesilandirfor eachi, it does not mean that
ob-jectoimust be reachable forilorir. In the above example,
objecto2 is not reachable for agent 2r = 6 since agent 3
prefers its initial objecto3too2and theno2cannot go to the right direction. In our algorithm, the compatible clauses can avoid assigning an object to an unreachable valueilorir. In
the above example, if objecto2goes to agent 6, then some objectoiwithi >2will go to agent 1 or 2 and we will get
σ
0:
o
1o
2o
3o
4o
5o
6o
7o
8σ
1:
o
2o
1o
3o
4o
5o
6o
7o
8σ
2:
o
2o
3o
1o
4o
5o
6o
7o
8σ
3:
o
2o
3o
4o
1o
5o
6o
7o
8σ
4:
o
2o
3o
4o
1o
5o
6o
8o
7σ
5:
o
2o
3o
4o
1o
5o
8o
6o
7σ
6:
o
2o
3o
4o
1o
8o
5o
6o
7σ
7:
o
2o
3o
4o
8o
1o
5o
6o
7P
:
1
2
3
4
5
6
7
8
WEAK
OBJECT
REACHABILITY
in a Path
We have proved that STRICT OBJECTREACHABILITYin a path is polynomially solvable. Next, we show that WEAK OBJECT REACHABILITY in a path is NP-hard. One of the most important properties is that Lemma 1 will not hold for WEAK OBJECT REACHABILITYand an object may ‘visit’ an agent more than one time. Our proof is a modification of the reduction in (Gourv`es, Lesca, and Wilczynski 2017) to prove the NP-hardness of STRICTOBJECTREACHABILITY in a tree.
Theorem 2. WEAK OBJECT REACHABILITY is NP-hard even when the network is a path.
We give a reduction from the known NP-complete prob-lem 2P1N-SAT (Yoshinaka 2005). In a 2P1N-SAT instance, we are given a setV ={v1, v2, . . . , vn}of variables and a
setC = {C1, C2, . . . , Cm}of clauses overV such that
ev-ery variable occurs 3 times inCwith 2 positive literals and 1 negative literal. The question is to check whether there is an variable assignment satisfyingC. For a 2P1N-SAT instance ISAT, we construct an instance IW OR of WEAK OBJECT
REACHABILITYon a path such thatISAT is a yes-instance
if and only ifIW ORis a yes-instance.
The instanceIW ORcontains6n+m+ 1agents and
ob-jects, which are constructed as follows. There is an agent namedT. For each clauseCi (i ∈ {1, . . . , m}), we
intro-duce an agent also namedCi. For each variablevi, we add
six agents, named asXni
i , X pi
i , X qi
i , A
3
i, A
2
i andA
1
i. They
form a path of length 5 in the order as showed below. We call the path ablockand denote it byBi. The names of the six
agents have certain meaning:Xni
i means that the negative
literal ofvi appears in the clauseCni;X
pi
i andX qi
i mean
that the positive literals ofvi appear in the two clausesCpi andCqi;A
3
i, A2i andA1i are three auxiliary agents.
Xnii
X
ipiX
iqiA
3iA
2iA
1iB
iThe whole path is connected in the order showed below.
B
n. . .
B1
C
m. . .
C1
T
In the initial assignmentσ0, objecttis assigned to agent T, objectci is assigned to agentCi fori ∈ {1,2, . . . , m},
objectaji is assigned to agentA j
i for eachi∈ {1,2, . . . , n}
andj∈ {1,2,3}, andoni
i (resp.,o pi
i ando qi
i ) is assigned to
agentXni
i (resp.,X pi
i andX qi
i ) for eachi∈ {1,2, . . . , n}.
Next, we define the preference profile. We only show the objects that each agent prefers at least as its initial one and all other objects can be put behind its initial endowment in any order. The initial endowment is denoted by a square in the preference. LetLibe the set of the objects associated
with the literals in clauseCi, i.e.,Liis the set of objectsonaa,
opb
b ando qc
c withna=i,pb =iorqc=i. For each variable
vi, we define a set of objectsWi = {c1, . . . , cm} ∪ {o nj
j :
j > i} ∪ {opj
j :j 6=i} ∪ {o qj
j : j > i} ∪ {a l
j : j < i, l=
1,2,3}. We are ready to give the preferences for the agents. First, we consider the preferences forT andCi. The
fol-lowing preferences ensure that whenCi holds an object in
Li for eachi∈ {1, . . . , m}, objecttis reachable for agent
Cm via a sequence ofm swaps betweenCi andCi−1 for i= 1, . . . , m, whereC0=T.
T :L1t ;
Ci : Li+1 t Li c1 Li−1 . . . ci−1 L1ci , for all1≤i≤m−1;
Cm:tLmc1Lm−1. . .cm−1L1cm .
Next, we consider the preferences for the agents in each blockBi. The following preferences ensure that at most one
ofoni
i and{o pi
i , o qi
i }can be moved to the right of the block,
which will indicate the corresponding variable is either true or false. Ifoni
i is moved to the right of the block, we will
as-sign the corresponding variable false; if some of{opi
i , o qi
i }
is moved to the right of the block, we will assign the cor-responding variable true. We use the preference of A3
i to
control this. Furthermore, we useA1
i,A2i andA3i to
(tem-porarily) holdoni
i (oro pi
i ando qi
i ) if they do not need to be
moved to the right of the block. Xni
i :Wi∪ {a1i, a2i, a3i, o pi
i , o qi
i } o ni
i ,
Xqi
i :Wi∪ {a1i, a
2
i, a
3
i, o ni
i , o pi
i } o qi
i ,
Xpi
i :Wi∪ {a1i, a2i, a3i, o qi
i , o ni
i } o pi
i ,
A1
i :Wi∪ {a1i , a2i, a3i, o pi
i , o qi
i , o ni
i },
A2
i :Wi∪ {a1i, a
2
i , a
3
i, o pi
i , o qi
i , o ni
i },
A3
i :Wi∪{a1i, a2i, o pi
i , o qi
i } o ni
i a
3
i , for all1≤i≤n.
The instance IW OR is to determine whether objectt is
reachable for agentCm.
Lemma 15. A 2P1N-SAT instanceISAT is yes if and only
if the corresponding instance IW OR of WEAK OBJECT
REACHABILITYin a path is yes.
Proof Sketch. If t is reachable for cm, there are m swaps
including t which happen between Ci and Ci+1 for i ∈ {0,1, . . . , m−1}, whereC0 = T. Note that the swap be-tweenCiandCi+1(whereCiholds the objectt) can happen
literal corresponding to the objecta∈Li+1to be true for all agentsCi to get a satisfying assignment forISAT because
the construction of each blockBi does not allow bothonii
and one ofopi
i ando qi
i moving to the right of the block
ac-cording to the construction of the blockBithe preference of
A3
i.
On the other hand, if there is a satisfied assignmentτfor ISAT, we can construct a reachable assignment forIW OR.
For each variablevi, if it is true inτ, we moveopii ando qi
i
to agentsA3
i andA
2
i; if it is false inτ, we moveo ni
i to agent
A2
i. These objects are calledtrue objects. All these happen
within each block. After this procedure, we move true ob-jectsona
a ,o pb
b andoqcc to agentCj withj =na,j =pbor
j =qcone by one in an order whereCjwith smallerjfirst
gets its object in Lj. During this procedure, once another
true object is moved out of its positionA3
i orA
2
i (this may
happen when the true object is on the moving path of an-other true object toCj), we will simply move it back by one
swap. So in each iteration only one true object is moved out of its current positionA3
i orA2i and it is moved to its final
positionCjdirectly.
Conclusion
In this paper, we mainly investigate OBJECT REACHABIL -ITY that asks whether an object is reachable for a given agent. We show that when the network is a path, WEAK OBJECT REACHABILITY is NP-hard but STRICT OBJECT REACHABILITYis polynomially solvable. In the literature, more problems under the HOUSING MARKET model with a different objective have been investigated, such as the reachability of a whole assignment, finding Pareto efficient assignments and so on (Gourv`es, Lesca, and Wilczynski 2017). Some of our results can be extended to these prob-lems with some modifications. We will give the details in the full version of this paper.
References
Abdulkadiro˘glu, A., and S¨onmez, T. 1998. Random serial dictatorship and the core from random endowments in house allocation problems.Econometrica66(3):689–701.
Abdulkadiro˘glu, A., and S¨onmez, T. 1999. House allo-cation with existing tenants. Journal of Economic Theory 88(2):233–260.
Abebe, R.; Kleinberg, J.; and Parkes, D. C. 2017. Fair di-vision via social comparison. In Proceedings of the 16th
Conference on Autonomous Agents and Multiagent Systems,
281–289.
Ahmad, G. 2017. Essays on Housing Market Problem. Ph.D. Dissertation, Texas A & M University.
Alcalde-Unzu, J., and Molis, E. 2011. Exchange of indivis-ible goods and indifferences: The top trading absorbing sets mechanisms.Games and Economic Behavior73(1):1–16.
Aspvall, B.; Plass, M. F.; and Tarjan, R. E. 1979. A linear-time algorithm for testing the truth of certain quantified boolean formulas.Information Processing Letters8(3):121– 123.
Aziz, H., and De Keijzer, B. 2012. Housing markets with indifferences: a tale of two mechanisms. InProceedings of
the 26th AAAI Conference on Artificial Intelligence, 1249–
1255.
Bei, X.; Qiao, Y.; and Zhang, S. 2017. Networked fairness in cake cutting. InProceedings of the 26th International Joint
Conference on Artificial Intelligence, 3632–3638.
Beynier, A.; Chevaleyre, Y.; Gourv`es, L.; Lesca, J.; Maudet, N.; and Wilczynski, A. 2018. Local envy-freeness in house allocation problems. In Proceedings of the 17th Interna-tional Conference on Autonomous Agents and Multiagent
Systems, 292–300.
Bredereck, R.; Kaczmarczyk, A.; and Niedermeier, R. 2018. Envy-free allocations respecting social networks. In Pro-ceedings of the 17th International Conference on
Au-tonomous Agents and Multiagent Systems, 283–291.
Damamme, A.; Beynier, A.; Chevaleyre, Y.; and Maudet, N. 2015. The power of swap deals in distributed resource allo-cation. InProceedings of the 14th International Conference
on Autonomous Agents and Multiagent Systems, 625–633.
Ehlers, L. 2014. Top trading with fixed tie-breaking in mar-kets with indivisible goods. Journal of Economic Theory 151:64–87.
Gardenfors, P. 1973. Assignment problem based on ordinal preferences.Management Science20(3):331–340.
Gourv`es, L.; Lesca, J.; and Wilczynski, A. 2017. Object allocation via swaps along a social network. In Proceed-ings of the 26th International Joint Conference on Artificial
Intelligence, 213–219.
Jaramillo, P., and Manjunath, V. 2012. The difference indif-ference makes in strategy-proof allocation of objects.
Jour-nal of Economic Theory147(5):1913–1946.
Manlove, D. F. 2013. Algorithmics of matching under
pref-erences, volume 2. World Scientific.
Roth, A. E.; S¨onmez, T.; and ¨Unver, M. U. 2004. Kidney exchange.The Quarterly Journal of Economics119(2):457– 488.
Saban, D., and Sethuraman, J. 2013. House allocation with indifferences: a generalization and a unified view. In Pro-ceedings of the 14th ACM conference on Electronic
com-merce, 803–820.
Shapley, L., and Scarf, H. 1974. On cores and indivisibility.
Journal of Mathematical Economics1(1):23–37.
Sonoda, A.; Fujita, E.; Todo, T.; and Yokoo, M. 2014. Two case studies for trading multiple indivisible goods with in-differences. InProceedings of the 28th AAAI Conference on Artificial Intelligence, 791–797.
Wilson, L. B. 1977. Assignment using choice lists. Journal
of the Operational Research Society28(3):569–578.
Yoshinaka, R. 2005. Higher-order matching in the linear lambda calculus in the absence of constants is np-complete.
In International Conference on Rewriting Techniques and