Hybrid VCSPs with crisp and conservative valued templates
Abstract
A constraint satisfaction problem (CSP) is a problem of computing a homomorphism between two relational structures, e.g. between two directed graphs. Analyzing its complexity has been a very fruitful research direction, especially for fixed template CSPs (or, nonuniform CSPs), denoted , in which the right side structure is fixed and the left side structure is unconstrained.
Recently, the hybrid setting, written , where both sides are restricted simultaneously, attracted some attention. It assumes that is taken from a class of relational structures (called the structural restriction) that additionally is closed under inverse homomorphisms. The last property allows to exploit an algebraic machinery that has been developed for fixed template CSPs. The key concept that connects hybrid CSPs with fixedtemplate CSPs is the so called “lifted language”. Namely, this is a constraint language that can be constructed from an input . The tractability of the language for any input is a necessary condition for the tractability of the hybrid problem.
In the first part we investigate templates for which the latter condition is not only necessary, but also is sufficient. We call such templates widely tractable. For this purpose, we construct from a new finite relational structure and define a “maximal” structural restriction as a class of structures homomorphic to . For the so called strongly BJK templates that probably captures all templates, we prove that wide tractability is equivalent to the tractability of . Our proof is based on the key observation that is homomorphic to if and only if the core of is preserved by a Siggers polymorphism. Analogous result is shown for conservative valued CSPs.
Authors’ Instructions
1 Introduction
The constraint satisfaction problems (CSPs) and the valued constraint satisfaction problems (VCSPs) provide a powerful framework for the analysis of a large set of computational problems arising in propositional logic, combinatorial optimization, graph theory, artificial intelligence, scheduling, biology (protein folding), computer vision etc. CSP can be formalized either as a problem of (a) finding an assignment of values to a given set of variables, subject to constraints on the values that can be assigned simultaneously to specified subsets of variables, or as a problem of (b) finding a homomorphism between two finite relational structures and (e.g., two oriented graphs). These two formulations are polynomially equivalent under the condition that input constraints in the first case or input relations in the second case are given by lists of their elements. A soft version of CSP, the Valued CSP, generalizes the CSP by changing crisp constraints to cost functions applied to tuples of variables. In the VCSP we are asked to find a minimum (or maximum) of a sum of cost functions applied to corresponding variables.
The CSPs have been a very active research field since 70s. One of the topics that revealed the rich logical and algebraic structure of the CSPs was the problem’s computational complexity when constraint relations are restricted to a given set of relations or, alternatively, when the second relational structure is some fixed . Thus, this problem is parameterized by , denoted as and called a fixed template CSP with a template (another name is a nonuniform CSP). E.g., if the domain set is boolean and is a structure with four ternary relations , , , , models 3SAT which is historically one of the first NPcomplete problems [8]. At the same time, if we restrict to binary relations, then we obtain tractable 2SAT. Schaeffer proved [27] that for any template over the boolean set, is either in P or NPcomplete. For the case when is a graph (without loops) Hell and Nešetřil [14] proved an analogous statement, by showing that only for bipartite graphs the problem is tractable. Feder and Vardi [11] found that all fixed template CSPs can be expressed as problems in a fragment of SNP, called the Monotone Monadic SNP (MM SNP), and showed that for any problem in MM SNP there is a polynomialtime Turing reduction to a fixed template CSP. Thus, nonuniform CSPs’ complexity classification would yield a classification for MM SNP problems. This result placed fixedtemplate CSPs into a broad logical context which naturally lead to a conjecture that such CSPs are either tractable or NPhard, the so called dichotomy conjecture.
In [16] Jeavons showed that the complexity of is determined by the polymorphisms of . Research in this direction lead to a conjectured description of tractable templates through properties of their polymorphisms. The key formulation was given by Bulatov, Jeavons, and Krokhin [5], with subsequent reformulations of this conjecture by Maroti and McKenzie [25]. Later, it was shown by Siggers [28] that if the BulatovJeavonsKrokhin formulation is true, then for a relational structure to be tractable it is necessary and sufficient that its core is preserved by a single 6ary polymorphism that satisfies a certain term identity. Further, an arity of a polymorphism in the latter formulation was decreased to 4 [18]. We will use the last fact as a key ingredient for our results. Very recently, several independent proofs of the BulatovJeavonsKrokhin formulation were announced [26, 6, 32]. Since the papers have not yet been thoroughly verified and widely accepted by the CSP community, in this paper we refer to the formulation as a hypothesis.
Related work. A metaproblem of the VCSP topic is to establish the complexity of VCSP given that an input is restricted to an arbitrary subset of all input pairs . A natural approach to this problem is to construct a new structure for any input , , and shift the analysis to . In case of binary CSPs (i.e. when all relations of an input are binary) it is natural to define as a microstructure graph [17] of a template . Thereby, a set of inputs, in which certain local substructures in are forbidden, forms a parametrized problem. Cooper and Živný [9] investigated this formulation and found examples of specific forbidden substructures that result in tractable hybrid CSPs. Microstructure graphs also naturally appear in the context of fixed template CSPs. Specifically, if a template with binary relations is such that the arc and path consistency preprocessing of an instance of always results in a perfect microstructure graph, then additionally to satisfying all constraints (by finding a maximum clique) one can also optimize arbitrary sums of unary terms over a set of solutions (by assigning weights to vertices of the microstructure graph). The latter optimization problem is called the minimum cost homomorphism problem and all such templates were completely classified in [30].
Recently, a hybrid framework for VCSP has attracted some attention [21], that is when left structures are restricted to some set and a right structure is fixed (the corresponding CSP is denoted as ) and is closed under inverse homomorphisms. The specific feature of this case is that for any input one can construct a new language , called a lifted language (see Sec. 3), so that tractability of this language is a necessary condition for the tractability of .
Our results. The first question that we address is a characterization of those templates for which the tractability of for any is not only necessary, but also is sufficient for the tractability of . We call that possesses this property for any (closed under inverse homomorphisms) widely tractable. It turns out that the statement that the core of is preserved by a Siggers polymorphism (i.e. satisfies the BulatovJeavonsKrokhin test for nonNPhardness) is equivalent to the statement that is homomorphic to a certain structure (constructed from ). Based on this observation we prove that, for a class of templates (that is likely to capture all templates), wide tractability is equivalent to the tractability of , where is equal to a set of structures homomorphic to . Moreover, we prove that can be in polynomialtime Turing reduced to and, therefore, is at least as hard as . We develop an analogous theory for conservative valued CSPs.
Organization. In Sec. 2 we give all preliminary definitions and state theorems that we need. In Sec. 3 we describe an important construction called a “lifted language”, taken from [21]. In subsection 4.1 we introduce the notion of widely tractable constraint language and in subsection 4.2 we prove necessary and sufficient conditions for wide tractability. A formulation and a proof of those conditions are based on the construction of a template that we build from an initial fixed template . We discuss properties of in subsection 4.3. An analogous theory for conservative constraint languages, based on the corresponding construction of , is built in subsection 4.4.
2 Preliminaries
Throughout the paper it is assumed that . A problem is called tractable if it can be solved in polynomial time. Let denote the set of rational numbers with (positive) infinity and . Also, and are finite sets, is a set of mappings from to . We denote the tuples in lowercase boldface such as . Also for mappings and tuples , where for , we will write simply as . Relational structures are denoted in uppercase boldface as . Finally let , , and stand for the arity of a relation , the size of a tuple , and the arity of a function , respectively.
2.1 Fixed template VCSPs
Let us formulate the general CSP as a homomorphism problem.
Definition 1
Let and be relational structures with a common signature (that is for every ). A mapping is called a homomorphism from to if for every and for any we have that . In that case, we write or sometimes just .
Definition 2
The general CSP is the following problem. Given a pair of relational structures with a common signature and , the question is whether there is a homomorphism . The second structure is called a template.
Definition 3
Let be a finite set and be a finite relational structure over . Then the fixed template CSP for template , denoted , is defined as follows: given a relational structure of the same signature as , the question is whether there is a homorphism .
A more general framework operates with cost functions instead of relations .
Definition 4
Let us denote the set of all functions by and let . We call the functions in cost functions over . For every cost function , let .
Definition 5
An instance of the valued constraint satisfaction problem (VCSP) is a triple where is a relational structure, is a tuple where is finite and , are positive rationals, and the goal is to find an assignment that minimizes a function from to given by
(1) 
A tuple is called a valued template.
Definition 6
We will denote by a class of all VCSP instances in which the valued template is .
For such we will denote by (without boldface) the set of cost functions . A set is called a constraint language. The complexity of does not depend on the order of cost functions, therefore, we will use and interchangeably.
This framework captures many specific wellknown problems, including Sat, Graph Colouring, Minimum Cost Homomorphism Problem and others (see [15]).
A function that takes values in is called crisp. We will often view it as a relation in , and vice versa (this should be clear from the context). If a language is crisp (i.e. it contains only crisp functions) then is a search problem corresponding to .
Remark 1
Note that we formulated CSP as a decision problem, whereas VCSP as a search optimizational problem. This convention is followed throughout the text and further it becomes more important because decision and search problems are not computationally equivalent for hybrid CSPs (see after definition 18).
Definition 7
A constraint language (or, a template ) is said to be tractable, if is tractable for each finite . Also, (or, ) is NPhard if there is a finite such that is NPhard.
An important problem in the CSP research is to characterize all tractable languages.
2.2 Polymorphisms and fractional polymorphisms
Let denote a set of all operations and let .
Any language over a domain can be associated with a set of operations on , known as the polymorphisms of , defined as follows.
Definition 8
An operation is a polymorphism of a relation (or, preserves ) if, for any , we have that where is applied componentwise. For any crisp constraint language over a set , we denote by a set of all operations on which are polymorphisms of every .
Polymorphisms play a key role in the algebraic approach to the CSP, but, for VCSPs, more general constructs are necessary, which we now define.
Definition 9
An ary fractional operation on is a probability distribution on . The support of is defined as .
Definition 10
An ary fractional operation on is said to be a fractional polymorphism of a cost function if, for any , we have
(2) 
For a constraint language , will denote a set of all fractional operations that are fractional polymorphisms of each function in .
We will also use symbols , meaning , respectively.
2.3 Algebraic dichotomy conjecture
An algebraic characterization for tractable templates was first conjectured by Bulatov, Krokhin and Jeavons [5], and a number of equivalent formulations were later given in [25, 1, 28, 18]. We will use the formulation from [18] that followed a discovery by M. Siggers [28]; it is crucial for our purposes that in the next definition an operation has a fixed arity (namely, 4) and, therefore, there is only a finite number of them on a finite domain .
Definition 11
An operation is called a Siggers operation on if whenever and for each we have:
Definition 12
Let be a unary and be a 4ary operations on and . A pair is called a Siggers pair on if is a Siggers operation on . A crisp constraint language is said to admit a Siggers pair if and are polymorphisms of .
Theorem 2.1 ([18])
A crisp constraint language that does not admit a Siggers pair is NPHard.
Definition 13
A crisp language is called a BJK language if it satisfies one of the following:

