No-Rainbow Problem and the Surjective Constraint Satisfaction Problem
aa r X i v : . [ c s . CC ] J u l No-Rainbow Problem and the Surjective ConstraintSatisfaction Problem
Dmitriy ZhukJuly 14, 2020
Abstract
The Surjective Constraint Satisfaction Problem (SCSP) is the problem of decidingwhether there exists a surjective assignment to a set of variables subject to some specifiedconstraints. In this paper we show that one of the most popular variants of the SCSP,called No-Rainbow Problem, is NP-Hard. Additionally, we disprove the conjecture sayingthat the SCSP over a constraint language Γ is equivalent to the CSP over the samelanguage with constants. Our counter example also shows that the complexity of theSCSP cannot be described in terms of polymorphisms of the constraint language.
Let A be a finite set, Γ be a set of relations on A , called a constraint language . Then theConstraint Satisfaction Problem over the constraint language Γ, denoted by CSP(Γ), is thefollowing decision problem: given a formula of the form R ( z , , . . . , z ,n ) ∧ · · · ∧ R s ( z s, , . . . , z s,n s ) , where R , . . . , R s ∈ Γ and each z i,j ∈ { x , . . . , x n } ; decide whether the formula is satisfiable. The Surjective Constraint Satisfaction Problem over the constraint language
Γ, denoted bySCSP(Γ), is the problem of deciding whether there is a solution such that { x , . . . , x n } = A .Note that if Γ consists of just one binary relation, then SCSP(Γ) is equivalent to the problemof deciding whether there exists a surjective homomorphism between graphs, and there aremany results in this area [18, 17, 16, 19, 10, 20, 14]. More information about the complexity ofthe SCSP can be found in the survey [1]. For recent results on the complexity of the SurjectiveCSP see [12, 9, 8].Recall that the classification of the complexity of the CSP for different constraint languageswas given in terms of polymorphisms [2, 21, 22]. We say that a k -ary operation f is a polymorphism of an m -ary relation R if whenever ( x , . . . , x m ) , . . . , ( x k , . . . , x mk ) in R , thenalso ( f ( x , . . . , x k ) , . . . , f ( x m , . . . , x mk )) in R . An operation f is a polymorphism of Γ if it is apolymorphism of every relation in Γ. In [2, 21, 22] it was shown that CSP(Γ) is tractable if Γadmits a WNU polymorphism, and it is NP-complete otherwise. It is natural to assume thatthe complexity of the SCSP can be described in a similar way. In [4] Hubie Chen conjecturednot only this but also the following characterization of the complexity of SCSP(Γ). Conjecture 1.
For any constraint language Γ the problems CSP(Γ ∪ { x = a | a ∈ A } ) and SCSP(Γ) are polynomially equivalent. ∪ { x = a | a ∈ A } ) is known andstraightforward (see [1, Section 2]). As it was proved in [6] (see also [7]) this conjecture holdsfor a 2-element domain. In [3] Hubie Chen confirmed that polymorphisms of Γ can be usedto describe the complexity of SCSP(Γ). For instance he proved NP-hardness of SCSP(Γ) forΓ admitting only essentially unary polymorphisms.An interesting fact about the complexity of the SCSP is that the problem remained openfor many years even for very simple constraint languages, see [14] for the reflexive 4-cycleand [20] for the 6-cycle. Recall that the situation was different with the complexity of theCSP: even though the general classification remained open for many years, nobody couldshow a simple constraint language with unknown complexity. In this paper we considerone of the most popular constraint language with unknown complexity of the SCSP. Let N = { ( a, b, c ) ∈ { , , } | { a, b, c } 6 = { , , }} . The problem SCSP( { N } ) is called No-Rainbow-Problem and first appeared in [11]. In fact, if we interpret 0 ,
1, and 2 as colors, thenthe relation N forbids rainbow. The complexity of SCSP( { N } ) was an open question for manyyears and was formulated in many papers as an important open problem [1, 4]. In the paperwe prove that this problem is NP-hard. See also [5] for the algebraic framework for provingsuch hardness results. Theorem 1.
SCSP( { N } ) is NP-complete. Thus, our result confirms Conjecture 1. Unfortunately, we found a counter example tothis conjecture.Let R = , R ′ = (here columns are tuples). Note that R ′ is the projection of R onto coordinates 2, 3 and 4. Hence, every polymorphism of R is also apolymorphism of R ′ . Theorem 2.
We have(1)
CSP( { R, { } , { } , { }} ) is NP-hard.(2) SCSP( { R } ) is solvable in polynomial time.(3) SCSP( { R ′ } ) is NP-Hard. Comparing (2) and (3) we derive that the complexity of SCSP(Γ) cannot be described interms of polymorphisms.The paper is organized as follows. In Section 2 and Section 3 we give two different proofs ofTheorem 1. Both proofs are based on the reduction from an NP-hard CSP problem, the firstreduction is easier in terms of complexity (just 2 variables for every variable of the originalinstance) but the idea of the reduction is hidden there. We hope the second reduction is betterfor understanding but here we create nine variables for every variable of the original instance.In Section 4 we prove Theorem 2.I would like to thank Hubie Chen who introduced me to this beautiful problem, and toBarnaby Martin who provided me with the background of the SCSP and motivated me tothink about this problem. Without them this result would have never appeared.2
No-Rainbow problem is NP-Hard (the first proof )
Let Γ = { x = y ∨ z = 0 , x = y ∨ z = 1 , x = 0 , x = 1 } be a constraint language on { , } . Theproblem CSP(Γ ) is known to be NP-Hard [15]. Hence, to prove Theorem 1 it is sufficient toprove the following theorem. Theorem 3.
CSP(Γ ) can be polynomially reduced to SCSP( { N } ) . Let us define the reduction. Let I be an instance of CSP(Γ ). Let us build an instance J of SCSP( { R, = } ) such that I holds if and only if J has a surjective solution. Note that theproblems SCSP( { R, = } ) and SCSP( { R } ) are equivalent because we can always propagate outthe equalities. Construction . Let u , . . . , u n be the variables of I .Choose variables x, x ′ , y ′ , x , . . . , x n , y , . . . , y n , z , . . . , z n . We define 14 sets of constraints: • C = { N ( x, x i , y i ) | i ∈ [ n ] } , • C = { N ( x ′ , z i , y i ) | i ∈ [ n ] } , • C = { N ( y ′ , z i , x i ) | i ∈ [ n ] } , • C = { N ( t , t , t ) | t , t , t ∈ { x, x ′ , x , . . . , x n }} , • C = { N ( t , t , t ) | t , t , t ∈ { x, y ′ , y , . . . , y n }} , • C = { N ( t , t , t ) | t , t , t ∈ { x ′ , y ′ , z , . . . , z n }} , • C = { N ( x i , y j , z i ) | i, j ∈ [ n ] } , • C = { N ( x i , y j , z j ) | i, j ∈ [ n ] } , • C = { N ( x, x i , z i ) | i, j ∈ [ n ] } , • C = { N ( x, y i , z i ) | i, j ∈ [ n ] } , • C = { N ( x i , x j , y k ) | ( u i = u j ∨ u k = 0) ∈ I} , • C = { N ( y i , y j , x k ) | ( u i = u j ∨ u k = 1) ∈ I} , • C = { x = x i | ( u i = 1) ∈ I} , • C = { x = y i | ( u i = 0) ∈ I} . Lemma 4. I holds if and only if J has a surjective solution, where J = C ∪ · · · ∪ C .Proof. Let us show both implications.
I ∈
CSP(Γ ) ⇒ J ∈ SCSP( { N, = } ) . Let ( b , . . . , b n ) be a solution of I . Put x = 1, x ′ = 0, y ′ = 2, x i = b i , y i = b i + 1, z i = 2 · b i for every i . Let us check that all constraints are satisfied. • C holds because |{ , b i , b i + 1 }| < b i ∈ { , } . • C holds because |{ , · b i , b i + 1 }| < b i ∈ { , } . • C holds because |{ , · b i , b i }| < b i ∈ { , } . • C holds because x, x ′ , x , . . . , x n are from the set { , } .3 C holds because x, y ′ , y , . . . , y n are from the set { , } . • C holds because x ′ , y ′ , z , . . . , z n are from the set { , } . • C holds because |{ b i , b j + 1 , · b i }| < b i , b j ∈ { , } . • C holds because |{ b i , b j + 1 , · b j }| < b i , b j ∈ { , } . • C holds because |{ , b i , · b i }| < b i ∈ { , } . • C holds because |{ , b i + 1 , · b i }| < b i ∈ { , } . • C holds because each constraint is equivalent to |{ b i , b j , b k }| < b i = b j ) ∨ b k = 0. • C holds because each constraint is equivalent to |{ b i + 1 , b j + 1 , b k }| < b i = b j ) ∨ b k = 1. • C holds because x i = x = 1 whenever b i = 1. • C holds because y i = x = 1 whenever b i = 0. J ∈
SCSP( { N, = } ) ⇒ I ∈ CSP(Γ ) . Choose a surjective solution of J . By C we can choose a, b ∈ { , , } such that x = a and { x, x ′ , x , . . . , x n } ⊆ { a, b } . Since the solution is surjective, there should be an element inthe solution equal to c ∈ { , , } \ { a, b } . Case 1 . Assume that y ′ = c and x ′ = b . WLOG we may assume (everything is symmetric)that x = 1 , x ′ = 0 , y ′ = 2. By C , C , C we know that { x, x ′ , x , . . . , x n } = { , } , { x, y ′ , y , . . . , y n } = { , } , { x ′ , y ′ , z , . . . , z n } = { , } . Let us show that y i = x i + 1. If x i = 0 and y i = 2, then we get a contradiction with C .If x i = y i = 1, then by C we have z i = 2, by C we have z i = 0, which implies z i = 1 andcontradicts C .Let us show that ( u , . . . , u n ) = ( x , . . . , x n ) is a solution of I . C guarantees that all the constraints of the form ( u i = u j ∨ u k = 0) hold, C guaranteesthat all the constraints of the form ( u i = u j ∨ u k = 1) hold, C guarantees that all theconstraints of the form u i = 1 hold, C guarantees that all the constraints of the form u i = 0hold. Thus, we proved that it is a solution. Case 2 . Assume that y ′ = c and x ′ = a . By C we have { x, y ′ , y , . . . , y n } = { a, c } . By C we have { x ′ , y ′ , z , . . . , z n } = { a, c } . Since the solution is surjective, there should be i suchthat x i = b . By C we have z i = c , by C we have z i = a . Contradiction. Case 3 . Assume that y ′ = c and y i = z i = c for some i . By C we have { x, y ′ , y , . . . , y n } = { a, c } , hence y ′ = a . By C we have { x ′ , y ′ , z , . . . , z n } = { a, c } , hence x ′ = a . Since the solutionis surjective, there should be j such that x j = b . By C , we have z j = a . By C we have y ℓ = a for every ℓ . Contradiction. Case 4 . Assume that y ′ = c and y i = c, z i = c for some i . By C we have { x, y ′ , y , . . . , y n } = { a, c } , hence y ′ = a . By C , we have x i = a . By C we obtain z i ∈ { a, c } and since z i = c we have z i = a . Then by C we obtain x ℓ = a for every ℓ . If z j = b for some j , then weget a contradiction with C applied to ( x j , y i , z j ). Since the solution is surjective, the onlyremaining option is x ′ = b , which contradicts C . Case 5 . Assume that { x, y ′ , y , . . . , y n } ⊆ { a, b } . Since the solution is surjective, thereexists i such that z i = c . By C and C we have x i = y i = a . By C we have y ℓ = a for every ℓ , by C we have x ℓ = a for every ℓ . By C we have x ′ = b , by C we have y ′ = b . Therefore x ′ = y ′ = a and by C we obtain { x ′ , y ′ , z , . . . , z n } = { a, c } . Hence, none of the variables canbe equal to b . Contradiction. 4 No-Rainbow problem is NP-Hard (the second proof )
Here we present another proof of the fact that the No-Rainbow problem is NP-Hard. By
N AE we denote the ternary relation on { , } consisting of all tuples but (0 , ,
0) and (1 , , N AE ) is NP-hard. Hence, to prove Theorem 1 it issufficient to prove the following theorem. Theorem 5.
CSP( { N AE } ) can be polynomially reduced to SCSP( { N } ) . For a relation ρ by Pol( ρ ) we denote the set of all polymorphisms of ρ . Note that therelation N defines a maximal clone of type B , and Pol( N ) consists of all essentially unaryoperations, and all operations f such that | Im( f ) | < M be the matrix with 2 columns and 3 = 9 rows whose rows are all pairs from { , , } . Let S = { f ( M ) | f ∈ Pol( N ) } , that is, S is the set of all graphs of binaryoperations from Pol( N ). The fact that a binary operation is a polymorphism of a relation canbe easily expressed via a conjunctive formula over the relation, therefore, S can be defined bya conjunctive (quantifier-free) formula over { N } .Let us show how to encode CSP( { N AE } ) as SCSP( { N } ). Consider an instance I ofCSP( { N AE } ). Let x , . . . , x n be the variables of I and T be the set of all triples ( i, j, k )such that N AE ( x i , x j , x k ) appears in the instance.We encode every variable x i with nine variables on A = { , , } . The nine variablesassigned to x i express the graph of a binary operation f i on A preserving R . In formulas thesenine variables with be denoted as f i (0 , , f i (0 , , f i (0 , , f i (1 , , f i (1 , , f i (1 , , f i (2 , ,f i (2 , , f i (2 , f i to be the first projection if x i = 0 and f i to be the secondprojection if x i = 1. By [ n ] we denote the set { , , . . . , n } .By I ′ we denote the following instance: ^ i ∈ [ n ] ( f i ( M ) ∈ S ) ^ i ∈ [ n ] ,a ∈ A ( f ( a, a ) = f i ( a, a )) ^ ( i,j,k ) ∈ T N ( f i (0 , , f j (1 , , f k (2 , ^ i,j ∈ [ n ] ,a,b,c ∈ A N ( f i ( a, b ) , f i ( c, b ) , f j ( a, c )) ^ i,j ∈ [ n ] ,a,b,c ∈ A N ( f i ( b, a ) , f i ( b, c ) , f j ( a, c )) ^ i,j ∈ [ n ] ,a,b,c ∈ A N ( f i ( a, b ) , f i ( c, b ) , f j ( c, a )) ^ i,j ∈ [ n ] ,a,b,c ∈ A N ( f i ( b, a ) , f i ( b, c ) , f j ( c, a ))This instance can be viewed as an instance of SCSP( N ) because we use only equalities, therelation N and the relation S , which can be replaced by a conjunction of relations N . Lemma 6. I holds if and only if I ′ has a surjective solution.Proof. I ⇒ I ′ . As we mentioned earlier, it is sufficient to put f i ( x, y ) = x if x i = 0 and f i ( x, y ) = y if x i = 1, and check all the conjunctions. I ′ ⇒ I . Let g ( x ) := f ( x, x ). By the second conjunction we have f i ( x, x ) = g ( x ) for every i ∈ [ n ].If | Im( g ) | = 3, then all the functions f , . . . , f n are essentially unary (and bijective). Assign x i = 0 if f i depends essentially on the first variable, and x i = 1 if f i depends essentially onthe second variable. Then the third conjunction guarantees that f i , f j , and f k cannot dependon the same coordinate for each ( i, j, k ) ∈ T . Hence, we defined a solution of I .Assume that | Im( g ) | = 2, then by the properties of Pol( N ), we have Im( f i ) = Im( g ) forevery i , which contradicts the surjectivity of the solution.Assume that Im( g ) = { d } . Since the solution is surjective, the remaining two values shouldappear in the images of some functions f i and f j . Note that | Im( f k ) | < k ∈ [ n ].5o get a contradiction we use the last four conjunctions. The last three conjunctions areobtained by permutations of variables in f i and f j from the fourth conjunction. Therefore,without loss of generality we consider f i , f j and a, b, c ∈ A such that { d, f i ( a, b ) , f j ( a, c ) } = A .By the fourth conjunction we obtain f i ( c, b ) = f i ( a, b ), and then by the fifth conjunction weget f j ( a, b ) = f j ( a, c ). Then by the fourth conjunction we have ( f i ( a, b ) , f i ( b, b ) , f j ( a, b )) ∈ N ,which contradicts our assumption. Recall that R = , R ′ = . Lemma 7.
CSP( { R, { } , { } , { }} ) is NP-hard.Proof. Note that R ′ = pr , , ( R ). We can check that R ′ is not preserved by any idem-potent WNU on { , } . By the classification of the complexity of the CSP [21, 22, 2],CSP( { R ′ , { } , { }} ) is NP-hard. Therefore, CSP( { R, { } , { } , { }} ) is NP-hard. Lemma 8.
SCSP( { R ′ } ) is NP-hard.Proof. SCSP( { R ′ } ) can be viewed as the SCSP on the two-element set { , } (we just add avariable that never appears for 0 to be in a solution), which is known to be NP-Hard [6, 7]. Lemma 9.
SCSP( { R } ) can be solved in polynomial time.Proof. Let σ = { (1 , , (2 , } We will prove a stronger claim that SCSP(Γ) is tractable forΓ = { R, σ, { } , { } , { , }} . Consider an instance I of SCSP(Γ).First, we want to make the instance 1-consistent (the projection of any constraint on anyvariable equals the domain of this variable). The coordinates of R have projections { } , { , } ,and { , , } . If a variable has different projections in different constraints then the instancecan be simplified. For example, if a variable x appears at the fifth position of R but it has asmaller projection in some other constraint then we do the following : R ( x , x , x , x , x ) ∧ ( x ∈ { , } ) = ( x = 0) ∧ σ ( x , x ) ∧ ( x = 1) ∧ ( x ∈ { , } ) R ( x , x , x , x , x ) ∧ ( x = 0) = ( x = 0) ∧ σ ( x , x ) ∧ ( x = 1) ∧ ( x = 0) . Thus, after we achieved 1-consistency, we may have two cases:Case 1. The instance I does not contain R at all. Then the instance is tractable.Indeed, we guess three variables taking values 0, 1 and 2 and solve a CSP instance over { σ, { } , { } , { } , { , }} . For the detailed reduction from SCSP(Γ) to CSP(Γ ∪ { x = a | a ∈ A } ) see [1, Section 2].Case 2. The instance I contains R . Then we send the variables with the domain { , , } to 2, the variables with the domain { , } to 1, and the variables with the domain { a } to a.We can check that as a result we obtain a surjective solution of the instance.6 eferences [1] Manuel Bodirsky, Jan K´ara, and Barnaby Martin. The complexity of surjective homo-morphism problems - a survey. Discrete Applied Mathematics , 160(12):1680–1690, 2012.[2] Andrei A. Bulatov. A dichotomy theorem for nonuniform csps.
CoRR , abs/1703.03021,2017.[3] Hubie Chen. An algebraic hardness criterion for surjective constraint satisfaction.
Algebrauniversalis , 72(4):393–401, 2014.[4] Hubie Chen. Three concrete complexity questions about constraints, in search of theo-ries. AAA98.Arbeitstagung Allgemeine Algebra - 98-th Workshop on General Algebra.Dresden, Germany, 2019.[5] Hubie Chen. Algebraic global gadgetry for surjective constraint satisfaction, 2020.[6] Nadia Creignou and J-J H´ebrard. On generating all solutions of generalized satisfiabilityproblems.
RAIRO-Theoretical Informatics and Applications , 31(6):499–511, 1997.[7] Nadia Creignou, Sanjeev Khanna, and Madhu Sudan.
Complexity classifications ofboolean constraint satisfaction problems , volume 7. SIAM, 2001.[8] Jacob Focke, Leslie Ann Goldberg, and Stanislav Zivny. The complexity of countingsurjective homomorphisms and compactions.
SIAM J. Discrete Math. , 33(2):1006–1043,2019.[9] Petr A. Golovach, Matthew Johnson, Barnaby Martin, Dani¨el Paulusma, and AnthonyStewart. Surjective h-colouring: New hardness results.
Computability , 8(1):27–42, 2019.[10] Petr A. Golovach, Dani¨el Paulusma, and Jian Song. Computing vertex-surjective homo-morphisms to partially reflexive trees.
Theor. Comput. Sci. , 457:86–100, 2012.[11] Daniel Kr´al, Jan Kratochv´ıl, Andrzej Proskurowski, and Heinz-J¨urgen Voss. Coloringmixed hypertrees.
Discrete Applied Mathematics , 154(4):660–672, 2006.[12] Benoˆıt Larose, Barnaby Martin, and Dani¨el Paulusma. Surjective h-colouring over re-flexive digraphs.
TOCT , 11(1):3:1–3:21, 2019.[13] D. Lau.
Function algebras on finite sets . Springer, 2006.[14] Barnaby Martin and Dani¨el Paulusma. The computational complexity of disconnectedcut and 2k2-partition.
J. Comb. Theory, Ser. B , 111:17–37, 2015.[15] Thomas J. Schaefer. The complexity of satisfiability problems. In
Proceedings of theTenth Annual ACM Symposium on Theory of Computing , STOC ’78, pages 216–226,New York, NY, USA, 1978. ACM.[16] Narayan Vikas. Computational complexity of compaction to reflexive cycles.
SIAM J.Comput. , 32(1):253–280, 2002.[17] Narayan Vikas. Computational complexity of compaction to irreflexive cycles.
J. Comput.Syst. Sci. , 68(3):473–496, 2004. 718] Narayan Vikas. A complete and equal computational complexity classification of com-paction and retraction to all graphs with at most four vertices and some general results.
J. Comput. Syst. Sci. , 71(4):406–439, 2005.[19] Narayan Vikas. Algorithms for partition of some class of graphs under compaction andvertex-compaction.
Algorithmica , 67(2):180–206, 2013.[20] Narayan Vikas. Computational complexity of graph partition under vertex-compactionto an irreflexive hexagon. In Kim G. Larsen, Hans L. Bodlaender, and Jean-Fran¸coisRaskin, editors, , volume 83 of
LIPIcs ,pages 69:1–69:14. Schloss Dagstuhl - Leibniz-Zentrum f¨ur Informatik, 2017.[21] Dmitriy Zhuk. A proof of CSP dichotomy conjecture. In , pages 331–342, 2017.[22] Dmitriy Zhuk. A proof of csp dichotomy conjecture.