• Nem Talált Eredményt

Constraint satisfaction parameterized by solution size

N/A
N/A
Protected

Academic year: 2022

Ossza meg "Constraint satisfaction parameterized by solution size"

Copied!
12
0
0

Teljes szövegt

(1)

Constraint satisfaction parameterized by solution size

Andrei A. Bulatov1?and D´aniel Marx2??

1 Simon Fraser University abulatov@cs.sfu.ca

2 Humboldt-Universit¨at zu Berlin dmarx@cs.bme.hu

Abstract. In the constraint satisfaction problem (CSP) corresponding to a con- straint language (i.e., a set of relations)Γ, the goal is to find an assignment of values to variables so that a given set of constraints specified by relations from Γis satisfied. In this paper we study the fixed-parameter tractability of constraint satisfaction problems parameterized by the size of the solution in the following sense: one of the possible values, say 0, is “free,” and the number of variables allowed to take other, “expensive,” values is restricted. A size constraint requires that exactlykvariables take nonzero values. We also study a more refined version of this restriction: a global cardinality constraint prescribes how many variables have to be assigned each particular value. We study the parameterized complexity of these types of CSPs where the parameter is the required numberkof nonzero variables. As special cases, we can obtain natural and well-studied parameter- ized problems such as INDEPENDENT SET, VERTEXCOVER,d-HITTINGSET, BICLIQUE, etc. In the case of constraint languages closed under substitution of constants, we give a complete characterization of the fixed-parameter tractable cases of CSPs with size constraints, and we show that all the remaining problems are W[1]-hard. For CSPs with cardinality constraints, we obtain a similar clas- sification, but for some of the problems we are only able to show that they are BICLIQUE-hard. The exact parameterized complexity of the BICLIQUEproblem is a notorious open problem, although it is believed to be W[1]-hard.

1 Introduction

In a constraint satisfaction problem (CSP) we are given a set of variables, and the goal is to find an assignment of the variables subject to specified constraints. A constraint is usually expressed as a requirement that combinations of values of a certain (usually small) set of variables belong to a certain relation. In the theoretical study of CSPs, one of the key research direction has been the complexity of the CSP when there are restric- tions on the type of allowed relations [9,3,2]. This research direction has been started by the seminal Schaefer’s Dichotomy Theorem [17], which showed that every Boolean CSP (i.e., CSP with 0-1 variables) restricted in this way is either solvable in polyno- mial time or is NP-complete. An outstanding open question is the so calledDichotomy conjectureof Feder and Vardi [7] which suggests that the dichotomy remains true for

?Research supported by an NSERC Discovery grant.

??Research supported by the Alexander von Humboldt Foundation and OTKA grant 67651.

(2)

CSPs over any fixed finite domain. The significance of a dichotomy result is that it is very likely to provide a comprehensive understanding of the algorithmic nature of the problem. Indeed, in order to obtain the tractability part of such a conjecture one needs to identify all the algorithmic ideas relevant for the problem.

Parameterized complexity [6,8] investigates the complexity of problems in finer de- tails than classical complexity. Instead of expressing the running time of an algorithm as a function of the input sizenonly, the running time is expressed as a function ofnand a well-defined parameterkof the input instance (such as the size of the solutionkwe are looking for). For many problems and parameters, there is a polynomial-time algorithm for every fixed value ofk, i.e., the problem can be solved in timenf(k). In this case, it makes sense to ask if the combinatorial explosion can be limited to the parameterk by improving the running time tof(k)·nO(1). Problems having algorithms with run- ning time of this form are calledfixed-parameter tractable (FPT); it turns out that many well-known NP-hard problems, such ask-VERTEXCOVER,k-PATH, andk-DISJOINT

TRIANGLESare FPT. On the other hand, the theory of W[1]-hardness suggests that cer- tain problems (e.g.,k-CLIQUE,k-DOMINATINGSET) are unlikely to be FPT.

The canonical complete problems of the W-hierarchy are (circuit) satisfiability prob- lems where the solution is required to contain exactlykones. This leads us to the study of Boolean CSP problems with the goal of finding a solution with exactlykones. The first attempt to study the parameterized complexity of Boolean CSP was made in [14].

If we consider 0 as a “cheap” value available in abundance, while 1 is “costly” and of limited supply then the natural parameter is the number of 1’s in a solution. Boolean CSP asking for a solution that assigns exactlyk ones is known as thek-ONES prob- lem [5,11]. Clearly, the problem is polynomial-time solvable for every fixedk(by brute force), but it is not at all obvious whether it is FPT. For example, it is possible to express k-VERTEXCOVER(which is FPT) andk-INDEPENDENTSET(which is W[1]-hard) as a Boolean CSP. Therefore, characterizing the parameterized complexity ofk-ONESre- quires understanding a class of problems that includes, among many other things, the most basic graph problems. It turned out that the parameterized complexity of thek- ONESproblem depends on a new combinatorial property calledweak separability[14].

Assuming that the constraints are restricted to a finite setΓ of Boolean relations, if ev- ery relation inΓ is weakly separable, then the problem is FPT; ifΓ contains even one relation violating weak separability, then the problem is W[1]-hard.

