Abstract 1 Introduction 2 Preliminaries 3 Algorithms for the dual discriminator 4 NU polymorphism as necessary condition for constant-factor approximability 5 Application: Dichotomy for MinCostCSP with permutation constraints References

On the Constant-Factor Approximability of Minimum Cost Constraint Satisfaction Problems

Ian DeHaan ORCID University of Michigan, Ann Arbor, MI, USA Neng Huang ORCID University of Michigan, Ann Arbor, MI, USA Euiwoong Lee ORCID University of Michigan, Ann Arbor, MI, USA
Abstract

We study minimum cost constraint satisfaction problems (MinCostCSP) through the algebraic lens. We show that for any constraint language Γ which has the dual discriminator operation as a polymorphism, there exists a |D|-approximation algorithm for MinCostCSP(Γ) where D is the domain. Complementing our algorithmic result, we show that any constraint language Γ where MinCostCSP(Γ) admits a constant-factor approximation must have a near-unanimity (NU) polymorphism unless P = NP, extending a similar result by Dalmau et al. on MinCSPs. These results imply a dichotomy of constant-factor approximability for constraint languages that contain all permutation relations (a natural generalization for Boolean CSPs that allow variable negation): either MinCostCSP(Γ) has an NU polymorphism and is |D|-approximable, or it does not have any NU polymorphism and is NP-hard to approximate within any constant factor. Finally, we present a constraint language which has a majority polymorphism, but is nonetheless NP-hard to approximate within any constant factor assuming the Unique Games Conjecture, showing that the condition of having an NU polymorphism is in general not sufficient unless UGC fails.

Keywords and phrases:
Constraint satisfaction problems, approximation algorithms, polymorphisms
Category:
APPROX
Funding:
Euiwoong Lee: Supported in part by NSF grant CCF-2236669.
Copyright and License:
[Uncaptioned image] © Ian DeHaan, Neng Huang, and Euiwoong Lee; licensed under Creative Commons License CC-BY 4.0
2012 ACM Subject Classification:
Theory of computation Approximation algorithms analysis
Related Version:
Full Version: https://arxiv.org/abs/2507.08693
Acknowledgements:
The authors would like to thank anonymous reviewers for their helpful comments.
Editors:
Alina Ene and Eshan Chattopadhyay

1 Introduction

Constraint satisfaction problems (CSPs) are a central topic of study in theoretical computer science. In an instance of a CSP, we are given a finite set of variables taking values in a finite domain and a finite set of constraints on these variables, and our goal is to find an assignment to the variables so that all constraints are satisfied. CSPs provide a very expressive framework that encompasses many natural combinatorial problems, including satisfiability problems, graph coloring, and solving linear systems. CSPs in their full generality are NP-hard, and therefore it is natural to consider restrictions which lead to interesting tractable subclasses of CSPs. One very influential type of restrictions is to restrict the constraint language, that is, to restrict the set of relations that can be used as constraints. In this line of work, the ultimate goal is to obtain a dichotomy, if it exists, which characterizes the boundary between tractable and NP-hard constraint languages. The first such result, obtained by Schaffer [41], gave a complete classification of tractable Boolean CSPs. In their landmark paper [22], Feder and Vardi conjectured that a dichotomy exists for CSPs over general domains. This conjecture, known as the CSP Dichotomy Conjecture, led to a series of fruitful work culminating in the proof of the conjecture obtained independently by Bulatov [12] and by Zhuk [46].

Compared to the standard decision variant of CSPs, there are many natural optimization CSP variants whose complexity landscape is less understood. The most well-studied optimization variant is arguably the maximum constraint satisfaction problem (MaxCSP), where the objective is to find an assignment that maximizes the number of satisfied constraints. Interesting examples in this class include maximum cut and maximum satisfiability problems. For MaxCSPs, Raghavendra showed that the optimal approximation ratio111For a maximization (resp. minimization) problem, an approximation algorithm achieves an approximation ratio of α, if on an input instance with global optimal Opt, it produces a solution whose objective value is at least αOpt (resp. at most αOpt). can be obtained by solving and rounding a generic semidefinite programming relaxation of the problem [40] (note that a constant approximation ratio for MaxCSP can be trivially obtained by uniform random assignment), assuming that the Unique Games Conjecture (UGC) [31] holds. However, the exact approximation ratio is not explicit in Raghavendra’s result, and the ratios for many interesting MaxCSPs are still open (see e.g., [8, 9]). For MinCSPs, the objective is to minimize the number of unsatisfied constraints. MinCSP can be much harder than the corresponding MaxCSP in terms of the approximation ratio. In particular, it is at least as hard as the decision problem since an approximation algorithm has to satisfy every constraint when the instance is satisfiable. Valued CSPs generalize MinCSP by replacing 0-1 constraints with valued constraints, so that for any constraint different partial assignments can incur different costs. Thapper and Živný obtained a complexity dichotomy for the task of exact minimization for finite-valued CSPs [45], but the approximability question for this problem is still poorly understood. Ene et al. showed that under some mild technical assumption, there is a generic linear programming relaxation for finite-valued CSPs that is optimal for constant-factor approximation, unless UGC fails [21]. But unlike for MaxCSPs, it is unknown how to round this linear program. Dalmau et al. gave some algebraic conditions which indicate where the boundary of constant-factor approximability (or the lack thereof) for valued CSPs may lie [18], but a full characterization of constant-factor approximability is still unresolved.

In this work, we consider an optimization CSP variant called minimum cost CSP (MinCostCSP). In this variant, assigning any value to a variable comes with a cost, and the cost is a function of the variable-value pair. Our goal is to find a satisfying assignment that minimizes the total cost. MinCostCSP can be seen as a mixed variant between decision and optimization problems, in that we are still required to find a satisfying assignment. It can also be thought of as a special case of valued CSP, where we have some unary constraints representing the variable costs and all other constraints incur 0 cost if satisfied or infinite cost otherwise. MinCostCSP is a very natural CSP variant which avoids the full generality of valued CSPs, yet still includes many interesting problems, such as graph and hypergraph vertex cover, min-ones CSP [30] and minimum solution CSP [29].

We study the approximability, and in particular constant-factor approximability of MinCostCSP. Like many aforementioned results, our study is based on the universal-algebraic approach (see e.g., [34] for a survey on this approach applied to the exact optimization of valued CSPs), where we investigate the algebraic structure of any constraint language via its polymorphisms, which can be thought of certain high-dimensional symmetry that exists in the space of satisfying assignments. More specifically, we seek to algorithmically exploit the existence of desirable polymorphisms or show hardness results based on the lack thereof.

Our contribution

We obtain constant-factor approximability for constraint languages that have the dual discriminator operation as a polymorphism. These constraint languages can be thought of as generalization of 2-SAT to arbitrary finite domains. We give two algorithms for this class of problems, one using a greedy approach and the other based on a natural linear programming relaxation of the problem. Both algorithms crucially use the consistency notion called (2,3)-minimality [4].

Theorem 1.

Let Γ be a constraint language over some domain D that has the dual discriminator operation as its polymorphism. Then MinCostCSP(Γ) can be |D|-approximated in polynomial time.

Complementing our algorithmic result, we obtain the following hardness condition which says that constant-factor approximation is NP-hard for any constraint language which does not have a near-unanimity (NU) polymorphism.

Theorem 2.

Let Γ be a constraint language such that MinCostCSP(Γ) has a constant-factor approximation, then Γ has a NU polymorphism, unless P = NP.

Near unanimity operations are well-studied in universal algebra (see e.g., [1]), and they have also appeared in the study of CSPs [22, 18, 16]. In particular, Dalmau et al. showed that for valued CSPs the existence of NU polymorphisms is also a necessary condition for constant-factor approximability [18]. It can be verified that for MinCostCSP over the Boolean domain, the condition of having an NU polymorphism is not only necessary but also sufficient for constant-factor approximability (see Remark 40 for more discussion). However, as soon as the domain has at least 3 elements, there exist constraint languages which have NU polymorphisms yet does not admit constant-factor approximation, unless the UGC fails. We present such an example in Section 4.3.

Finally, as an application of our hardness and algorithmic results, we fully classify the constant-factor approximability of constraint languages that include all permutation relations, showing that the existence of an NU polymorphism is also a sufficient condition for this class. These languages can be thought of as a natural generalization of Boolean CSPs where we are allowed to apply constraints to negated variables. Our classification relies on the classification of homogeneous algebras by Marchenkov [36].

Theorem 3.

Let Γ be a constraint language over some domain D that contains all permutation relations over D. Then MinCostCSP(Γ) can be |D|-approximated if Γ has an NU polymorphism, and is NP-hard to approximate within any constant factor otherwise.

Related work

