The 2-way stable 3-way exchange problem is NP

1
EGRES Quick-Proof No. 2014-02
The 2-way stable 3-way exchange problem is
NP-complete
Zsuzsa Karkus
Given a simple digraph D = (V, A) an exchange is a permutation π of V so that
(v, π(v)) ∈ A for every v ∈ V, π(v) 6= v. Every v ∈ V has strict preferences over the
vertices from which there is a directed edge to v. We say that v gets π −1 (v) in the
exchange π, so v prefers π to another exchange σ if he prefers π −1 (v) to σ −1 (v). An
l-way exchange is an exchange π so that every cycle of π has length at most l. An
exchange π is b-way stable if there is no blocking coalition of size at most b, i.e. a
subset B of V and an exchange σ in D[B] such that every v ∈ B prefers σ to π. Biró
and McDermid [1] asked if there exists a polynomial time algorithm for the decision
problem of finding a 2-way stable 3-way exchange.
Theorem. The decision problem of finding a 2-way stable 3-way exchange is NPcomplete.
Proof. The reduction is from the k-clique in k-partite graph problem, which is specified as follows:
Instance: An integer k, and a k-partite graph G = (V1 ∪ V2 ∪ ... ∪ Vk , E).
Question: Is there a clique of size k in G?
The NP-completeness of this problem was implicitly proved in [3] and it can be
found in a university note [5], but we will show an alternative proof below.
Given an instance G = (V1 ∪ V2 ∪ ... ∪ Vk , E) of the k-clique in k-partite graph
problem, we create an instance of the 2-way stable 3-way exchange problem. By
adding isolated nodes we may assume that |Vi | = ni is odd for i = 1, ..., k, and
ni ≥ 5. For every i, we create a set of nodes Ci = {vi,1 , vi,2 , ..., vi,ni }. There is a
directed edge between vi,j and vi,j+1 in both directions, and there is an edge from vi,j
to vi,j−2 for j = 1, 2, ..., ni (subscripts modulo ni ). For every node in Vi , there is a
distinct corresponding node in Ci . For v ∈ Vi and w ∈ Vj , i 6= j, there is a directed
edge between the corresponding nodes in Ci and Cj in both directions, if and only
if vw 6∈ E. The first item on vi,j ’s preference list is vi,j−1 , the second item is vi,j+1 ,
and the last item is vi,j+2 for j = 1, 2, ..., ni (subscripts modulo ni ), the others are
arbitrary.
We prove that there is a k-clique in G if and only if the constructed instance admits
a 2-way stable 3-way exchange.
First suppose that there is a k-clique in G. Without loss of generality we may
assume that the nodes corresponding to the nodes of the k-clique are v1,1 , v2,1 , ..., vk,1 .
December 2014
Zsuzsa Karkus: The 2-way stable 3-way exchange problem is NP-complete
2
Claim 1. The 3-way exchange defined by the directed cycles (vi,1 , vi,2 , vi,3 ) and the
directed edges between vi,j and vi,j+1 for i = 1, 2, ..., k; j = 4, 6, ..., ni − 1 is 2-way
stable.
Proof. The nodes vi,j for j = 2, 3, 5, 7, ..., ni get the first item on their preference list,
therefore they cannot belong to a blocking pair. For 4 ≤ 2t < ni , vi,2t cannot belong
to a blocking pair either, because he gets the second item on his list, so the only way
he could belong to a blocking pair is if {vi,2t , vi,2t−1 } would be blocking, but v2t−1
cannot belong to a blocking pair. Finally a pair {vi,1 , vj,1 } cannot be blocking because
vi,1 and vj,1 correspond to two nodes of a k-clique in G so they are not connected.
Now suppose that the constructed instance admits a 2-way stable 3-way exchange.
Claim 2. For every i if (vi,j , vi,j+1 ) is not in the exchange, then (vi,j+1 , vi,j+2 ) must
be in the exchange for j = 1, ..., ni (subscripts modulo ni ).
Proof. Suppose that neither of (vi,j , vi,j+1 ) and (vi,j+1 , vi,j+2 ) is in the exchange. If
(vi,j+2 , vi,j+1 ) is not in the exchange, then {vi,j+1 , vi,j+2 } is a blocking pair, because
vi,j+1 is first on vi,j+2 ’s preference list, vi,j+2 is second on vi,j+1 ’s preference list, and
(vi,j , vi,j+1 ) and (vi,j+2 , vi,j+1 ) is not in the exchange, which means that vi,j+1 cannot
get the first or the second item on his list in the exchange. If (vi,j+2 , vi,j+1 ) is in the
exchange, then (vi,j+2 , vi,j+3 ) cannot be in the exchange, because there is only one
edge leaving vi,j+2 in the exchange. Therefore if (vi,j+3 , vi,j+2 ) is not in the exchange,
then it follows from the same argument, that {vi,j+2 , vi,j+3 } is a blocking pair. Now
suppose that (vi,j+2 , vi,j+1 ) and (vi,j+3 , vi,j+2 ) are both in the exchange. Then neither
of (vi,j+3 , vi,j+4 ) and (vi,j+4 , vi,j+3 ) can be in the exchange, because there is only one
edge leaving vi,j+3 in the exchange, and every cycle in the exchange has length at
most three. Therefore the pair {vi,j+3 , vi,j+4 } is blocking.
|Ci | is odd, therefore it follows from the above claim that there exist two consecutive
edges (vi,ji , vi,ji +1 ) and (vi,ji +1 , vi,ji +2 ) in each Ci , which are in the exchange. Therefore
the cycles (vi,ji , vi,ji +1 , vi,ji +2 ) are in the exchange.
Claim 3. The nodes corresponding to vi,ji for i = 1, ..., k form a k-clique.
Proof. Suppose there are two, which are not connected in G, then there exist i, l such
that there is a directed edge between vi,ji and vl,jl in both directions. For t = i, l, vt,jt
gets vt,jt +2 in the exchange which is the last item on his preference list, therefore vi,ji
and vl,jl prefer each other, which means that {vi,ji , vl,jl } is a blocking pair, thus we
have reached a contradiction.
Remark 1. It follows from the same proof, that the decision problem of finding a
b-way stable 3-way exchange is NP-hard for any b ≥ 2. For b = 3 this was proved by
Biró in [2].
Remark 2. It can be proved in a similar way, that the decision problem of finding a
b-way stable 4-way exchange is NP-hard for any b ≥ 2. The same proof does not work
for l-way exchanges if l ≥ 5.
EGRES Quick-Proof No. 2014-02
Zsuzsa Karkus: The 2-way stable 3-way exchange problem is NP-complete
3
Claim 4. The k-clique in k-partite graph problem is NP-hard.
Proof. We reduce from the NP-complete exact balanced node cardinality decision
problem (EBNCD) [4] which is specified as follows:
Instance: a bipartite graph G = (S ∪ T, E) and a positive integer a ∈ Z+ .
Question: does there exist a biclique C = S 0 ∪ T 0 with |S 0 | = |T 0 | = a? Here a biclique
is a complete bipartite subgraph of G.
Let G = (S ∪ T, E), a ∈ Z+ be an instance of EBNCD, we construct an instance
of the k-clique in k-partite graph problem. We take a copies of S and a copies of T
to be the classes of a 2a-partite graph G0 = (S1 ∪ ... ∪ Sa ∪ T1 ∪ ... ∪ Ta , E 0 ). For each
s ∈ S there is a corresponding si ∈ Si for i = 1, ..., a. Let si tj be an edge in G0 if and
only if st is an edge in G. For x, y ∈ S let xi yj be an edge for any i 6= j if and only if
x 6= y. Similarly for T .
Claim 5. There exists a biclique C = S 0 ∪ T 0 with |S 0 | = |T 0 | = a in G if and only if
there exists a 2a-clique in G0 .
Proof. Suppose there is such a biclique C = S 0 ∪ T 0 . We take a node si from each
Si such that they correspond to distinct elements of S 0 , ti ∈ Ti are the nodes chosen
similarly for T 0 . For i 6= j, si and sj are copies of two distinct elements from S 0 so
by the rules of the construction si sj ∈ E 0 , similarly ti tj ∈ E 0 . S 0 ∪ T 0 is a biclique, so
si tj ∈ E 0 for every i, j. Therefore {s1 , ..., sa , t1 , ..., ta } is a 2a-clique in G0 .
Now suppose that {s1 , ..., sa , t1 , ..., ta } is a 2a-clique in G0 . Then si and sj correspond
to distinct nodes in S, otherwise they would not be connected in G0 . Similarly ti and
tj correspond to distinct nodes in T . These nodes form a biclique in G.
References
[1] Péter Biró, Eric McDermid, Three-Sided Stable Matchings with Cyclic Preferences, Algorithmica Volume 58, Issue 1 (2010), 5-18
[2] Péter Biró, The stable matching problem and its generalizations: an algorithmic
and game theoretical approach, PhD thesis, Budapest University of Technology
and Economics, 2007
[3] M.R. Garey, D.S. Johnson, Computers and Intractability: A Guide to the Theory
of NP-Completeness, W. H. Freeman, New York, 1979, Sec. 3.1.3, Theorem 3.3.
[4] M. Dawande, P. Keskinocak, J. M. Swaminathan, S. Tayur. On Bipartite and
Multipartite Clique Problems. Journal of Algorithms 41, 388–403 (2001)
[5] http://www.cs.cornell.edu/courses/CS6820/2012sp/Handouts/111-137.pdf
EGRES Quick-Proof No. 2014-02