There have been further parameterized complexity studies of Boolean CSP [12,18,13], but CSP’s with larger domains were not studied. In most cases, we expect that results for larger domains are much more complex than for the Boolean case, and usually re- quire significant new ideas. The goal of the present paper is to generalize the results of [14] to non-Boolean domains. First, we have to define what the proper generaliza- tion ofk-ONESis if the variables are not Boolean. One natural generalization assumes that there is a distinguished “cheap” value 0 and requires that in a solution there are exactlyk nonzero variables. We will call this version of the CSP a constraint satis- faction problem with size constraintsand denote by OCSP. Another generalization of k-ONESspecifies the numberπ(d)of variables assigned each nonzero valued: A map- pingπ:D\ {0} →Nis given, and it is required that for each nonzero valued, exactly π(d)variables are assigned valued. In the CSP and AI literature, requirements of this

(3)

form are calledglobal cardinality constraints[1,15]. We will call this problem thecon- straint satisfaction problem with cardinality constraintsand denote it by CCSP. In both versions, the parameter is the number of nonzero values required, that is,kfor OCSP, andP

d∈D\{0}π(d)for CCSP. The usual (non-parametrized) complexity of CCSP over arbitrary domain was characterized in [4]. We investigate both versions; as we shall see, there are unexpected differences between the complexity of the two variants.

A natural minor generalization of CSPs is allowing the use of constants in the in- put, that is, some variables in the input can be fixed to constant values, or equivalently the constant unary relation{(d)} is allowed for every elementdof the domain. It is known that the complexity of the decision CSP (corresponding to a ‘core’ structure) does not change with this generalization [3]. While there is no similar result for the versions of CSPs we study here (and thus this assumption may diminish the general- ity of our results), this setting is still quite general and at the same time more robust.

Many technicalities can be avoided with this formulation. For example, the availability of constants ensures that the decision and search problems are equivalent: by repeatedly substituting constants and solving the decision problem, we can actually find a solution.

Is weak separability the right tractability criterion in the non-Boolean case? It is not difficult to observe that the algorithm of [14] using weak separability generalizes for non-Boolean problems3. However, it is not true that only weakly separable relations are tractable. It turns out that there are certain degeneracies and symmetries that allow us to solve the problem even for some relations that are not weakly separable. To understand these degenerate situations, the notion of multivalued morphisms (a generalization of homomorphisms) turns out to be crucial.

Results.For CSP with size constraints, we prove a dichotomy result:

Theorem 1.1. For every finiteΓ closed under substitution of constants,OCSP(Γ)is eitherFPTorW[1]-hard.

The precise tractability criterion (which is quite technical) is stated in Section 4. The algorithmic part of Theorem 1.1 consists of a preprocessing to eliminate degeneracies and trivial cases, followed by the use of weak separability. In the hardness part, we take a relationRhaving a counterexample to weak separability, and use it to show that a known W[1]-hard problem can be simulated with this relation. In the Boolean case [14], this is fairly simple: by identifying coordinates and substituting 0’s, we can assume that the relationRis binary, and we need to prove hardness only for two concrete binary relations. For larger domains, however, this approach does not work. We cannot reduce the counterexample to a binary relation by identifying coordinates, thus a complex case analysis would be needed. Fortunately, our hardness proof is more uniform than that.

We introduce gadgets that control the values that can appear on the variables. There are certain degenerate cases when these gadgets do not work. However, these degenerate cases can be conveniently described using multivalued morphisms, and these cases turn out to be exactly the cases that we can use in the algorithmic part of the proof.

In the case of cardinality constraints, we face an interesting obstacle. Consider the binary relationRcontaining only tuples(0,0),(1,0), and(0,2). Given a CSP instance with constraints of this form, finding a solution where the number of 1’s is exactlyk

3In fact, we give an algorithm for non-Boolean domains that is simpler then the one in [14].

(4)

and the number of 2’s is exactlykis essentially equivalent to finding an independent set of a bipartite graph withkvertices in both classes, or equivalently, a complete bipartite graph (biclique) withk+kvertices. The parameterized complexity of thek-BICLIQUE

problem is a longstanding open question (it is conjectured to be W[1]-hard). Thus at this point, it is not possible to give a dichotomy result similar to Theorem 1.1 in the case of cardinality constraints, unless we prove that BICLIQUEis hard:

Theorem 1.2. For every finiteΓ closed under substitution of constants, CCSP(Γ)is eitherFPT, orBICLIQUE-hard.

2 Preliminaries

Constraint satisfaction problem with size and cardinality constraints.LetD be a set. We assume thatDcontains a distinguished element0. LetDndenote the set of all n-tuples of elements fromD. Ann-aryrelationonDis a subset ofDn, and aconstraint languageΓ is a set of relations onD. In this paper constraint languages are assumed to be finite. We denote by dom(Γ)the set of all values that appear in tuples of the relations inΓ. Given a constraint languageΓ, an instance of theconstraint satisfaction problem (CSP) is a pairI= (V,C), whereV is a set ofvariables, andCis a set ofconstraints. A constraint is a pairhs, Ri, whereRis a (say,n-ary) relation fromΓ, andsis ann-tuple of variables. Asatisfying assignmentofIis a mappingτ:V →Dsuch that for every hs, Ri ∈ Cwiths= (s1. . . , sn)the imageτ(s) = (τ(s1), . . . , τ(sn))belongs toR.

The question in the CSP is whether there is a satisfying assignment for a given instance.