The approximability of MaxCSP, MinCSP, as well as MinCostCSP over the Boolean domain was fully classified by Khanna et al. [30]. In particular, for MinCostCSP they obtained the following complete classification: MinCostCSP(Γ) can be solved to optimality in polynomial time if Γ is “width-2 affine”, that is, Γ can be expressed as a conjunction of linear equations over 𝔽2 where each equation has at most 2 variables; the problem can be approximated within a constant factor in polynomial time if Γ can be expressed as a 2CNF-formula, or if Γ is IHB-B+ (expressible as a CNF formula where each clause is of the form x1xk, ¬x1x2, or ¬x1 where kK for some K depending on Γ), or if Γ is IHB-B (defined analogously to IHB-B+ with every literal replaced by its negation). Otherwise, MinCostCSP(Γ) is NP-hard to approximate within any constant factor. (See Remark 40 for a more detailed discussion in the context of our results.)

Over the general domain, a dichotomy for solving MinCostCSP(Γ) optimally was obtained by Takhanov [44]. Takhanov’s characterization is based on local algebraic conditions satisfied by polymorphisms of Γ.

Kumar et al. showed that for a large class of covering and packing problems that can be expressed as MinCostCSP (they called it “Strict-CSP”) over the general domain, a generic linear programming relaxation gives the optimal approximation ratio achievable in polynomial time, assuming the Unique Games Conjecture [35]. Their result generalizes the earlier UGC-based hardness results for vertex cover [33] and the k-uniform hypergraph vertex cover problems [2].

An important special case for MinCostCSP(Γ) where Γ consists of one single binary relation has been studied in the literature under the name “min-cost graph homomorphism” (in the case where the binary relation is symmetric) or “min-cost di-graph homomorphism” (in the general binary case). Dichotomy results for optimally solving these problems are known based on graph-theoretic properties [25, 27]. Hell et al. gave a similar dichotomy for constant-factor approximability for the min-cost graph homomorphism problem in the case where the graph (equivalently, the binary relation) is reflexive (every vertex has a self-loop) or irreflexive (no vertex has a self-loop) [26].222We note that an ICALP’19 paper [39] claimed that the following dichotomy for constant-factor approximability holds over all (undirected) graphs: either a graph G has a conservative majority polymorphism and is constant-factor approximable, or it does not and is NP-hard to approximate within any constant factor. Our Theorem 45 contradicts this claim under the Unique Games Conjecture and PNP.

Another CSP variant closely related to MinCostCSP  is ListCSP which can be thought of as a special case of MinCostCSP where the costs take values in {0,}. Bulatov obtained a complete classification for this problem (under the name “conservative CSP”) based on the algebraic approach [10] (see also [3, 11]).

Organization of the paper

The rest of the paper is organized as follows. In Section 2, we formally define the problems and introduce some algebraic concepts that are needed throughout the paper. In Section 3, we present our main algorithmic results, proving Theorem 1. In Section 4, we prove some algebraic conditions sufficient for reductions between MinCostCSPs, and use them to prove Theorem 2. Finally, in Section 5, we use our results to give a dichotomy of constant-factor approximability for MinCostCSPs that contain all permutation relations, proving Theorem 3.

2 Preliminaries

2.1 CSP, ListCSP, and MinCostCSP

Let D be a finite set. A relation over D is a subset RDk for some positive integer k, where D is called the domain of R and k is called the arity of R. A set of relations Γ over the same domain D is called a constraint language. Throughout this paper, any constraint language we consider will be assumed to contain finitely many relations whose common domain will be denoted by D. The elements in D will be referred to as labels.

Definition 4.

Let Γ be a constraint language. An instance of CSP(Γ) is a tuple I=(V,𝒞), where V is a finite set of variables and 𝒞 a finite set of constraints. Each constraint C𝒞 is of the form (R,S), where R is a relation in Γ with some arity k and SVk a k-tuple of variables. An assignment for I is a function A:VD. We say that A satisfies a constraint C=(R,(x1,,xk)) if (A(x1),,A(xk))R, and we say that A is a satisfying assignment for I=(V,𝒞) if A satisfies every constraint in 𝒞.

One closely related variant of CSP is the following ListCSP problem. This problem has also been referred to as conservative CSP in the literature.

Definition 5.

Let Γ be a constraint language. An instance of ListCSP(Γ) is a tuple I=(V,𝒞,{Rx}xV), where V is a finite set of variables and 𝒞 a finite set of constraints, as in the definition of CSP(Γ). In addition to V and 𝒞, we are also given a subset RxD for every variable xV. We say that A is a satisfying assignment for I=(V,𝒞,{Rx}xV) if A satisfies every constraint in 𝒞 and A(x)Rx for every xV.

ListCSP may be equivalently viewed as the ordinary CSP where all unary constraints are allowed in addition. In this paper, we will mainly focus on MinCostCSP, which further generalizes ListCSP.

Definition 6.

Let Γ be a constraint language. An instance of MinCostCSP(Γ) is a tuple I=(V,𝒞,𝚌𝚘𝚜𝚝), where V and 𝒞 are the same as they are in the definition of CSP(Γ), and we are also given a function 𝚌𝚘𝚜𝚝:V×D0{+}. For any assignment A for I, the cost of A is defined to be 𝚌𝚘𝚜𝚝I(A)=xV𝚌𝚘𝚜𝚝(x,A(x)). The goal is find a satisfying assignment with the minimum cost.

For any MinCostCSP instance I, the cost of any optimal solution is denoted by Opt(I):=minA𝚌𝚘𝚜𝚝I(A), where A ranges over all satisfying assignments for I. Although we allowed infinite costs in the definition of MinCostCSP, this is not essential in the context of approximability. In fact, we may simulate infinite cost by setting costs to be prohibitively high, say larger than |V| times the maximum of any other finite cost, so that no approximation algorithm will pick the label. The inclusion of the infinite cost conveniently allows us to assume without loss of generality that Γ contains all unary relations.

Observation 7.

Let Γ be a constraint language over some domain D and Γ=Γ{SDS}. Then MinCostCSP(Γ) and MinCostCSP(Γ) are equivalent. Namely, any instance of MinCostCSP(Γ) can be solved as an instance of MinCostCSP(Γ) and vice versa.

Proof.

One direction is clear since ΓΓ. For the other direction, for any unary constraint S(x) where SD (the constraint which says the label of x must be in S), we simply set 𝚌𝚘𝚜𝚝(x,a)= for any aS.

Observation 7 implies that MinCostCSP(Γ) contains ListCSP(Γ) as a special case. In particular, if ListCSP(Γ) is NP-hard, then for MinCostCSP(Γ) finding any satisfying assignment regardless of cost is NP-hard as well.

2.2 Polymorphisms

Definition 8.

Let f:DkD be a k-ary operation on the domain D, and R some m-ary relation over the same domain. We say that f preserves R (or f is a polymorphism of R) if for every (a1,1,,a1,m),,(ak,1,,ak,m)R we have (b1,,bm)R, where bi=f(a1,i,,ak,i) for every i[m]. Given a constraint language Γ we say that f preserves Γ (or f is a polymorphism of Γ) if f preserves every RΓ. We use 𝖯𝗈𝗅(R) to denote the set of all polymorphisms of R, and (abusing notation slightly) 𝖯𝗈𝗅(Γ)=RΓ𝖯𝗈𝗅(R) to denote the set of all polymorphisms of Γ.

It follows directly from the definition that for any n1, i[n], the projection operation projin:DnD,(x1,,xn)xi is a polymorphism. Also, any composition of polymorphisms is still a polymorphism. A set of operations satisfying these two properties is known as a clone.

Definition 9.

A clone over D is a set of operations n1{f:DnD} for which the following holds:

  • contains the projection operation projin for every n1, i[n].

  • For every m-ary g and n-ary f1,,fm, the n-ary function g defined by

    g:(x1,,xn)g(f1(x1,,xn),,fm(x1,,xn))

    is also in .

Clones have been studied extensively in the universal algebra community, and many complexity-theoretic classification results for CSPs depend on classification results for their corresponding family of polymorphism clones (see e.g. [6] for more on polymorphism clones).

We say that a function f:DkD is conservative, if f(x1,,xk){x1,,xk} for every x1,,xkD. It is immediate from the definition that if Γ is constraint language that contains all unary relations, then every f𝖯𝗈𝗅(Γ) is conservative.

Definition 10.

Let f:DkD be a k-ary operation for some k3. We say that f is a near-unanimity (NU) operation if for every a,bD,

f(a,a,,a,b)=f(a,a,,b,a)==f(b,a,,a,a)=a.

In other words, if all but one inputs are equal to some aD, then f outputs a. If k=3, then f is also called a majority operation.

Example 11.

Let the dual discriminator operation d:D3D be defined by