is tractable

does not admit a Siggers pair.
Algebraic dichotomy conjecture: Every crisp language is a BJK language.
This theorem first has been verified for domains of size 2 [27], 3 [3], or for languages containing all unary relations on [4]. It has also been shown that it is equivalent to its restriction for directed graphs (that is when contains a single binary relation ) [7]. Just recently, a number of authors [26, 6, 32] independently claimed the proof of the conjecture.
3 Hybrid VCSP setting
Definition 14
Let us call a family of relational structures with a common signature a structural restriction.
Definition 15 (Hybrid CSP)
Let be a finite domain, a template over , and a structural restriction of the same signature as . We define as the following problem: given a relational structure as input, decide whether there is a homomorphism .
Definition 16 (Hybrid VCSP)
Let be a finite domain, a valued template over , and a structural restriction of the same signature as . We define as a class of instances of the following form.
An instance is a function from to given by
(3) 
where is a relational structure, are positive rationals. The goal is to find an assignment that minimizes .
The latter definition is too broad. Nonetheless, for certain classes of structural restrictions the tractability/intractability can be explained by algebraic means, and of special interest is the case when is upclosed.
Definition 17
A family of relational structures is called closed under inverse homomorphisms (or upclosed for short) if whenever and , then also .
Examples of hybrid CSPs with upclosed structural restrictions include such studied problems as a digraph coloring for an acyclic input digraph [29] or for an input digraph with odd girth at least [21], renamable Horn Boolean CSPs [12] and etc. The key tool in their analysis is a construction of the so called lifted language that appeared first in [21]. In this construction, given arbitrary one constructs a language over a finite domain, such that for tractability of , the tractability of is necessary.
Let us give a detailed description of . Given and we define and .
For tuples and denote .
Now for a cost function and we will define a cost function on of the same arity as via
(4) 
Finally, we construct the sought language on domain as follows:
where relation is treated as a unary function .
After ordering of its relations becomes a template . The following is true [21]:
Theorem 3.1
Suppose that is upclosed, and is a (valued) template.
Then there is a polynomialtime reduction from to .
Consequently,
(a)
if is tractable then so is ;
(b) if is NPhard then so is .
Let us give a proof of the latter theorem that slightly differs from the original one. For this purpose we will need a special case of hybrid VCSP, called the VCSP with input prototype. Given a finite relational structure , denote .
Definition 18
For a given valued template and a relational structure a problem where is called the VCSP with input prototype and is denoted as . If is crisp, then the decision version of is denoted as .
It is easy to see that is upclosed. Note that an input of is a relational structure that is homomorphic to but this homomorphism itself is not a part of the input. If we also assume that together with a structure we are given a homomorphism , then the latter problem is denoted as .
Remark 2
Note that the complexities of and can be sharply different. For example, consider and where . While , a problem of 4coloring of a 3colorable graph, is known to be NPhard [19], is a trivial one. This example also demonstrates the distinction between decision and search in the hybrid framework: the decision problem is also trivial, whereas its search version is NPhard.
Lemma 1
is polynomially equivalent to
Proof
Reduction of to . Let and be given. An instance of is a function:
where is an input structure whose corresponds to of , and are positive rationals.
Let us make the following consistency checking of that instance: we will check that for any variable that is shared in two distinct terms and of the latter function whether the projections of and on that variable have nonempty intersection. If they do not, we conclude that VCSP does not have solutions.
After that consistency checking, for our instance we can assume that there is an assignment , that assigns each variable its domain . Denote , where . It is easy to see that for any its componentwise image is exactly the tuple . Since , we conclude .
For , let us define by . Vica versa, to every assignment we will correspond an assignment where is a “forgetting” function, i.e. . For any assignment that satisfies , by construction, we have . The expression to be minimized is
It is easy to see that if is an optimal solution of the latter sum, then is an optimal solution of the following
The latter is an instance of with input structure and a homomorphism , and the solution of it gives a solution of the initial one. Thus, we proved that can be polynomially reduced to .
Reduction of to . Again, , . Suppose we are given an instance of with an input structure and a homomorphism , i.e. our goal is to minimize:
over . We can construct an instance of :
where is such that (these constraints can be modeled via crisp functions ). It is straightforward to check that if is a solution of then is a solution of .
A proof of the equivalence of and for crisp can be done analogously.
Proof (Theorem 3.1 (a))
Since is upclosed, then for any , . I.e. a problem is a restriction of to certain inputs. Therefore, is polynomially reducible to . Using the previous lemma, we conclude that for the tractability of it is necessary that and are tractable. Part (b) can be proved analogously.
4 Wide tractability of a crisp language
Throughout this section we will assume that is crisp.
4.1 Widely tractable languages
For upclosed structural restrictions , the construction of a lifted language gives us the necessary conditions for the tractability of (Theorem 3.1 (a)). Let us now define widely tractable templates as those for which the necessary conditions for the tractability of are, in fact, sufficient:
Definition 19
A template is called widely tractable if for any upclosed , is tractable if and only if is tractable for any .
The concept of wide tractability is important in the hybrid CSPs setting due to the following theorem:
Theorem 4.1
If a template is widely tractable, then there is an upclosed such that for any upclosed , is tractable if and only if .
Proof
Let us define
(5) 
It is easy to see that is upclosed itself. By definition, contains only such for which is tractable, and this together with wide tractability of , implies that is tractable.
Suppose that for some upclosed , is tractable. From the wide tractability of we obtain that it is equivalent to stating that is tractable for any . But the last is equivalent to .
4.2 Wide tractability in case of strongly BJK languages
In this section we will give necessary and sufficient conditions of wide tractability in a very important case of crisp languages, namely, strongly BJK languages.
Definition 20
A crisp language is called strongly BJK language if for any the lifted is BJK.
Remark 3
Before introducing the main theorem of this section, let us describe one construction. Let be some ary relation over a domain . It induces a new relation over a set of Siggers pairs on a set , denoted , by the following rule: a tuple of Siggers pairs if and only if for any we have that and for any tuples , , , from we have that , … , .
Given a relational structure , we define .
Theorem 4.2
Let be a strongly BJK language. Then is widely tractable if and only if is tractable.
A proof of theorem 4.2 is mainly based on the following lemma:
Lemma 2
For an arbitrary , admits a Siggers pair if and only if there is a homomorphism .
Proof
Let . For that admits a Siggers pair , let us construct a homomorphism . Recall that is defined over a domain (see the definition of in subsection 3). Let us now define restrictions of and on , i.e. and (this is possible because preserve ). In turn, and correspond to operations and defined on that satisfy and . Let us denote as a mapping . It is easy to see that maps to , the domain of .
Let us show that is a homomorphism from into . Consider and (see the definition of in subsection 3). Since preserve , we conclude that preserve . I.e., for any we have that and for any , , , we have that , … , . If we identify element of with element of (for all ), in the last condition we have to change to and to and to . I.e., the condition will become equivalent to the statement that , i.e. , is in . We proved that for any its image is in , i.e. is a homomorphism.
Thus, we proved that if admits a Siggers pair, then there is a homomorphism . Suppose now that for some , is a homomorphism. Let us define a Siggers pair on in such a way that coincides with if we identify and . It is straightforward to check that admits .
Proof (Proof of Theorem 4.2)
Suppose that is widely tractable. Let us define
(6) 
Since is strongly BJK, we obtain that
Therefore, from lemma 2 we conclude that .
By definition, contains only such for which is tractable, and this together with the wide tractability of , implies that is tractable.
Suppose now that is tractable. Let us prove that is widely tractable, i.e. let us verify that from the tractability of for any we can deduce that is tractable. Suppose that is tractable for any . Thus, due to the strong BJK property, admits a Siggers pair. From lemma 2 we obtain that , i.e. , and is tractable.
Remark 4
If then is a trivial problem. In the latter case theorem 4.2 gives us that is a widely tractable template. Such templates are quite common. E.g. our computational experiment showed (see section 6) that if and is such that is NPhard, then . Example of a widely tractable and NPhard for which will be given in the next section (example 1).
4.3 Relationship between and
The binary relation is transitive, reflexive, but not antisymmetric. It also induces the equivalence relation on a set of all finite structures:
Theorem 4.3
For any , .
Proof
For any , let be a Siggers pair where the first element is understood as a unary constant operation and the second element as a 4ary constant operation. Thus, , and we can define a function by equality . Let us prove that is a homomorphism from to .
For any its image is . We need to check that the last tuple is in . Indeed, if we recall the definition of a certain tuple being in , it can be reduced to the statement that of the kind: (and ). But in our case the latter conditions trivially hold.
Thus, we can view as a relaxation of . Moreover, the theorem 4.3 has the following interesting consequence.
Theorem 4.4
If is strongly BJK, then there is a polynomialtime Turing reduction from to
Proof
From lemma 2 we obtain that admits a Siggers pair. Since is strongly BJK, then is tractable. Lemma 1 gives that hybrid is also tractable.
Let us describe our reduction. Given an input for we first check whether . If then due to theorem 4.3 we can answer that . Alternatively, if , we will be given a homomorphism (using that for fixed template CSPs search and decision problems are polynomially equivalent) and can reduce our problem to . Therefore, we can identify in polynomial time whether or not.
If is tractable, then is preserved by a constant , where is a Siggers pair that is admitted by . I.e., is a set of all finite structures with the same vocabulary as . We can take any tractable that is not constantpreserving (e.g. ) as an example of a template for which , i.e. .
The following example demonstrates an NPhard for which .
Example 1
Define , where . A fixedtemplate CSP with this is called the boolean betweennes, and it is NPhard because does not fall into any of Schaefer‘s classes [27].
The boolean betweennes can be popularly reformulated in the following way. Suppose that we have a number of towns and a system of roads (each consisting of 3 consecutive towns) . Our goal is to divide those towns between 2 states (assign 0 or 1 to variables) in such a way that unary constraints are satisfied, i.e. certain towns should be given to prespecified states, and every road should not cross administrative barriers twice.
Let , where . A symbol can be interpreted as a “dual attachment” status that can be given to towns, for which we can freely change status to both 0 and 1 without violating ternary constraints.
It is easy to see that (image of cannot be both 0 and 1). If we prove that is tractable (and, therefore, admits a Siggers pair), this will lead to a conclusion that by lemma 2, and consequently, .
According to lemma 1, is equivalent to a problem of deciding whether there is a homomorphism for a relational structure and a homomorphism given as inputs. If we claim the nonexistence of . Otherwise, is defined in the following way: , if ; , if and ; , if and ; and , if otherwise. It can be checked that this algorithm solves