The CSP over constraint languageΓ is denoted by CSP(Γ).

Thesizeof an assignment is the number of variables receiving nonzero values. A size constraintis a prescription on the size of the assignment. Acardinality constraint for a CSP instanceIis a mappingπ:D→NwithP

a∈Dπ(a) =|V|. A satisfying as- signmentτofIsatisfies the cardinality constraintπif the number of variables mapped to eacha∈Dequalsπ(a). We denote by CCSP(Γ)the variant of CSP(Γ)where the in- put contains both a cardinality constraintπand the size constraintk=P

a∈D\{0}π(a) (this constraint is used a parameter); the question is, given an instanceI, an integer k, and a cardinality constraintπ, whether there is a satisfying assignment ofIof size k and satisfyingπ. So, instances of OCSP (resp., CCSP) are triples (V,C, k) (resp., quadruples(V,C, k, π)). Asolutionof an instance is a satisfying assignment satisfying the size/cardinality constraints. For both OCSP(Γ)and CCSP(Γ), we are interested in FPT with respect to the parameterk. The INDEPENDENTSETproblem is representable as OCSP(RIS), whereRIS = {(0,0),(0,1),(1,0)}. Similarly, the BICLIQUE prob- lem in which given a bipartite graph G(A, B), find twoA0 ⊆ AandB0 ⊆ B with

|A0|= |B0| =tand such that every vertex ofA0 is adjacent with every vertex ofB0. This problem is equivalent to CCSP({RBC}), where RBC is a relation on{0,1,2}

given by{(0,0),(1,0),(0,2)}.

Closures and 0-validityA constraint language is calledconstant closed(cc-, for short) if along with every (say,n-ary) relationR, anyi,1≤i≤n, and anyd∈Dthe relation obtained bysubstitution of constantsR|i;d ={(a1, . . . , ai−1, ai+1, . . . , an) | (a1, . . . , ai−1, d, ai+1, . . . , an) ∈ R}, also belongs to R. Substitution of constants

(5)

d1, . . . , dq for coordinate positionsi1, . . . , iq is defined in a similar way; the resulting relation is denoted byR|i1,...,iq;d1,...,dq. We call the smallest cc-language containing a constraint languageΓ thecc-closureofΓ. It is easy to see that the cc-closure ofΓ is the set of relations obtained from relations ofΓ by substituting constants.

Letfbe a satisfying assignment for an instanceI= (V,C, k)of OCSP(Γ)andS= {v|f(v)6= 0}. We say that the instanceI0 = (V0,C0, k0)isobtained by substituting the nonzero values offas constantsifI0is constructed as follows:V0=V\S, and for each constrainths, Ri ∈ Csuch thatvi1, . . . vir are the variables fromscontained inSand {vj1, . . . , vjq}=s\S, we include inC0the constrainth(vj1, . . . , vjq), R|i1,...ir;f(vi1),...f(vir)i.

The size constraintk0is set tokminus the size off. This operation is defined similarly for a CCSP(Γ)instanceI= (V,C, k, π), but in this case the new cardinality constraint π0is given byπ0(d) =π(d)− |{v∈V |f(v) =d}|.

A relation is said to be0-validif the all-zero tuple belongs to the relation. A con- straint languageΓ is acc0-languageif everyR ∈ Γ is 0-valid, and ifR0is a 0-valid relation obtained fromRby substitution of constants, thenR0∈Γ. Observe that ifΓ is a cc-language andΓ0is the set of 0-valid relations inΓ, thenΓ0is a cc0-language (but not necessarily a cc-language).

We say that tuplet1 = (a1, . . . , ar)is anextensionof tuplet2 = (b1, . . . , br)if they are of the same length and for every1 ≤ i ≤ r, ai = bi ifbi 6= 0. Tuple t2

is then called asubsetoft1. Aminimal satisfying extensionof an assignmentf is an extensionf0off(wheref, f0are viewed as tuples) such thatf0is satisfying, andfhas no satisfying extensionf006=f0such thatf0is an extension off00.

By repeatedly branching on the unsatisfied constraints, a simple bounded search tree algorithm can enumerate all the minimal satisfying extensions of an assignment.

Lemma 2.1. LetΓ be a finite constraint language overD. There are functionsd0Γ(k) ande0Γ(k)such that for every instance ofCSP(Γ)withnvariables, every assignmentf has at mostd0Γ(k)minimal satisfying extensions of size at mostkand all these minimal extensions can be enumerated in timee0Γ(k)nO(1).

A consequence of Lemma 2.1 is that, as in [14], CCSP(Γ)and OCSP(Γ)can be reduced to a set of 0-valid instances. We enumerate all the minimal satisfying extensions of size at mostkof the all zero assignment (wherekis the size constraint) and obtain the 0-valid instances by substituting the nonzero values as constants.

Corollary 2.2. LetΓ be a cc-language and letΓ0 ⊆Γ be the set of all 0-valid rela- tions. ThenCCSP(Γ)isFPT/W[1]-hard/BICLIQUE-hard if and only ifCCSP(Γ0)is.

The same holds forOCSP(Γ)andOCSP(Γ0).

A nonzero satisfying assignmentf is said to be aminimal (nonzero) satisfying as- signmentif it is not a proper extension of any nonzero satisfying assignment.