d(x1,x2,x3)={aif |{ixi=a}|2,x1otherwise.

Then d is a majority operation. This operation will be featured heavily in our algorithmic results.

Constraint languages that are preserved by some NU operation enjoy the following nice property.

Definition 12.

Let R be a n-ary relation. Let Sn,k={(i1,,ik)1i1<<ikn} be the set of k-tuples whose entries are in [n] and in increasing order. For any s=(i1,,ik)Sn,k and x=(x1,,xn), let Πsx=(xi1,,xik) and ΠsR={ΠsxxR}. We say that R is k-decomposable if for every x=(x1,,xn), we have

xRsSn,k,ΠsxΠsR.

We say that Γ is k-decomposable if every RΓ is k-decomposable.

Theorem 13 (Theorem 3.5 in [28]).

Let Γ be a constraint language and k2. If Γ is preserved by some (k+1)-ary NU operation, then Γ is k-decomposable.

3 Algorithms for the dual discriminator

In this section, we give two |D|-approximation algorithms for MinCostCSP(Γ) where Γ is a constraint language over D preserved by the dual discriminator operation, thus proving Theorem 1. Both algorithms will assume that the input instance is a satisfiable binary, (2,3)-minimal instance. We introduce and justify this assumption in Section 3.1, and then present a greedy algorithm in Section 3.2 and a LP-based algorithm in Section 3.3.

3.1 Reducing to satisfiable binary (2,3)-minimal instances

A CSP instance I=(V,𝒞) is binary, if every constraint in 𝒞 has arity at most 2. Theorem 13 allows us to assume that the input instance is binary, since it is preserved by the dual discriminator operation which is a 3-ary NU operation. For any binary instance I, we may also write it as a triple I=(V,{Ru}uV,{Ru,v}uvV), where we have one unary relation Rx for every uV and one binary relation Ru,v for every pair (u,v)V. Note that to write I in this form we may take the intersection of relations with the same scope or add complete relation on some variable(s) if none exists.

Definition 14 (See e.g., [6]).

A binary CSP instance I=(V,{Ru}uV,{Ru,v}uvV) over domain D is (2,3)-minimal if

  1. (a)

    For every distinct u,vV, Rv,u={(b,a)(a,b)Ru,v}.

  2. (b)

    For every distinct u,vV, Ru={aDbD,(a,b)Ru,v}.

  3. (c)

    For every pairwise distinct u,v,wV and (a,b)Ru,v, there exists cRw such that (a,c)Ru,w and (b,c)Rv,w.

Informally, the definition says that I is (2,3)-minimal if any partial satisfying assignment (that is, a partial assignment that does not immediately falsify any constraint) to two variables can be extended to a partial satisfying assignment to three variables. Given a binary CSP instance I=(V,{Ru}uV,{Ru,v}uvV), we may transform it into a (2,3)-minimal instance using the following procedure:

Clearly, when the above procedure stops, the instance must be (2,3)-minimal (otherwise the loop would have continued). The new instance may have constraints that are not in our original constraint language. However, since the new constraints are all obtained by pp-definitions from the original constraint language, they are preserved by the same polymorphisms (see Definition 27 and Theorem 28). In particular, the new instance is still preserved by the dual discriminator operation.

We say that a (2,3)-minimal instance is trivial if at least one of the unary relations is empty, and it is nontrivial otherwise. A trivial (2,3)-minimal instance has no satisfying assignment since no assignment can satisfy an empty relation. On the other hand, if the instance is nontrivial and its constraint language has bounded width, then such an instance is always guaranteed to have a satisfying assignment which we can find in polynomial time.

Theorem 15 ([4, 5]).

Let I be a nontrivial (2,3)-minimal instance whose constraint language has bounded width. Then I has a satisfying assignment which can be found in polynomial time.

We will not define the term “bounded width” formally here (see Theorem 31 for a characterization). For us it is sufficient to note that any constraint language that is preserved by an NU polymorphism has bounded width [22], so any unsatisfiable instance will necessarily give rise to a trivial (2,3)-minimal instance. From now on we will assume that the (2,3)-minimal instance is nontrivial, and therefore satisfiable. Also, observe any satisfying assignment for the original instance will remain satisfying for the new (2,3)-minimal instance. This means any assignment we obtain on the new instance will give an approximation ratio at least as good on the original instance, and therefore we may shift our attention to this new instance instead.

We crucially use the following characterization for binary relations preserved by the dual discriminator operation. The same characterization was used by [16] in the context of robust satisfiability (these relations have also been studied under the name of 0/1/all relations [14]). We sketch a short proof here for completeness.

Lemma 16 (See e.g. [6, 16]).

Let RD2 be a binary relation. Then R is preserved by the dual discriminator operation d:D3D if and only if R is of one of the following forms:

  • R=P×Q for some P,QD.

  • R=({u}×Q)(P×{v}) for some uPD and vQD.

  • R={(u,π(u))uP} for some P,QD and bijective π:PQ.

Proof.

It is easy to verify that if R is one of these three types then it is preserved by d. Let us prove the other direction. Let P={xDyD s.t. (x,y)R} and Q={yDxD s.t. (x,y)R}. For any uP, if there exist two distinct v1,v2Q such that (u,v1),(u,v2)R, then for any vQ, we have also (u,v)R. In other words, we have {u}×QR. This is because we can find some (u1,v)R by the definition of Q, and apply f to the three pairs (u1,v),(u,v1),(u,v2)R to obtain (u,v) (observe that f(u1,u,u)=u and f(v,v1,v2)=v).

Now if we have two distinct u1,u2P such that {u1}×QR and {u2}×QR, then for every vQ there are two distinct u1,u2 such that (u1,v),(u2,v)R. By applying the above argument with P and Q reversed we get that for every vQ, P×{v}R, so it must be the case that R=P×Q.

Now assume that there exists exactly one uP such that {u}×QR and RP×Q. Then there exists (u1,v)R such that u1u, so we have P×{v}R. Note that in this case we must have R=({u}×Q)(P×{v}), for the existence of any other pair would imply that R=P×Q.

Finally, if RP×Q and there is no uP such that {u}×QR, then there can also be no vQ such that P×{v}R. So for every uP there is a unique v such that (u,v)R, and we can find some bijective π:PQ such that R={(u,π(u))uP}.

3.2 A greedy algorithm

We now present a greedy algorithm which is a generalization of a 2-approximation algorithm for MinOnes 2-SAT due to Gusfield and Pitt [24]. In this algorithm, we will greedily pick labels for the variables one by one, and each label we pick may potentially restrict the set of feasible labels for some other variables. For general CSPs, this restriction can be rather arbitrary and difficult to control. However, for binary (2,3)-minimal instances preserved by the dual discriminator operation, the restriction is very simple: either the set of feasible labels is unchanged, or it is restricted to a singleton set (as is guaranteed by Lemma 16). This means for variables where proper restriction happens we can simply fix it to the label in the singleton set. On the other hand, the variables whose set of feasible labels didn’t change induce a sub-instance of the original instance and the algorithm may recurse on this sub-instance. This property guarantees that we will always produce a satisfying assignment, as is formalized in the following lemma.

Definition 17.

Let I=(V,{Ru}uV,{Ru,v}u,vV) be a (2,3)-minimal instance. For any u,vV, aRu and bRv, we say that v is fixed to b by assigning a to u if u=v and a=b, or uv and Ru,v({a}×Rv)={(a,b)}. In other words, b is the only feasible label left for v if we assign the label a to u.

Lemma 18.

Let I=(V,{Ru}uV,{Ru,v}u,vV) be a nontrivial (2,3)-minimal instance preserved by the dual discriminator operation. Let u0V, aRu0, S be the set of variables fixed by assigning a to u0. For every vS, let AS(v) be the unique label that v is fixed to by assigning a to u0. Let A:V\SD be any satisfying assignment for the induced (2,3)-minimal instance I=(V\S,{Ru}uV\S,{Ru,v}u,vV\S), then

A:VD,A(v)={AS(v)if vS,A(v)otherwise

is a satisfying assignment for I.

Proof.

Clearly all unary constraints in I are satisfied. Any binary constraint Ru,v where u,vV\S is satisfied since A is a satisfying assignment. The remaining two cases, where uS,vV\S or u,vS, follow from the following claim:

Claim 19.

For every distinct vS and wV, if (a,c)Ru0,w, then we have (AS(v),c)Rv,w.

Proof.

This claim clearly holds for v=u0. Suppose vu0. Since (a,c)Ru0,w, by (2,3)-minimality we can find bRv such that (a,b)Ru0,v,(b,c)Rv,w. This b must coincide with AS(v), since v is fixed by assigning a to u0. Thus, we have (AS(v),c)Rv,w. For uS,vV\S, since (a,A(v))Ru0,v, we may apply the claim and obtain that (AS(u),A(v))Ru,v, so this constraint is satisfied. For u,vS, again since since (a,AS(v))Ru0,v, we may apply the claim and obtain that (AS(u),AS(v))Ru,v, so this constraint is also satisfied. It follows that all binary constraints in I are satisfied by A, so it is indeed a satisfying assignment for I.

To guarantee a constant-factor approximation, we need to pick labels in a clever way. One naive idea is to compute the total cost incurred by variables fixed by each label and pick the label that minimizes this cost. However, this does not work because the optimum assignment may incur more cost but save by fixing more variables. One way to fix this naive idea is to consider a derived cost t, instead of the original cost 𝚌𝚘𝚜𝚝. In particular, when we face a decision for some variable u (i.e., |Ru|2), we pick the label that minimizes the total derived cost of fixed variables. We then pay |Ru||D| times this cost towards reducing the derived cost of all variable-label pairs that are or could’ve been fixed by assignment to u. The key idea here is that one of the labels in Ru will be taken by the optimal assignment, so the amount we pay are always within a factor of |D| from the total cost of the optimal assignment.

We now formally present the algorithm and its analysis. The pseudocode for the algorithm can be found in Algorithm 1.

Algorithm 1 Greedy algorithm for MinCostCSP.

Input: I=(V,{Ru}uV,{Ru,v}u,vV) a (2,3)-minimal instance, 𝚌𝚘𝚜𝚝:V×D{+}
  
Output: A:VD a satisfying assignment for I.
  
Initialization: t:V×D0{+},t(u,a)𝚌𝚘𝚜𝚝(u,a)

We start by making the following observations.

Observation 20.

Let tend be the values of t when A is returned. For every uV, tend(u,A(u))=0.

Proof.

For variables fixed outside the while loop, this follows from Line 5. For variables that obtained its assignment inside the while loop, this follows from Lines 18 and 25 (since Δt(u,Aa0(u))=t(u,Aa0(u)) for every uFa0).

Observation 21.

The value of t never increases during the algorithm. In particular, for every uV and aD, we have 𝚌𝚘𝚜𝚝(u,a)tend(u,a)0.

Proof.

This is because Δt is always nonnegative.

Observation 22.

For every uV and aD, we have t(u,a)0 at any point of the algorithm.

Proof.

This is because when an update happens at Line 22, the updated value for Δt(u,Aa(u)) is equal to ta(u)t(u,Aa(u)).

The guarantee on the approximation ratio is based on the following claim.

Claim 23.

Let A:VD be any satisfying assignment for I. For each iteration of the while loop beginning at Line 6, let tbefore,tafter be the values of t at the beginning and the end of the iteration respectively. Then we have

uV,aD(tbefore(u,a)tafter(u,a))|D|uV(tbefore(u,A(u))tafter(u,A(u)))
Proof.

Let the variables be defined as they are in the algorithm. For every uV and aD define the auxiliary variables

Δ(u,a)=a:aRv,uFa,a=Aa(u)ta(u).

Note that the quantity (tbefore(u,a)tafter(u,a)) is nonzero only if there exists some aRv such that uFa and a=Aa(u), and this quantity is given by the value stored in Δt(u,a) at the beginning for Line 23. By construction (see Line 22), for any such a we have

ta(u)Δt(u,a)Δ(u,a),

since Δt(u,a) is equal to the largest summand in the sum defining Δ(u,a). It follows that

uV,aD(tbefore(u,a)tafter(u,a)) uV,aDΔ(u,a)
= uV,aD(a:aRv,uFa,a=Aa(u)ta(u))
= aRvuFata(u)=|Rv|ca0|D|ca0.

Here, the last equality follows from uFata(u)=ca0 (see Line 18). On the other hand, for a=A(v) we must have Aa(u)=A(u) for every uFa, and therefore we have

uV(tbefore(u,A(u))tafter(u,A(u))) uFa(tbefore(u,Aa(u))tafter(u,Aa(u)))
=uFaΔt(u,Aa(u))uFata(u)=ca0.

This establishes the claim.

Theorem 24.

Algorithm 1 returns a satisfying assignment A:VD whose cost is at most |D| times the optimal cost.

Proof.

The algorithm returns a satisfying assignment by Lemma 18.

Let A:VD be an arbitrary assignment. We have the following chain of inequalities:

vV𝚌𝚘𝚜𝚝(v,A(v)) vV(𝚌𝚘𝚜𝚝(v,A(v))tend(v,A(v))) (Observation 20)
vVaD(𝚌𝚘𝚜𝚝(v,a)tend(v,a)) (Observation 21)
|D|vV(𝚌𝚘𝚜𝚝(v,A(v))tend(v,A(v))) (Claim 23)
|D|vV𝚌𝚘𝚜𝚝(v,A(v)) (Observation 22)

Since A is arbitrary, the theorem follows by taking A to be an optimal assignment.

3.3 An LP-based algorithm

We now present another approximation algorithm that is based on the basic linear programming (BLP) relaxation for the MinCostCSP problem [42, 35]. Given an MinCostCSP(Γ) instance I=(V,𝒞,𝚌𝚘𝚜𝚝), its BLP relaxation can be formulated as follows.

Figure 1: BLP relaxation for MinCostCSP(Γ).

Recall that each constraint C is represented by a pair (R,S) where R is some k-ary relation and S is a k-tuple of variables to which R is applied. Here in the LP formulation we abuse the notation slightly and think of each satisfying tuple xR also as a partial assignment SDk, and x(v) is the label that x assigns to v. Informally, the linear program maintains a distribution of satisfying partial assignments for each constraint, and it requires that if a variable appears in multiple constraints, then the marginal distribution on this variable should be consistent across these constraints. The objective function to minimize is then the expected cost under these marginal distributions. It is easy to see that any integral assignment to I corresponds to distributions supported on a single element, so this is indeed a relaxation of the original problem. We remark that in polynomial time we can actually enforce the marginal consistency requirement on any constant-sized set of variables, and thus obtain tighter relaxations on the so-called Sherali-Adams hierarchy ([42]). However, this will not be needed for our purpose.

For any MinCostCSP instance I, let LP(I) be the optimal value of the BLP relaxation for I. Our LP-based algorithm is as follows. Note that as before, we assume that I is given as a non-trivial (2,3)-minimal instance.

Algorithm 2 LP-based algorithm for MinCostCSP.

Input: I=(V,{Ru}uV,{Ru,v}u,vV) a (2,3)-minimal instance
  
Output: A:VD a satisfying assignment for I.

In words, we remove labels that receive tiny LP probabilities (less than 1/|D|) and solve the new instance. Observe that Rv is nonempty for every vV, since at least one of the |D| labels will get a probability that is at least 1/|D|.

Theorem 25.

Let I be a nontrivial (2,3)-minimal instance. Then on input I, Algorithm 2 returns in polynomial time a satisfying assignment to I whose cost is at most |D|LP(I).

Proof.

We first show that I is indeed a (2,3)-minimal instance. We verify the conditions in Definition 14 one by one. For readers’ convenience, we restate the conditions in italic.

  1. (a)

    For every distinct u,vV, Rv,u={(b,a)(a,b)Ru,v}. This is equivalent to the statement (a,b)Ru,v(b,a)Rv,u. By symmetry, it is sufficient to show that (a,b)Ru,v(b,a)Rv,u. Let (a,b)Ru,vRu,v, then aRu and bRv. Since I is (2,3)-minimal, we have that (b,a)Rv,u, so (b,a)Rv,u(Rv×Ru)=Rv,u.

  2. (b)

    For every distinct u,vV, Ru={abRv,(a,b)Ru,v}. By construction we have {abRv,(a,b)Ru,v}Ru. To show the other inclusion, let us pick aRu. By Lemma 16, we have the following two cases:

    • {a}×RvRu,v. In this case, we have {a}×RvRu,v(Ru×Rv)=Ru,v. Since Rv is nonempty, we have that a{abRv,(a,b)Ru,v}.

    • {a}×RvRu,v. In this case, there is a unique b0Rv such that (a,b0)Ru,v. By the LP constraint, we have pv,b0pu,a1/|D|, and therefore b0Rv and a{abRv,(a,b)Ru,v}.

  3. (c)

    For every pairwise distinct u,v,wV and (a,b)Ru,v, there exists cRw such that (a,c)Ru,w and (b,c)Rv,w. Similar to part (b), we again have two cases:

    • {a}×RwRu,w or {b}×RwRv,w. Since I is (2,3)-minimal, there exists cRw such that (a,c)Ru,w and (b,c)Rv,w. By Lemma 16, c is either the unique element in Rw such that (a,c)Ru,w, or the unique element in Rw such that (b,c)Rv,w. In either case, we can conclude that pw,cmin(pu,a,pv,b)1/|D|, so cRw as required.

    • {a}×RwRu,w and {b}×RwRv,w. In this case, since Rw is non-empty, there exists some c0RwRw so we have (a,c0)Ru,w and (b,c0)Rv,w.

This establishes that I is (2,3)-minimal. Note that every binary relation in I is also of the three types described in Lemma 16, so it is also preserved by the dual discriminator operation. By Theorem 15, we can find a satisfying assignment A:VD for I in polynomial time. Note that for this assignment, we have

vV𝚌𝚘𝚜𝚝(v,A(v)) vV|D|pv,A(v)𝚌𝚘𝚜𝚝(v,A(v))
|D|vVaDpv,a𝚌𝚘𝚜𝚝(v,a)=|D|LP(I).

4 NU polymorphism as necessary condition for constant-factor approximability

In this section, we establish the following necessary condition for the constant-factor approximability of MinCostCSP(Γ) problem. We note that Dalmau et al. [18] obtained a similar necessary condtion for the problem of MinCSP. We will closely follow their proof.

Theorem 26 (Theorem 2 restated).

Let Γ be a constraint language. If MinCostCSP(Γ) has a constant-factor approximation, then 𝖯𝗈𝗅(Γ) contains a conservative NU polymorphism, unless P = NP.

4.1 Gadget reductions and primitive positive interpretations

Let us first establish some sufficient condition for reductions between MinCostCSPs. Given two constraint languages Γ1 and Γ2, we write MinCostCSP(Γ1)CFMinCostCSP(Γ2) if the constant-factor approximability for MinCostCSP(Γ2) implies the constant-factor approximability for MinCostCSP(Γ1). By definition, CF is transitive.

Definition 27 (pp-definition).

Let Γ be a constraint language over D and R a k-ary relation over the same domain. We say that Γ pp-defines R, if there exist some m>0 and a conjunction over variables x1,,xk,y1,,ym consisting of relations in Γ and the equality relation (eqD:={(u,v)D2u=v}) over D, such that

R(x1,,xk)y1ym.

If Γ is another constraint language over the same domain D, then we say that Γ pp-defines Γ if Γ pp-defines every relation in Γ.

The following theorem establishes a connection (often referred to as Galois correspondence in the literature) between polymorphisms and pp-definitions. We say that a relation R with arity k is irreducible, if for every distinct i,j[k], there exists (x1,,xk)R such that xixj.

Theorem 28 ([7, 23]).

Let Γ be a constraint language and R some k-ary relation over the same domain. Then we have

  • 𝖯𝗈𝗅(Γ)𝖯𝗈𝗅(R) if and only Γ pp-defines R.

  • If R is irreducible, then 𝖯𝗈𝗅(Γ)𝖯𝗈𝗅(R) if and only Γ pp-defines R without using the equality relation.

Definition 29 (pp-interpretation).

Let Γ1 and Γ2 be constraint languages over domains D and E respectively. We say that Γ1 pp-interprets Γ2 if there exist n, FDn, and a surjective function f:FE such that Γ1 pp-defines the following relations:

  • F as an n-ary relation over D.

  • For every RΓ2 with some arity k, the relation

    f1(R)={(x(1),x(2),,x(k))Dknx(i)F for i=1,,k,(f(x(1)),,f(x(k)))R}

    Here each x(i) is a n-tuple over D and we are thinking of (x(1),x(2),,x(k)) as a flattened kn-tuple over D.

  • The relation

    f1(eqE)={(x(1),x(2))D2nx(i)F for i=1,2,f(x(1))=f(x(2))}

    Here again x(1) and x(2) are n-tuples over D and (x(1),x(2)) is a flattened 2n-tuple.

We say that Γ1 pp-interpretes Γ2 in the first power if n=1 in the above definition. It is known in the case of standard decision CSP that the existence of a pp-interpretation implies a gadget reduction, where we simply replace constraints in Γ with constraints in Γ using the pp-definitions. However, in the case of MinCostCSP, for the purpose of the reduction we would also need to translate the costs between the two instances. This is straightforward for n=1, but there seems to be no natural way of doing this if we are using a pp-interpretation with n2.

Lemma 30.

Let Γ1 be a constraint language over D and Γ2 a constraint language over E. If Γ1 pp-interpretes Γ2 in the first power and one of the following holds:

  • The equality relation eqD over D is in Γ1.

  • Every RΓ2 is irreducible.

Then MinCostCSP(Γ2)CFMinCostCSP(Γ1)

Proof.

Let FD and f:FE be as in the definition of pp-interpretation. Let I2=(V,𝒞,𝚌𝚘𝚜𝚝) be a MinCostCSP(Γ2) instance. We define a MinCostCSP(Γ1) instance I1=(V,𝒞,𝚌𝚘𝚜𝚝) as follows:

  • I1 has the same set of variables V as I2.

  • For each constraint C=(R,S)𝒞, we would like to add a constraint C=(f1(R),S) to 𝒞. To do this, without loss of generality assuming S={x1,,xk}, we take the pp-definition of f1(R), which is of the form

    y1ym.

    Here y1,,ym are auxiliary variables with zero costs and is a conjunction of constraints, each being either a relation from Γ1 or eqD applied to some of the variables in {x1,,xk,y1,,ym}. Now if eqDΓ1, then we can think of as a CSP(Γ1) instance with variables being {x1,,xk,y1,,ym}, and this instance can be satisfied if and only (x1,,xk)f1(R), so we add (the constraints and the auxiliary variables of ) this instance to I2. If eqDΓ1, but every RΓ2 is irreducible, then by Theorem 28, we may assume that does not contain eqD and therefore we can still write it as an instance of CSP(Γ1) and add it to I2.

  • For each xV and aD, let 𝚌𝚘𝚜𝚝(x,b){𝚌𝚘𝚜𝚝(x,a)if aE s.t. bf1(a),+otherwise.

Clearly, for every satisfying assignment A:VE to I2, we may define A:VF such that A(x)f1(A(x)), and A will be a satisfying assignment to I1 with the same cost. In particular, this means that Opt(I1)Opt(I2).

Now if we have a constant-factor approximation algorithm for MinCostCSP(Γ1), we can use it to obtain a solution A1:VD such that 𝚌𝚘𝚜𝚝I1(A1)tOpt(I1) for some constant t independent of I1. In fact, we may assume A1:VF, since every label not in F has infinite cost. Take A2:VE,xf(A1(x)), then by construction A2 is a satisfying assignment for I2, and

𝚌𝚘𝚜𝚝I2(A2)=𝚌𝚘𝚜𝚝I1(A1)tOpt(I1)tOpt(I2).

Thus we obtain a constant-factor approximation algorithm for MinCostCSP(Γ2) as well.

We refer interested readers to the survey by Barto el al. [6] which contains a more detailed exposition on pp-interpretation (and its generalization pp-construction) in the context of decision CSPs.

4.2 Proof of Theorem 26

The proof contains two cases: either Γ has unbounded width, or it has bounded width. We use the following characterization for bounded-widthness of constraint languages.

Theorem 31 ([5, 17]).

Let Γ be a constraint language that contains all singleton relations. Γ is not bounded width if and only if there exists some nontrivial finite abelian group G such that Γ pp-interprets Γ(G) in the first power using pp-definitions without equality.

Here G being nontrivial means it has at least 2 elements, and Γ(G) is the set of relations {Rabc={(x,y,z)G3ax+by+cz=0}a,b,c}333Here ax denotes the sum of a copies of x. Note that this is a finite set of relations, since G is a finite group. over G.

In the unbounded-width case we shall use a reduction from the Nearest Codeword problem, and in the bounded-width case we reduce from the hypergraph vertex cover problem.

Definition 32.

In the Nearest Codeword problem over a finite field 𝔽p, we are given a matrix A𝔽pm×n and a vector x𝔽pn, and we are asked to find a vector y𝔽pn such that Ay=0 and the number of nonzero entries in xy is minimized.

Definition 33.

In the k-uniform hypergraph vertex cover problem, we are given a k-uniform hypergraph (namely, each hyperedge is contains k vertices), and our goal is to choose a minimum number of vertices so that from each hyperedge we have chosen at least one vertex.

The following theorems give the best known NP-hardness results for approximating these two problems.

Theorem 34 ([20, 13]).

The Nearest Codeword problem over any finite field 𝔽p is NP-hard to approximate within a factor of 2log1ϵ(n), for any constant ϵ>0.

Theorem 35 ([19]).

The k-uniform hypergraph vertex cover problem is NP-hard to approximate within a factor of k1ϵ, for any k3 and ϵ>0.

We remark that if we further assume the Unique Games Conjecture, then we can improve the hardness factor for k-uniform hypergraph vertex cover from k1ϵ to kϵ [2], but this difference does not matter for us here.

The following is a simple corollary from the hardness of the Nearest Codeword problem.

Corollary 36.

Let Γp be the set of all relations of the form Rabc={(x,y,z)𝔽p3ax+by+cz=0}444Here ax denotes the 𝔽p multiplication between field elements a,x𝔽p. where a,b,c𝔽p\{0} over some finite field 𝔽p. Then MinCostCSP(Γp) is NP-hard to approximate within a factor of 2log1ϵ(n).

Proof.

We show how to cast the Nearest Codeword problem over 𝔽p as a MinCostCSP(Γp) instance. We first add the variables y1,,yn denoting entries of y. For each yi, we impose a cost of 1 if it is not equal to xi, and 0 if it is equal to xi. This models the minimum Hamming weight requirement. To model the constraint Ay=0, we first note that Γp can also be used to simulate Rabc={(x,y,z)𝔽p3ax+by+cz=0} if one of a,b,c is zero. This can be achieved as follows: to obtain the constraint ax+by=0, we create a dummy variable z and add the constraint Rabc(x,y,z) for an arbitrary nonzero c, and then we set the non-zero label costs for z to be all infinite and its zero label cost to be just 0, effectively forcing this variable to be zero. This can be extended easily if two of a,b,c are zeros.

Now we need to transform each linear equation of the form i=1mAkiyi=0 so that left hand side contains at most 3 variables. This can be done via the standard trick: by introducing a new auxiliary variable z (which has zero cost for any label), we may rewrite i=1mAkiyi=0 equivalently as Ak1y1+Ak2y2+z=0 and z+i=3mAkiyi=0, and thereby reducing the number of variables on the left hand side by 1. We repeat this procedure until all equations have at most 3 variables on the left hand side. It is clear that the resulting instance is a MinCostCSP(Γp) instance which is equivalent to the original Nearest Codeword instance. By Theorem 34, we can therefore conclude that MinCostCSP(Γp) is also NP-hard to approximate within a factor of 2log1ϵ(n).

Lemma 37.

Let Γ be a constraint language such that MinCostCSP(Γ) has a constant-factor approximation, then Γ is bounded-width unless P = NP.

Proof.

We prove the contrapositive. Let Γ be a constraint language with unbounded width. Without loss of generality, assume that Γ contains all unary relations. Then by Theorem 31, there exists some nontrivial finite abelian group G such that Γ pp-interprets Γ(G) in the first power. In particular, Γ pp-interprets the set of all irreducible relations Γ(G)irrΓ(G) in the first power. By Lemma 30, we have MinCostCSP(Γ(G)irr)CFMinCostCSP(Γ).

We now claim that MinCostCSP(Γ(G)irr) contains MinCostCSP(Γp) as a special case for some prime p. Note that G must contain some cyclic subgroup of prime order: one may find this subgroup by taking a subgroup of prime order of some cyclic subgroup generated by a single nonzero element in G. We may identify this subgroup of order p with the finite field 𝔽p. Note that any relation Rabc={(x,y,z)𝔽p3ax+by+cz=0} over 𝔽p is irreducible if a,b,c are all nonzero, so these relations are contained in Γ(G)irr. So we have that MinCostCSP(Γ(G)irr) contains MinCostCSP(Γp) as a subproblem (where we set the cost of any label outside 𝔽p to be infinite). It follows that MinCostCSP(Γ(G)irr), and therefore MinCostCSP(Γ), do not have a constant-factor approximation unless P = NP.

For the bounded-width case, we use the following reduction from the hypergraph vertex cover problem.

Lemma 38 ([18]).

Let Γ be a bounded-width constraint language which is not preserved by any NU operation. If Γ contains all unary singleton relations, then for every k1, there is a k-ary relation R pp-definable from Γ and a,bD such that

R{a,b}k={a,b}k\{(a,a,,a)}.
Lemma 39.

Let Γ be a bounded-width constraint language which is not preserved by any NU operation. Then MinCostCSP(Γ) does not have a constant-factor approximation unless P = NP.

Proof.

Assume that Γ has all unary relations without loss of generality. Note that the k-uniform hypergraph vertex cover problem is the MinCostCSP problem with a single relation Rk={0,1}k\{(0,0,,0)}, which is pp-definable from Γ by Lemma 38 (by thinking of a as 0 and b as 1, and the assumption that {a,b} as a unary relation is in Γ). Observe that Rk is irreducible, so the reduction in Lemma 30 implies that MinCostCSP(Γ) is as hard to approximate as the k-uniform hypergraph vertex cover problem, in particular, by Theorem 35, it is NP-hard to approximate MinCostCSP(Γ) within a factor of k1ϵ for any ϵ>0. Since k can be arbitrarily large, this implies that MinCostCSP(Γ) does not have a constant-factor approximation, unless P = NP.

Theorem 26 can now be obtained by combining these two cases.

Proof of Theorem 26.

Let Γ be a constraint language such that MinCostCSP(Γ) has a constant-factor approximation and assume that P NP, then by Lemma 37, Γ must be bounded-width. It then follows from Lemma 39 that Γ must be preserved by some NU operation.

 Remark 40.

In the Boolean case (|D|=2), it follows from Khanna et al.’s classification [30] as well as Post’s classification of Boolean clones [38] that the necessary condition of having a conservative NU polymorphism is sufficient as well. Recall that we have the following three classes of constant-factor approximable Boolean MinCostCSPs:

  • Γ can be expressed as a 2CNF-formula. In this case, Γ is preserved by the (unique) majority operation. (This case also includes constraint languages that are width-2 affine for which MinCostCSP can be solved to optimality.)

  • Γ is expressible as a CNF formula where each clause is of the form x1xk, ¬x1x2, or ¬x1 where kK for some K depending on Γ. In this case Γ is preserved by the (K+1)-ary NU operation th2K+1, where

    thpn(x1,,xn)={1if |{i[n]xi=1}|p,0otherwise.
  • Γ is expressible as a CNF formula where each clause is of the form ¬x1¬xk, x1¬x2, or x1 where kK for some K depending on Γ. In this case Γ is preserved by the (K+1)-ary NU operation thKK+1.

It can be easily verified using Post’s Lattice [38] that any constraint language whose polymorphism clone contains an NU operation can be reduced to one of the three cases above. However, as soon as |D|3, the condition of being preserved by some NU operation is no longer sufficient (for example, see Theorem 45 in the following subsection).

4.3 A hard predicate with a majority polymorphism

We now present a binary relation PH which has a conservative majority polymorphism, but nonetheless MinCostCSP(PH) is hard to approximate within any constant factor, unless UGC fails. This implies that the existence of an NU polymorphism is in general not sufficient for constant-factor approximability assuming UGC.

Definition 41.

Let PH be the binary relation on domain A={0,1,2} such that PH(x,y) holds if and only if xy or x=y=2.

The constraint satisfaction problem defined by PH is equivalent to the graph homomorphism problem to the undirected graph shown in Figure 2. Intuitively, PH is the XOR predicate with a “wildcard” element 2 such that the predicate is also satisfied if some input is 2.

Figure 2: The undirected graph H corresponding to PH.

We now verify that PH is preserved by a conservative majority operation.

Claim 42.

Let f:A3A be defined as follows

f(a1,a2,a3)={aif |{i[3]ai=a}|2,2otherwise.

Then f𝖯𝗈𝗅(PH).

Proof.

Let (a1,b1),(a2,b2),(a3,b3)PH. We verify that (f(a1,a2,a3),f(b1,b2,b3))PH. This is always true if at least one of f(a1,a2,a3) and f(b1,b2,b3) is 2. If neither is 2, then there is a majority in (a1,a2,a3) as well as in (b1,b2,b3). It follows by the pigeonhold principle that there must be some i[3] such that ai is equal to the majority element in (a1,a2,a3) and bi is equal to the majority element in (b1,b2,b3), so we have (f(a1,a2,a3),f(b1,b2,b3))=(ai,bi)PH. Note that f is conservative since when there isn’t a majority we must have {a1,a2,a3}={0,1,2}2.

To prove that MinCostCSP(PH) is hard to approximate, we use a reduction from the Min UnCut problem.

Definition 43.

In the Min UnCut problem, the input is a weighted undirected graph G=(V,E,{we}eE) where we0 for every eE, and we are asked to remove a subset EE of the edges such that the remaining graph G=(V,E\E) is bipartite. The goal is to minimize the total weight of removed edges eEwe.

We use Opt(G) to denote the value of an optimum solution to Min UnCut(G). Without loss of generality, we may assume that the total edge weight in a Min UnCut instance is normalized to be 1, i.e., eEwe=1.

Theorem 44 ([32]).

Assuming UGC, there exists some constant c>0 such that for all sufficiently small ϵ>0 it is NP-hard to distinguish instances of Min UnCut with value at most ϵ and instances with value at least cϵ. In particular, it is NP-hard to approximate Min UnCut within any constant factor, assuming UGC.

Theorem 45.

Assuming UGC, it is NP-hard to approximate MinCostCSP(PH) within any constant factor.

Proof.

Given any Min UnCut instance G=(V,E,{we}eE), we construct an instance I of MinCostCSP(PH) such that Opt(G)=Opt(I). This reduction combined with Theorem 44 will establish our theorem. The reduction is as follows. The variable set of I will be V{ze,zeeE} where we take vertices in G plus two distince auxiliary variables ze,ze for every edge eE. For every e={x,y}E, we add three constraints PH(x,ze),PH(ze,ze),PH(ze,y) to I (note that the order of x and y does not matter). For the cost function c, we define c(x,0)=c(x,1)=0, c(x,2)=1 for every xV, and c(ze,0)=c(ze,1)=c(ze,0)=c(ze,1)=0, c(ze,2)=c(ze,2)=we for the auxiliary variables. This completes the construction. See Figure 3 for an illustration.

Figure 3: The reduction from Min UnCut to MinCostCSP(PH). The nonzero costs are c(x,2)=c(y,2)=1, c(ze,2)=c(ze,2)=we.

We claim that Opt(G)=Opt(I). We first show that Opt(G)Opt(I). Take any optimal assignment for G. We take the same assignment for the vertex variables in I which generates no cost. For any edge e={x,y} that is satisfied by the assignment, we can set ze=1x, ze=1y and satisfy all three constraints PH(x,ze),PH(ze,ze),PH(ze,y) with no cost. For any edge e={x,y} that is not satisfied, we can set ze=2 and ze=1y, satisfying all three constraints PH(x,ze),PH(ze,ze),PH(ze,y) with cost we. So we obtain an assignment for I that has value Opt(G).

The other direction can be shown similarly. First observe that for each edge e we may assume at most one of the two auxiliary variables ze,ze is set to 2. Also, since for any vertex variable x we have c(x,2)=1=eEwe, we may assume that no vertex variable x is set to 2. Now if we take an optimal assignment A for I with these two assumptions, A restricted to the vertex variables is a valid assignment for G whose the total weight of violated edges is at most the cost of A, which implies that Opt(G)Opt(I).

5 Application: Dichotomy for MinCostCSP with permutation constraints

As an application of our results, we give a complete classification for MinCostCSP(Γ) where Γ contains all permutation relations.

Definition 46.

A binary relation RD2 over D is called a permutation relation if R={(a,σ(a))aD} for some bijective σ:DD.

Theorem 47 (Theorem 3 restated).

Let Γ be a set of relations over D such that it contains all permutation relations. Then MinCostCSP(Γ) is |D|-approximable if Γ is preserved by a conservative majority operation. Otherwise, if Γ is not preserved by any conservative majority operation, then it is also not preserved by any conservative NU operation and MinCostCSP(Γ) is not constant-factor approximable, assuming P NP.

A constraint language that contains all permutation relations can be seen as a natural generalization of Boolean constraint languages that allow negation of variables. Our classification relies on the classification of homogeneous algebras. To state the result, we first need some definitions.

Definition 48.

An algebra (D,) consists of a set D (called the universe) and a set of operations (called the basic operations) which are functions from finite powers of D to D. The symbols and arities of the basic operations are called the signature of (D,). A term operation is an operation obtained by composition of operations in .

The set of all term operations of a given algebra (D,) form a clone (recall Definition 9). We denote this clone by . When ={s1,,sk} consists of finitely many operations, we may also write s1,,sk in place of .

Definition 49.

Let (D,) and (D,) be two algebras with the same signature. A function f:DD is called a homomorphism from (D,) to (D,), if f commutes with all basic operations. That is, for every k-ary function symbol t in the signature, we have tD(f(a1),,f(ak))=f(tD(a1,,ak)), where tD and tD are the functions t represents in (D,) and (D,) respectively. When (D,)=(D,), we also say that f is an automorphism.

Definition 50.

An algebra (D,) is called a homogeneous algebra if every bijection DD is an automorphism.

The following claim follows directly from the definition.

Claim 51.

Let Γ be a constraint language which contains all permutation relations. Then (D,𝖯𝗈𝗅(Γ)) is a homogeneous algebra.

The study of homogenous algebras was initiated by Marczewski [37], and a complete classification was first obtained by Marchenkov [36]. Dalmau used Marchenkov’s result to give a complete classification for decision CSP where the constraint language contains all permutation relations [15]. The following theorem is taken from [43] (see also [15]).

Theorem 52 (Theorem 5.9 in [43]).

Let D be a finite domain such that |D|5. Let (D,) be a homogeneous algebra, then either the dual discriminator operation d is a term operation, or its clone of term operations is equal to one of the followings:

  • E10=s, E11=s,rn,

  • Ei0=li for 2in1, En0=𝒥.

  • Ei1=li,rn for 2in3, En21=rn.

Here 𝒥 is the clone of projection operations. s is the switching operation, defined by

s(x1,x2,x3)={x3if x1=x2,x2if x1=x3,x1otherwise. 

For 2kn1, lk is the k-ary near projection operation defined by

lk(x1,x2,,xk)={x1if |{x1,,xk}|<k,xkotherwise. 

And finally, rn is the (n1)-ary operation defined by

rn(x1,x2,,xn1)={x1if |{x1,,xn1}|<n1,xnotherwise, where xnD\{x1,,xn1}.

The |D|5 assumption is not essential. When |D|5, the above algebras are all distinct. When 2|D|4, some of these algebras become non-distinct, but the only exceptional case not covered by the classification above is the Klein 4-group (the unique 4-element group with exponent 2) with the operation x+y+z. However, this is not a conservative operation so we may safely ignore it for our purpose.

We are now ready to prove Theorem 47.

Proof of Theorem 47.

First observe that if 𝖯𝗈𝗅(Γ) contains some majority function f, then there must be some i[3] such that f(x1,x2,x3)=xi when x1,x2,x3 are pairwise distinct: if not, then there exist distinct i,j[3] and two triples (x1,x2,x3),(y1,y2,y3) with pairwise distinct elements within each triple such that f(x1,x2,x3)=xi,f(y1,y2,y3)=yj. Then, let π:DD be a permutation such that yi=π(xi) for every i[3], f does not preserve the permutation relation {(a,π(a))aD}, which is a contradiction. By potentially permuting the input coordinates in f, we get that the dual discriminator operation d is also contained in 𝖯𝗈𝗅(Γ), and therefore MinCostCSP(Γ) is |D|-approximable by Theorem 1.

Now suppose 𝖯𝗈𝗅(Γ) does not contain a conservative majority function, then in particular it does not contain the dual discriminator operation. Note that since Γ can be assumed to contain all unary operations (see Observation 7), every polymorphism of Γ is conservative. It is easy to see that rn is not conservative. If 𝖯𝗈𝗅(Γ)=En0=𝒥, then CSP(Γ) is NP-complete. Furthermore, Dalmau [15] showed that if 𝖯𝗈𝗅(Γ)=Ei0 for some 2in1, then CSP(Γ) is also NP-complete. So by Theorem 52, the only remaining possibility is 𝖯𝗈𝗅(Γ)=s. However, as is observed by Dalmau [15], s does not contain any NU operation, so by Theorem 26, there is no constant factor approximation for MinCostCSP(Γ), assuming P NP.

References

  • [1] Kirby A Baker and Alden F Pixley. Polynomial interpolation and the chinese remainder theorem for algebraic systems. Mathematische Zeitschrift, 143:165–174, 1975.
  • [2] Nikhil Bansal and Subhash Khot. Inapproximability of hypergraph vertex cover and applications to scheduling problems. In International Colloquium on Automata, Languages, and Programming, pages 250–261. Springer, 2010. doi:10.1007/978-3-642-14165-2_22.
  • [3] Libor Barto. The dichotomy for conservative constraint satisfaction problems revisited. In 2011 IEEE 26th Annual Symposium on Logic in Computer Science, pages 301–310. IEEE, 2011. doi:10.1109/LICS.2011.25.
  • [4] Libor Barto. The collapse of the bounded width hierarchy. Journal of Logic and Computation, 26(3):923–943, 2014.
  • [5] Libor Barto and Marcin Kozik. Constraint satisfaction problems solvable by local consistency methods. Journal of the ACM (JACM), 61(1):1–19, 2014. doi:10.1145/2556646.
  • [6] Libor Barto, Andrei Krokhin, and Ross Willard. Polymorphisms, and How to Use Them. In Andrei Krokhin and Stanislav Zivny, editors, The Constraint Satisfaction Problem: Complexity and Approximability, volume 7 of Dagstuhl Follow-Ups, pages 1–44. Schloss Dagstuhl – Leibniz-Zentrum für Informatik, Dagstuhl, Germany, 2017. doi:10.4230/DFU.Vol7.15301.1.
  • [7] VG Bondarchuk, LA Kaluzhnin, VN Kotov, and BA Romov. Galois theory for post algebras. i-ii. Kibernetika, 3:1–10, 1969.
  • [8] Joshua Brakensiek, Neng Huang, Aaron Potechin, and Uri Zwick. On the mysteries of max nae-sat. In Proceedings of the 2021 ACM-SIAM Symposium on Discrete Algorithms (SODA), pages 484–503. SIAM, 2021. doi:10.1137/1.9781611976465.30.
  • [9] Joshua Brakensiek, Neng Huang, Aaron Potechin, and Uri Zwick. Separating max 2-and, max di-cut and max cut. In 2023 IEEE 64th Annual Symposium on Foundations of Computer Science (FOCS), pages 234–252. IEEE, 2023. doi:10.1109/FOCS57990.2023.00023.
  • [10] Andrei A. Bulatov. Tractable conservative constraint satisfaction problems. In 18th Annual IEEE Symposium of Logic in Computer Science, 2003. Proceedings., pages 321–330. IEEE, 2003.
  • [11] Andrei A. Bulatov. Conservative constraint satisfaction re-revisited. Journal of Computer and System Sciences, 82(2):347–356, 2016. doi:10.1016/J.JCSS.2015.07.004.
  • [12] Andrei A Bulatov. A dichotomy theorem for nonuniform csps. In 2017 IEEE 58th Annual Symposium on Foundations of Computer Science (FOCS), pages 319–330. IEEE, 2017. doi:10.1109/FOCS.2017.37.
  • [13] Qi Cheng and Daqing Wan. A deterministic reduction for the gap minimum distance problem. IEEE Transactions on Information Theory, 58(11):6935–6941, 2012. doi:10.1109/TIT.2012.2209198.
  • [14] Martin C. Cooper, David A. Cohen, and Peter G. Jeavons. Characterising tractable constraints. Artificial Intelligence, 65(2):347–361, 1994. doi:10.1016/0004-3702(94)90021-3.
  • [15] Victor Dalmau. A new tractable class of constraint satisfaction problems. Annals of Mathematics and Artificial Intelligence, 44:61–85, 2005. doi:10.1007/S10472-005-1810-9.
  • [16] Víctor Dalmau, Marcin Kozik, Andrei Krokhin, Konstantin Makarychev, Yury Makarychev, and Jakub Oprsal. Robust algorithms with polynomial loss for near-unanimity csps. SIAM Journal on Computing, 48(6):1763–1795, 2019. doi:10.1137/18M1163932.
  • [17] Víctor Dalmau and Andrei Krokhin. Robust satisfiability for csps: Hardness and algorithmic results. ACM Transactions on Computation Theory (TOCT), 5(4):1–25, 2013. doi:10.1145/2540090.
  • [18] Víctor Dalmau, Andrei Krokhin, and Rajsekar Manokaran. Towards a characterization of constant-factor approximable finite-valued csps. Journal of Computer and System Sciences, 97:14–27, 2018. doi:10.1016/J.JCSS.2018.03.003.
  • [19] Irit Dinur, Venkatesan Guruswami, Subhash Khot, and Oded Regev. A new multilayered pcp and the hardness of hypergraph vertex cover. SIAM Journal on Computing, 34(5):1129–1146, 2005. doi:10.1137/S0097539704443057.
  • [20] I Dumer, D. Micciancio, and M. Sudan. Hardness of approximating the minimum distance of a linear code. IEEE Transactions on Information Theory, 49(1):22–37, 2003. doi:10.1109/TIT.2002.806118.
  • [21] Alina Ene, Jan Vondrak, and Yi Wu. Local distribution and the symmetry gap: Approximability of multiway partitioning problems. arXiv preprint, 2015. arXiv:1503.03905.
  • [22] Tomás Feder and Moshe Y Vardi. The computational structure of monotone monadic snp and constraint satisfaction: A study through datalog and group theory. SIAM Journal on Computing, 28(1):57–104, 1998. doi:10.1137/S0097539794266766.
  • [23] David Geiger. Closed systems of functions and predicates. Pacific journal of mathematics, 27(1):95–100, 1968.
  • [24] Dan Gusfield and Leonard Pitt. A bounded approximation for the minimum cost 2-sat problem. Algorithmica, 8(1):103–117, 1992. doi:10.1007/BF01758838.
  • [25] Gregory Gutin, Pavol Hell, Arash Rafiey, and Anders Yeo. A dichotomy for minimum cost graph homomorphisms. European Journal of Combinatorics, 29(4):900–911, 2008. doi:10.1016/J.EJC.2007.11.012.
  • [26] Pavol Hell, Monaldo Mastrolilli, Mayssam Mohammadi Nevisi, and Arash Rafiey. Approximation of minimum cost homomorphisms. In Algorithms–ESA 2012: 20th Annual European Symposium, Ljubljana, Slovenia, September 10-12, 2012. Proceedings 20, pages 587–598. Springer, 2012. doi:10.1007/978-3-642-33090-2_51.
  • [27] Pavol Hell and Arash Rafiey. The dichotomy of minimum cost homomorphism problems for digraphs. SIAM Journal on Discrete Mathematics, 26(4):1597–1608, 2012. doi:10.1137/100783856.
  • [28] Peter Jeavons, David Cohen, and Martin C Cooper. Constraints, consistency and closure. Artificial Intelligence, 101(1-2):251–265, 1998. doi:10.1016/S0004-3702(98)00022-8.
  • [29] Peter Jonsson and Gustav Nordh. Introduction to the maximum solution problem. Complexity of Constraints: An Overview of Current Research Themes, pages 255–282, 2008. doi:10.1007/978-3-540-92800-3_10.
  • [30] Sanjeev Khanna, Madhu Sudan, Luca Trevisan, and David P Williamson. The approximability of constraint satisfaction problems. SIAM Journal on Computing, 30(6):1863–1920, 2001. doi:10.1137/S0097539799349948.
  • [31] Subhash Khot. On the power of unique 2-prover 1-round games. In Proceedings of the thiry-fourth annual ACM symposium on Theory of computing, pages 767–775, 2002. doi:10.1145/509907.510017.
  • [32] Subhash Khot, Guy Kindler, Elchanan Mossel, and Ryan O’Donnell. Optimal inapproximability results for MAX-CUT and other 2-variable CSPs? SIAM Journal on Computing, 37(1):319–357, 2007. doi:10.1137/S0097539705447372.
  • [33] Subhash Khot and Oded Regev. Vertex cover might be hard to approximate to within 2- ε. Journal of Computer and System Sciences, 74(3):335–349, 2008.
  • [34] Andrei Krokhin and Stanislav Zivny. The Complexity of Valued CSPs. In Andrei Krokhin and Stanislav Zivny, editors, The Constraint Satisfaction Problem: Complexity and Approximability, volume 7 of Dagstuhl Follow-Ups, pages 233–266. Schloss Dagstuhl – Leibniz-Zentrum für Informatik, Dagstuhl, Germany, 2017. doi:10.4230/DFU.Vol7.15301.233.
  • [35] Amit Kumar, Rajsekar Manokaran, Madhur Tulsiani, and Nisheeth K Vishnoi. On lp-based approximability for strict csps. In Proceedings of the Twenty-Second Annual ACM-SIAM Symposium on Discrete Algorithms, pages 1560–1573. SIAM, 2011. doi:10.1137/1.9781611973082.121.
  • [36] S.S. Marchenkov. Homogeneous algebras. Problemy Kibernetiki, 39:85–106, 1982.
  • [37] E. Marczewski. Homogeneous algebras and homogeneous operations. Fund. Math, 56(8):103, 1964.
  • [38] E.L. Post. The two-valued iterative systems of mathematical logic. Annals of Mathematics Studies, 1941.
  • [39] Akbar Rafiey, Arash Rafiey, and Thiago Santos. Toward a dichotomy for approximation of H-coloring. In 46th International Colloquium on Automata, Languages, and Programming (ICALP 2019), pages 91:1–91:16. Schloss Dagstuhl – Leibniz-Zentrum für Informatik, 2019. doi:10.4230/LIPIcs.ICALP.2019.91.
  • [40] Prasad Raghavendra. Optimal algorithms and inapproximability results for every csp? In Proceedings of the fortieth annual ACM symposium on Theory of computing, pages 245–254, 2008. doi:10.1145/1374376.1374414.
  • [41] Thomas J Schaefer. The complexity of satisfiability problems. In Proceedings of the tenth annual ACM symposium on Theory of computing, pages 216–226, 1978. doi:10.1145/800133.804350.
  • [42] Hanif D Sherali and Warren P Adams. A hierarchy of relaxations between the continuous and convex hull representations for zero-one programming problems. SIAM Journal on Discrete Mathematics, 3(3):411–430, 1990. doi:10.1137/0403036.
  • [43] Ágnes Szendrei. Clones in universal algebra. Presses de l’Université de Montréal, 1986.
  • [44] Rustem Takhanov. A dichotomy theorem for the general minimum cost homomorphism problem. In 27th International Symposium on Theoretical Aspects of Computer Science (2010), pages 657–668. Schloss Dagstuhl – Leibniz-Zentrum für Informatik, 2010. doi:10.4230/LIPICS.STACS.2010.2493.
  • [45] Johan Thapper and Stanislav Živnỳ. The complexity of finite-valued csps. Journal of the ACM (JACM), 63(4):1–33, 2016. doi:10.1145/2974019.
  • [46] Dmitriy Zhuk. A proof of the csp dichotomy conjecture. Journal of the ACM (JACM), 67(5):1–78, 2020. doi:10.1145/3402029.