Lemma 2.3. Let Γ be a finite constraint language. There are functions dΓ(k)and eΓ(k)such that for any instance ofCSP(Γ)withnvariables every variablevis nonzero in at mostdΓ(k)minimal satisfying assignments of size at mostkand all these minimal satisfying assignments can be enumerated in timeeΓ(k)nO(1).

(6)

3 Properties of constraints

By Corollary 2.2, for proving Theorems 1.1 and 1.2 it is sufficient to consider only cc0-languages. Thus in the rest of the paper, we consider only cc0-languages.

3.1 Weak separability

In the Boolean case, the tractability of 0-valid constraints depends only on weak sep- arability [14]. This is not true exactly this way for larger domains: as we shall see (Theorems 4.1 and 5.1), the complexity characterizations have further conditions.

Tuplest1= (a1, . . . , ar)andt2= (b1, . . . , br)aredisjointifai= 0orbi = 0for everyi. Theunionof disjoint tuplest1andt2ist1+t2= (c1, . . . , cr)whereci=ai

ifai 6= 0andci = bi otherwise. If(a1, . . . , ar)is an extension of(b1, . . . , br), then theirdifferenceis the tuple(c1, . . . , cr)whereci =aiifbi= 0andci = 0otherwise.

A tupletiscontainedin a setC⊆Dif every nonzero entry oftis inC.

A 0-valid relationRis said to beweakly separableif the following two conditions hold: (1) For every disjoint tuplest1,t2∈R, we havet1+t2∈R. (2) For every disjoint tuplest1,t2witht2,t1+t2∈R, we havet1∈R. A constraint languageΓ is said to be weakly separable if every relation fromΓ is weakly separable. If constraint language Γ is not weakly separable, then we call a triple(R,t1,t2),R ∈ Γ, witnessing that a union counterexampleift1,t2violate condition (1), while ift1,t2violate condition (2) it is called adifference counterexample.

The following combinatorial property is the key for solving weakly separable in- stances (this property does not necessarily hold for arbitrary relations):

Lemma 3.1. LetΓbe a weakly separable finite cc0-language overDandIan instance ofCCSP(Γ)orOCSP(Γ).

(1) Any satisfying assignment ofIis a union of pairwise disjoint minimal ones.

(2) If there is a satisfying assignmentf withf(v) =dfor some variablevandd∈D, then there is a minimal satisfying assignmentf0withf0(v) =d.

In light of Lemma 3.1(1), it is sufficient to enumerate every minimal assignment of size at mostk(using Lemma 2.3) and then to find a disjoint minimal assignments that together satisfy the size/cardinality constraints. As the total size of the assignments we select is at mostkand furthermore Lemma 2.3 implies that each variable is nonzero in at most a bounded number of these minimal assignments, the fixed-parameter tractability of finding such disjoint assignments can be shown by standard arguments.

Theorem 3.2. LetΓ be a finite weakly separable cc0-language overD.

1. A solution to an instance(V,C, k, π)ofCCSP(Γ)can be found in timeeΓ(k)|V|O(1). 2. A solution to an instance(V,C, k)ofOCSP(Γ)can be found in timek|D|−1eΓ(k)|V|O(1).

3.2 Morphisms

Homomorphisms and polymorphisms are standard tools for understanding the com- plexity of constraints [3,10]. We make use of the notion of multivalued morphisms, a

(7)

generalization of homomorphisms, that in a different context has appeared in the liter- ature (see, e.g. [16]) under the guise of hyperoperation. We classify the values into 4 types according to the existence of such morphisms (Definition 3.3). This classification and the observation that these types play an essential role in the way the MVM gadgets (Section 3.4) work are the main technical ideas behind the hardness proofs.

For a subset0 ∈ D0 ⊆ Dand ann-ary relationR onD, byR|D0 we denote the relationR∩(D0)n. For a languageΓ,Γ|D0contains every relationR|D0 forR∈Γ.

For a tuplet= (a1, . . . , ar)∈dom(Γ)r, we denote byh(t)the tuple(h(a1), . . . , h(ar)).

AnendomorphismofΓ is a mappingh:dom(Γ)→dom(Γ)such thath(0) = 0and for every R ∈ Γ andt ∈ R, the tupleh(t)is also in R. Observe that the require- menth(0) = 0is nonstandard, but it is natural in our setting. The mapping sending all elements of dom(Γ)to0is an endomorphism of any 0-valid language. Aninner homo- morphismofΓfromD1toD2with0∈D1, D2⊆dom(Γ)is a mappingh:D1→D2 such thath(0) = 0andh(t)∈Rholds for anyr-ary relationR∈Γ andt∈Dr1∩R.

Amultivalued morphism of Γ is a mappingφ : dom(Γ) → 2dom(Γ) such that φ(0) ={0}and for everyR∈Γand(a1, . . . , ar)∈R, we haveφ(a1)× · · · ×φ(ar)⊆ R. Aninner multivalued morphismφfromD1toD2where0∈D1, D2⊆dom(Γ)is defined to be a mappingφ:D1→2D2 such thatφ(0) ={0}and for everyR∈Γ and (a1, . . . , ar)∈R|D1, we haveφ(a1)× · · · ×φ(ar)⊆R|D2.

Observe that ifφ :dom(Γ)→ 2dom(Γ)is a multivalued morphism of a constraint languageΓ, andφ0 : dom(Γ) → 2dom(Γ)is a mapping such that φ0(d) ⊆ φ(d)for d ∈ dom(Γ), then φ0 is a multivalued morphism. Similar statement holds for inner multivalued morphismsψ, ψ0:D1→2D2.

Theproductg◦hof two endomorphisms or inner homomorphisms is defined by (g◦h)(x) =h(g(x))for everyx∈D. Ifφandψare (inner) multivalued morphisms then their productφ◦ψis given by(φ◦ψ)(x) =S

y∈φ(x)ψ(y).

Forx, y∈dom(Γ), we say thatxproducesyinΓ ifΓ has a multivalued morphism φwithφ(x) = {0, y}andφ(z) = {0}for everyz 6= x. Observe that the relation “x producesy” is transitive.

Definition 3.3. A valuey∈dom(Γ)is

1. regular if there is no multivalued morphism φwhere 0, y ∈ φ(x) for somex ∈ dom(Γ),

2.semi-regularif there is a multivalued morphismφwhere0, y ∈ φ(x)for somex∈ dom(Γ), but there is nox∈dom(Γ)that producesy,

3.self-producingifyproducesy, and for everyxthat producesy,yalso producesx.

4.degenerateotherwise.

It will sometimes be convenient to say that a valueyhastype1, 2, 3, or 4. We need the following simple properties:

Proposition 3.4. If there is an endomorphism hwithh(x) = y, then the type ofx cannot be larger than that ofy.

Proposition 3.5. Every degenerate valueyis produced by a nondegenerate valuex.

(8)

3.3 Components

The structure of endomorphisms and inner homomorphisms plays an important role in our study. LetΓ be a cc0-language. AretractiontoX ⊆D\ {0}is a mapping retX

such that retX(x) = xfor x ∈ X and retX(x) = 0otherwise. A nonempty subset C ⊆ D\ {0}is acomponentofΓ if retC is an endomorphism ofΓ. A component Cisminimalif there is no component that is a proper subset ofC. If a setCis not a component, then there is a relationR∈Γandt∈Rsuch thatt0 =retCt6∈R. Observe that the intersection of two components is also a component (if it is nonempty). Hence for every nonemptyX ⊆D\ {0}, there is a unique inclusion-wise minimal component that containsX; this component is called the componentgenerated byX(or simply the component ofX). The importance of components comes from the following result:

Lemma 3.6. IfΓ is not weakly separable, then either

– there is a union counterexample(R,t1,t2)such thatt1(resp.,t2) is contained in a component generated by a valuea1(resp.,a2), or

– there is a difference counterexample(R,t1,t2)such that botht1andt2are contained in a component generated by a valuea1.

3.4 Multivalued morphism gadgets

For a relationR and a tuplet ∈ R, we denote bysupp(t)the set of coordinate po- sitions oftoccupied by nonzero elements. Letsuppt(R)denote the relation obtained by substituting 0 into all coordinates of R except forsupp(t), i.e. ifR is r-ary and supp(t) ={1, . . . , r} \ {i1, . . . , ir}thensuppt(R) =R|i1,...,ir;0,...,0.

For a cc0-languageΓand some0∈D0 ⊆dom(Γ), amultivalued morphism gadget MVM(Γ, D0)consists of|D0| −1bags of verticesBd,d∈D0\ {0}. The number of variables in each bag will be specified every time it is used. The gadget is equipped with the following set of constraints. For everyR∈ Γ and every tuplet= (a1, . . . , ar)∈ R|D0 (with, say,supp(t) ={i1, . . . , iq}), we add all possible constraintshs,suppt(R)i wheres= (vi1, . . . , viq)such thatvj ∈Baj for everyj ∈ {i1, . . . , iq}. Thestandard assignmentof a gadget assignsato every variable in bagBa; observe that it assignment satisfies every constraint of the gadget. We say that bagBaand the variables in bagBa

representa.

Proposition 3.7. Let 0 ∈ D0 ⊆ dom(Γ). Consider a satisfying assignmentf of an MVM(Γ, D0)gadget. If hf : D0 → 2dom(Γ)is a mapping such thathf(a)is the set of values appearing in bagBa of the gadget andhf(0) = {0}, thenhf is an inner multivalued morphism ofΓ fromD0todom(Γ).

We define gadgets connecting MVM gadgets. The gadget NAND(G1, G2) on MVM(Γ, D0)gadgetsG1,G2has constraints as follows. For everyR∈Γ and disjoint tuplest1= (a1, . . . , ar),t2= (b1, . . . , br)inR|D0, we add a constrainths,suppt

1+t2Ri, where s = (vi1, . . . , viq) with{i1, . . . iq} = supp(t1+t2), such that vj for j ∈ {i1, . . . iq}is in bagBaj ofG1ifaj 6= 0andvjis in bagBbj ofG2ifbj 6= 0.

If one ofG1,G2has the standard assignment and the other is fully zero, then all the constraints in NAND(G1, G2)are satisfied. On the other hand, if bothG1andG2have

(9)

the standard assignment and there is a union counterexample, then NAND(G1, G2)is not satisfied. For the reductions, we need this second conclusion not only if bothG1 andG2have the standard assignment, but also assignments that “behave well” in some sense. The right notion for our purposes is the following: An inner homomorphismh: D0→dom(Γ)ist-recoverableifΓhas an endomorphismh0such that(h◦h0)(t) =t.

Lemma 3.8. Let0 ∈ D0 ⊆ dom(Γ)and let there be a NAND(G1, G2)gadget on MVM(Γ, D0)gadgetsG1,G2.

(1) If one ofG1andG2has the standard assignment and the other gadget is fully zero, then all constraints ofNAND(G1, G2)are satisfied.

(2) IfΓ|D0has a union counterexample(R,t1,t2)and an assignmentτis such that for i= 1,2,τ onGiis ati-recoverable inner homomorphismhi, thenNAND(G1, G2)is not satisfied.

The IMP(G1, G2)gadget is defined similarly, but instead of t1,t2 ∈ R|D0, we requiret2,t1+t2∈R|D0. An analog of Lemma 3.8 holds for such gadgets.

When the multivalued morphism gadgets are used in the reductions, it will be es- sential that the bags of the gadgets have very specific sizes. We will ensure somehow that in a solution each bag is either fully zero or fully nonzero. Our aim is to choose the sizes of the bags in such a way that if the sum of the sizes of certain bags add up to a certain integer, then this is only possible if there is exactly one bag of each size.

Fix an integertand a set0 ∈D0 ⊆D. It will be convenient to assume thatD0 = {0,1, . . . , d}. ByZt,D0we denote the set of integersZi,jt,D0for1≤i≤tand1≤j≤ d, given byZi,jt,D0 := (4td)2td+(id+j)+ (4td)5td−(id+j).

Lemma 3.9. Let us fixtandD0 ={0,1, . . . , d}. IfA⊆ Zt,D0 andBis a multiset of values fromZt,D0with|P

S∈AS−P

S∈BS|<(4td)2td, thenBis a set andB=A.

3.5 Frequent instances

The following property plays an important role in our algorithms. We say that an in- stance of CCSP(Γ)or OCSP(Γ), with parameterkisc-frequent(for some integerc) if for everyd∈dom(Γ)\ {0}there are at leastcvariables that take valuedin satisfying assignments of size at mostk. The algorithm of Lemma 2.1 can be used to decide in fpt-time whether an instance isc-frequent. Lemma 3.10 shows that if an instance is not c-frequent, it can be reduced toc-frequent instances satisfying an additional technical requirement. This is done by eliminating values that appear on less thancvariables one by one. A subset0 ∈ D0 ⊆ dom(Γ)isclosed(with respect toΓ) ifΓ has no inner homomorphism fromD0that maps some element ofD0to an element in dom(Γ)\D0.

Lemma 3.10. Let Γ be a finite cc0-language. Given an instance I ofCCSP(Γ) or OCSP(Γ)with parameterkand an integerc, we can construct in timefΓ(k, c)nO(1)a set ofc-frequent instances such that

1. instanceIhas a solution iff at least one of the constructed instances has a solution, 2. each instanceIiis an instance ofCCSP(Γ|Di), respectively,OCSP(Γ|Di), for some Di⊆dom(Γ)closed inΓ, and 3. the parameterkiofIiis at mostk.

(10)

4 Classification for size constraints

Unlike in the Boolean case, weak separability ofΓ is not equivalent to the tractability of OCSP(Γ): it is possible thatΓ is not weakly separable, but OCSP(Γ)is FPT. However, if there is a subsetD0 ⊆dom(Γ)of the domain such thatΓ|D0 is not weakly separable andD0has “no special problems” in a certain technical sense, then OCSP(Γ)is W[1]- hard. We need the following definitions. A valued∈ dom(Γ)isweakly separableif Γ|{0,d}is weakly separable. AcontractionofΓ toD0 with0 ∈ D0 ⊆ dom(Γ)is an endomorphismh : dom(Γ) → D0 such thath(d) 6= 0for anyd ∈ dom(Γ)\ {0}.

ContractionhisproperifD0 6=dom(Γ).

The main result for the size constraints CSP is the following dichotomy theorem.

Theorem 4.1. LetΓ be a finite cc0-language. If there are two sets{0} ⊆D2⊆D1⊆ dom(Γ)such that (1)D1is closed inΓ, (2)Γ|D1has a contractionhtoD2, (3)Γ|D2 has no proper contraction, (4)Γ|D1 has no weakly separable value that is either de- generate or self-producing, and (5) Γ|D2 is not weakly separable, then OCSP(Γ)is W[1]-hard. If there are no suchD1, D2, thenOCSP(Γ)is FPT.

We present an algorithm solving the FPT cases of the problem and then an important case of the hardness proof, demonstrating the concepts introduced in Section 3.

The algorithm.LetI= (V,C, k)be an instance of OCSP(Γ). Let us use Lemma 3.10 to obtain instancesI1, . . . , I`such thatIi is ak-frequent instance of OCSP(Γ|Di)for some closed setDi⊆dom(Γ). Fix someiand lethbe a contraction ofΓ|Disuch that

|h(Di)|is minimum possible. SetD1:=DiandD2:=h(Di).

The pairD1, D2violates one of properties (1)–(5) in Theorem 4.1. By the wayD1

andD2defined, it is clear that (1) and (2) hold. If the pair violates (3), then letgbe a proper contraction ofΓ|D2. Thenh◦gis a contraction ofΓ|D1 such that|g(h(D1))|

is strictly less than |h(D1)|, a contradiction. IfD1, D2 violate (4), then instance Ii

always has a solution. Indeed, suppose thatd∈ D1is weakly separable anddis pro- duced byd0 ∈ D1 (possiblyd = d0). Letki be the parameter ofIi; thenki ≤ kby Lemma 3.10(4). SinceIiisk-frequent, the setSof variables ofIiwhered0can appear in a satisfying assignment of size at mostkcontains at leastkelements. Asd0produces d,Γ|D1 has a multivalued morphismφsuch thatφ(d0) = {0, d}andφ(a) = {0}for a∈D1\ {d0}. Therefore, for everyv∈S, the assignmentδv,dwithδv,d(v) =dand 0 everywhere else is a satisfying assignment ofIi. Asdis weakly separable inΓ|D1, the disjoint union ofkisuch assignmentsδv,dis a solution toIi. Finally, if (5) is violated, then instanceIiof OCSP(Γ|D1)has a solution if and only if it has a solution restricted toD2, and the latter can be decided using Lemma 3.2 (asΓ|D2is weakly separable).

Hardness.We say that a setp1,. . .,p`of endomorphisms ofΓ is apartition set if, for everyd∈D0\ {0},pi(d)6= 0for exactly onei. Thesumof the partition set is the mappinghdefined such thath(d)is the unique nonzero value inp1(d),. . .,p`(d).

The partition set isgoodif the sum of these pairwise disjoint endomorphisms is also an endomorphism; otherwise, the partition set isbad.

Lemma 4.2. If every value is regular inΓ|D2, there is no bad partition set inΓ|D2, and there is a union counterexample inΓ|D2, thenOCSP(Γ)isW[1]-hard.

(11)

Proof. AssumeD2 = {0,1, . . . , p}. The reduction is from MULTICOLORED INDE-

PENDENTSET, the following W[1]-hard problem: Given a graphGwith verticesvi,j (1≤i≤t,1≤j≤n), find an independent set of sizetof the form{v1,y1, . . . , vt,yt}.

For eachvi,j, we introduce a gadget MVM(Γ, D2)denoted byGi,j. The bag ofGi,j

corresponding to value d ∈ D2 \ {0} has size Zi,dt,D2. The size constraint is k :=

Pt i=1

P

d∈D2\{0}Zi,dt,D2. If vi,j and vi0,j0 are adjacent, then we add the gadget NAND(Gi,j, Gi0,j0). Also, for every 1 ≤ i ≤ t, 1 ≤ j < j0 ≤ n, we add the NAND(Gi,j, Gi,j0)gadget.

Suppose that there is a solutionCof size exactlytfor the MULTICOLOREDINDE-

PENDENTSETinstance. If vertexvi,jis inC, then set the standard assignment on gad- getGi,j, otherwise set the zero assignment. It is clear that this results in an assignment satisfying the size constraint. By Lemma 3.8(1), the constraints of the MVM(Γ, D2) gadgets as well as the NAND(Gi,j, Gi,j0)gadgets are satisfied.

For the other direction, suppose that there is a solutionτ satisfying the size con- straint. First we observe thatτcontains values only fromD1. Indeed, ifc6∈D1appears in bagBdof a gadgetGi,j, thenτ onGi,jis an inner homomorphismgofΓ fromD2

withg(d) =c. Nowh◦gmaps a value ofD1toc, contradicting the assumption thatD1

is a closed set. By applyinghon a solution, it can be assumed that only values fromD2

are used. Thusτon the MVM(Γ, D2)gadgets provides multivalued morphisms ofΓ|D2. Since every value is regular inΓ|D2, each bag is either fully zero or fully nonzero. The sizes of the nonzero bags add up exactly to the size constraintk. Thus by Lemma 3.9, there is exactly one nonzero bag with sizeZi,dt,D2for every1≤i≤tandd∈D2\ {0}.

Take a union counterexample(R,t1,t2)inΓ|D2; by Lemma 3.6, we can assume thatt1,t2are in the components ofΓ|D2generated by somea1, a2∈D2, respectively.

We show that for every1≤i≤t, there are valuesy1i andyi2such that every endomor- phism ofΓ|D2 given by Gi,y1

i (resp.,Gi,y2

i) ist1-recoverable (resp.,t2-recoverable).

For a fixedi, letg1,. . .,gn be arbitrary endomorphisms ofΓ|D2 given byGi,1,. . ., Gi,n, respectively. Since the sizes of nonzero bags are all different, these endomor- phisms are pairwise disjoint and they form a partition set. As there is no bad partition set inΓ|D2, their sumg is an endomorphism ofΓ|D2. SinceΓ|D2 has no proper con- tractions,ghas to be a permutation and hencegsis the identity for somes≥1. There is a unique 1 ≤ yi1 ≤ n such thatgy1

i(a1) 6= 0. The homomorphism gy1

i ◦ gs−1 maps every a ∈ D2 either to 0 ora; i.e., gy1

i ◦gs−1 = retS for some setS ⊆ D2

containinga1. HenceS is a component containinga1andS contains every value of t1. It follows thatgy1

i given byGy1

i ist1-recoverable. A similar argument works for yj2, thus the required values yi1, yi2 exist. Let us observe that it is not possible that yi1 6= yi2: by Lemma 3.8(2) the constraints of NAND(Gi,y1

i, Gi,y2

i) are not satisfied in this case. Let C contain vertex vi,j ifj = y1i = y2i. It follows that C is a mul- ticolored independent set: if verticesvi,j,vi0,j0 are adjacent, then some constraint of NAND(Gi,j, Gi0,j0)=NAND(Gi,y1

j, Gi0,yj2)is not satisfied. ut

(12)

5 Classification for cardinality constraints

The characterization of the complexity of CCSP(Γ)requires a new definition, which was not relevant for OCSP(Γ). ThecoreofΓ is the component generated by the set of all nondegenerate values in dom(Γ). We say thatΓis a core if the core ofΓis dom(Γ).

Theorem 5.1. LetΓ be a cc0-language. If there is a0 ∈D0 ⊆dom(Γ)s.t.Γ|D0 is a core and not weakly separable, thenCCSP(Γ)isBICLIQUE-hard, and FPT otherwise.

A significant difference between the hardness proofs of OCSP(Γ)and CCSP(Γ)is that in OCSP(Γ), we can assume that no proper contraction exists and this can be used to show that certain endomorphisms have to be permutations (see Lemma 4.2). For CCSP(Γ), we cannot make this assumption, thus we need a delicate argument, making use of the cardinality constraint, to achieve a similar effect.

References

1. Bessi`ere, C., Hebrard, E., Hnich, B., Walsh, T.: The complexity of global constraints. In:

Wallace, M. (ed.) AAAI. LNCS, vol. 3258, pp. 112–117. Springer (2004)

2. Bulatov, A.: Tractable conservative constraint satisfaction problems. In: LICS. pp. 321–330.

IEEE Computer Society (2003)

3. Bulatov, A.A., Jeavons, P., Krokhin, A.A.: Classifying the complexity of constraints using finite algebras. SIAM J. Comput. 34(3), 720–742 (2005)

4. Bulatov, A.A., Marx, D.: The complexity of global cardinality constraints. In: LICS. pp.

419–428. IEEE Computer Society (2009)

5. Creignou, N., Schnoor, H., Schnoor, I.: Non-uniform boolean constraint satisfaction prob- lems with cardinality constraint. CSL. LNCS, vol. 5213, pp. 109–123. Springer (2008) 6. Downey, R.G., Fellows, M.R.: Parameterized Complexity (1999)

7. Feder, T., Vardi, M.Y.: Monotone monadic snp and constraint satisfaction. In: STOC. pp.

612–622 (1993)

8. Flum, J., Grohe, M.: Parameterized Complexity Theory. Springer, Berlin (2006)

9. Jeavons, P., Cohen, D., Gyssens, M.: Closure properties of constraints. J. ACM 44, 527–548 (1997)

10. Jeavons, P., Cohen, D., Gyssens, M.: How to determine the expressive power of constraints.

Constraints 4, 113–131 (1999)

11. Khanna, S., Sudan, M., Trevisan, L., Williamson, D.P.: The approximability of constraint satisfaction problems. SIAM J. Comput. 30(6), 1863–1920 (2001)

12. Kratsch, S., Wahlstr¨om, M.: Preprocessing of min ones problems: A dichotomy. In: ICALP (1). LNCS, vol. 6198, pp. 653–665. Springer (2010)

13. Krokhin, A.A., Marx, D.: On the hardness of losing weight. In: ICALP. LNCS, vol. 5125, pp. 662–673. Springer (2008)

14. Marx, D.: Parameterized complexity of constraint satisfaction problems. Computational Complexity 14

15. R´egin, J.C., Gomes, C.P.: The cardinality matrix constraint. In: CP. LNCS, vol. 3258, pp.

572–587. Springer (2004)

16. Rosenberg, I.: Multiple-valued hyperstructures. In: ISMVL. pp. 326–333 (1998) 17. Schaefer, T.J.: The complexity of satisfiability problems. In: STOC. pp. 216–226 (1978) 18. Szeider, S.: The parameterized complexity of k-flip local search for sat and max sat. SAT.

LNCS, vol. 5584, pp. 276–283. Springer (2009)

Hivatkozások

KAPCSOLÓDÓ DOKUMENTUMOK

We also remark that the number of iterations in algorithms for the transfer theorems give generic upper bounds on the trial complexity of the hidden CSPs In the constraint index

Proof The first observation is that R violates the first requirement of weak separability in Lemma 2.2. Otherwise R would be satisfied by every assignment that has value 1 only

In this paper, we study the fixed-parameter tractability of constraint satisfaction problems parameterized by the size of the solution in the following sense: one of the

We study the complexity of local search for the Boolean constraint satisfaction problem (CSP), in the following form: given a CSP instance, that is, a collection of constraints, and

Theorem 10 (FPT – number of values) Finding an optimal satisfying assignment of the SoftAllEqual min G constraint is fixed-parameter tractable with respect to λ, the number of values

The preliminary version of this paper adapted the framework of random sampling of important separators to directed graphs and showed the fixed-parameter tractabil- ity of

Task: classify which classes A of relational structures make the problem fixed-parameter tractable parameterized by the size of the query.... Two

Trivial answer: For every fixed hypergraph, the problem can be solved in polynomial time (every hypergraph has a constant number of vertices).... CSP