Backdoors into Heterogeneous Classes of SAT and CSP

In this paper we extend the classical notion of strong and weak backdoor sets for SAT and CSP by allowing that different instantiations of the backdoor variables result in instances that belong to different base classes; the union of the base classes forms a heterogeneous base class. Backdoor sets to heterogeneous base classes can be much smaller than backdoor sets to homogeneous ones, hence they are much more desirable but possibly harder to find. We draw a detailed complexity landscape for the problem of detecting strong and weak backdoor sets into heterogeneous base classes for SAT and CSP.


Introduction
We consider the propositional satisfiability problem (SAT) and the constraint satisfaction problem (CSP). Backdoors are small sets of variables of a SAT or CSP instance that represent "clever reasoning shortcuts" through the search space. Backdoor sets were originally introduced by Williams, Gomes, and Selman ( [40,41]) as a tool for the analysis of decision heuristics in propositional satisfiability. Since then, backdoor sets have been widely used in the areas of propositional satisfiability [9,10,19,27,34,35,40], and also for material discovery [31], abductive reasoning [33], argumentation [12], quantified Boolean formulas [36], and planning [29,30]. A backdoor set is defined with respect to some fixed base class for which the computational problem under consideration is polynomial-time tractable (alternatively, it can be defined with respect to a polynomial-time subsolver). The size of the backdoor set can be seen as a distance measure that indicates how far the instance is from the target class. One distinguishes between strong and weak backdoor sets; the latter applies only to satisfiable instances. Once a strong backdoor set of size k is identified, one can decide the satisfiability of the instance by deciding the satisfiability of at most d k "easy" instances that belong to the tractable base class, where d denotes the size of the domain for the variables; for SAT we have d = 2. Each of the easy instances is obtained by one of the d k possible instantiations of the k variables in the backdoor set. Hence, the satisfiability check is fixed-parameter tractable [11] for the combined parameter backdoor size and domain size (k + d). A similar approach works for weak backdoor sets, where the computation of a certificate for satisfiability (i.e., a satisfying assignment) is fixed-parameter tractable for the combined parameter (k + d).
The fixed-parameter tractability of using the backdoor set for deciding satisfiability or the computation of a certificate for satisfiability triggers the question of whether finding a backdoor set of size at most k is also fixed-parameter tractable. In particular, for every base class C one can ask whether the detection of a strong or weak backdoor set into C of size at most k is fixed-parameter tractable for parameter k (possibly in combination with restrictions on the input or other parameters). A systematic study of the parameterized complexity of backdoor set detection was initiated by Nishimura et al. [32] for SAT, who showed that the detection of strong backdoor sets into the classes HORN and 2CNF is fixed-parameter tractable, but the detection of weak backdoor sets into any of these two classes is W [2]-hard (and hence unlikely to be fixed-parameter tractable). Since then, the parameterized complexity of backdoor set detection has become an active research topic as outlined in a survey [18].
In this work, we provide two significant extensions to the exciting research on fixed-parameter tractable backdoor set detection. First, we introduce heterogeneous base classes, which can be composed of several homogeneous base classes. We show that heterogeneous base classes are particularly well-suited for strong backdoor sets, since they allow that different instantiations of the backdoor variables result in instances that belong to different base classes, which leads to arbitrary reductions in the size of a strong backdoor set even compared to the smallest strong backdoor set for each individual homogeneous base class. This is in contrast to weak backdoor sets, where the size of a weak backdoor set into a heterogeneous base class is equal to the size of the smallest backdoor set into any of the individual base classes. Here we show that also the complexity of weak backdoor set detection into heterogeneous base classes is tight to its complexity on the individual base classes. Second, we extend the scope of backdoor set detection from SAT to CSP, considering target classes that are defined by tractable constraint languages in terms of certain closure properties under polymorphisms.
Heterogeneous Base Classes Consider the following SAT instance F n = {C, D 1 , . . . , D n } where C = (x ∨ ¬a 1 ∨ · · · ∨ ¬a n ) and D i = (¬x ∨ b i ∨ c i ). It is easy to see that any strong backdoor set into HORN needs to contain at least one of the variables b i or c i from each clause D i , hence such a backdoor set must be of size Ω(n); on the other hand, any strong backdoor set into 2CNF must contain at least (n − 2) variables from the clause C; hence such a backdoor must be of size at Ω(n) as well. However, F n [x = false] is Horn, and F n [x = true] is a 2CNF, hence the singleton {x} constitutes a strong backdoor set into the "heterogeneous" base class HORN∪2CNF. This example shows that by considering heterogeneous base classes we can access structural properties of instances that are not accessible by backdoor sets into homogeneous base classes. Identifying a base class with a class of instances that are solvable by a particular polynomial-time subsolver, one can consider a heterogeneous base class as a "portfolio subsolver," where for each instance the best suitable subsolver from the portfolio is chosen.
SAT Backdoor Sets A natural question at this point is whether the fixed-parameter tractability results for the detection of strong backdoor sets into individual base classes can be extended to more powerful heterogeneous base classes. In this work, we completely characterize the complexity landscape for heterogeneous base classes obtained arbitrary combinations of the well-known Schaefer classes [38], in the following denoted by HORN (for Horn formulas), HORN − (for Anti-Horn formulas), 2CNF (for 2-CNF formulas), 0-VAL (for zero valid formulas), and 1-VAL (for one valid formulas). To state the classification, we briefly introduce some terminology. We say that a pair (C, C ′ ) of Schaefer classes is a bad pair if C ∈ {HORN, 0-VAL} and C ′ ∈ {HORN − , 1-VAL}.
Let C be a class of CNF-formulas such that C = s∈S s for some subset S of the Schaefer classes. Our main result for SAT backdoor sets (Theorem 6) is that Strong C-Backdoor Detection is fixed parameter tractable if and only if S does not contain a bad pair of Schaefer classes, otherwise it is W [2]-hard. On the other hand, detecting weak backdoors is always W [2]-hard for any choice of C, and we show this by building on the known hardness results for when C is a singleton set (Theorem 8).
We also show that Strong C-Backdoor Detection as well as Weak C-Backdoor Detection are fixed-parameter tractable for the combined parameter k and the maximum length r of a clause of the input formula (Theorem 7 and 9). These algorithms formalize the intuition that all the hardness results in the previous classification result exploit clauses of unbounded length.

CSP Backdoor Sets
The identification of tractable classes of CSP instances has been subject of extensive studies. A prominent line of research, initiated by Schaefer [38] in his seminal paper on Boolean CSP, is to identify tractable classes by restricting the relations that may appear in constraints to a prescribed set, a constraint language. Today, many constraint languages have been identified that give rise to tractable classes of CSPs [2,5,22]; typically such languages are defined in terms of certain closure properties, which ensure that the relations are closed under pointwise application of certain operations on the domain. For instance, consider a CSP instance whose relations are closed under a constant operation f (x) = d for some d ∈ D (such a operation is a polymorphism of the relations in the instance). Then note that every relation is either empty or forced to contain the tuple d, d, . . . , d . Thus, given a particular instance, we may either declare it unsatisfiable (if it contains a constraint over the empty relation), or satisfy it trivially by setting every variable to d. Further examples of polymorphisms for which closure properties yield tractable CSP are min, max, majority, affine, and Mal'cev operations [1,24].
We study the problem of finding strong and weak backdoor sets into tractable classes of CSP instances defined by certain polymorphisms. Our main result for CSP backdoors (Theorem 10) establishes fixedparameter tractability for a wide range of such base classes. In particular, we show that the detection of strong and weak backdoor sets is fixed-parameter tractable for the combined parameter backdoor size, domain size, and the maximum arity of constraints. In fact, this result entails heterogeneous base classes, as different instantiations of the backdoor variables can lead to reduced instances that are closed under different polymorphisms (even polymorphisms of different type). We complement our main result with hardness results that show that we lose fixed-parameter tractability when we omit either domain size or the maximum arity of constraints from the parameter (Theorems 12 and 13). Hence, Theorem 10 is tight in a certain sense.
Related Work Recently, two papers dealing with strong backdoor set detection for the constraint satisfaction problem have appeared [7,17], which nicely supplement (however are mostly orthogonal to) the results in this paper. Carbonnel et al. [7] show W[2]-hardness for strong backdoor set detection parameterized by the size of the backdoor set even for CSP-instances with only one constraint (however with unbounded domain and unbounded arity). They also give a fixed-parameter algorithm for strong backdoor set detection parameterized by the size of the backdoor set and the maximum arity of any constraint, if the base class is "h-Helly" for any fixed integer h. However, as is also mentioned in Carbonnel and Cooper [6], the "h-Helly" property is rather restrictive and orthogonal to our approach of considering the domain as an additional parameter.
Ganian et al. [17] show fixed-parameter tractability of strong backdoor detection parameterized by the size of the backdoor to a very general family of heterogeneous base classes, i.e., base classes defined as all CSP-instances obtained from the disjoint union of tractable, finite, and semi-conservative constraint languages. These base classes are orthogonal to the base classes considered in this paper. They are more general in the sense that they allow for the CSP-instance to consist of pairwise disjoint subinstances each belonging to a different tractable class, and they are more specific in the sense that they only consider finite and semi-conservative constraint languages, which also restricts the CSP-instances to bounded domain and bounded arity.

Preliminaries
SAT A literal is a propositional variable x or a negated variable ¬x. We also use the notation x = x 1 and ¬x = x 0 . A clause is a finite set of literals that does not contain a complementary pair x and ¬x. A propositional formula in conjunctive normal form, or CNF formula for short, is a set of clauses. For a clause C we write var(C) = { x : x ∈ C or ¬x ∈ C }, and for a CNF formula F we write var(F ) = C∈F var(C).
For a set X of propositional variables we denote by X → {0, 1} the set of all mappings from X to {0, 1}, the truth assignments on X. We denote by X the set of literals corresponding to the negated variables of X. For τ : x ∈ X } be the sets of literals set by τ to 1 and 0, respectively. Given a CNF formula F and a truth assignment CSP Let D be a set and n and n ′ be natural numbers. An n-ary relation on D is a subset of D n . For a tuple t ∈ D n , we denote by t[i], the i-th entry of t, where 1 ≤ i ≤ n. For two tuples t ∈ D n and t ′ ∈ D n ′ , we denote by t • t ′ , the concatenation of t and t ′ .
An instance of a constraint satisfaction problem (CSP) I is a triple V, D, C , where V is a finite set of variables over a finite set (domain) D, and C is a set of constraints. A constraint c ∈ C consists of a scope, denoted by V (c), which is an ordered list of a subset of V , and a relation, denoted by R(c), which is a |V (c)|-ary relation on D. To simplify notation, we sometimes treat ordered lists without repetitions, such as the scope of a constraint, like sets. For a variable v ∈ V (c) and a tuple t ∈ R(c), we denote by t[v], the i-th entry of t, where i is the position of v in V (c). For a CSP instance I = V, D, C we sometimes denote by V (I), D(I), C(I), and δ(I), its set of variables V , its domain D, its set of constraints C, and the maximum arity of any constraint of I, respectively.
Let V ′ ⊆ V and τ : V ′ → D. For a constraint c ∈ C, we denote by c[τ ], the constraint whose scope is V (c) \ V ′ and whose relation contains all |V (c[τ ])|-ary tuples t such that there is a |V (c)|-ary tuple A solution to a CSP instance I is a mapping τ : Backdoors Backdoors are defined relative to some fixed class C of instances of the problem under consideration (i.e., SAT or CSP). One usually assumes that the problem is tractable for instances from C, as well as that the recognition of C is tractable.
In the context of SAT, we define a strong C-backdoor set of a CNF formula F to be a set B of variables such that F [τ ] ∈ C for each τ : B → {0, 1}. A weak C-backdoor set of F is a set B of variables such that F [τ ] is satisfiable and F [τ ] ∈ C holds for some τ : B → {0, 1}. If we know a strong C-backdoor set of F , we can decide the satisfiability of F by checking the satisfiability of 2 k "easy" formulas F [τ ] that belong to C. Thus SAT decision is fixed-parameter tractable in the size k of the backdoor. Similarly, in the context of CSP, we define a strong C-backdoor set of a CSP instance I = V, D, C as a set B of variables such that I[τ ] ∈ C for every τ : B → D. We also call a strong C-backdoor a strong backdoor set into C. A weak C-backdoor set of I is a set B of variables such that I[τ ] is satisfiable and I[τ ] ∈ C holds for some τ : B → D. If we know a strong C-backdoor set of I of size k, we can reduce the satisfiability of I to the satisfiability of d k CSP instances in C where d = |D|. Thus deciding the satisfiability of a CSP instance is fixed-parameter tractable in the combined parameter d + k.
The challenging problem is-for SAT and for CSP-to find a strong, or weak C-backdoor set of size at most k if one exists.
For each class C of SAT or CSP instances, we define the following problem.
Strong C-Backdoor Detection Input: A SAT or CSP instance I and a nonnegative integer k. Question: Does I have a strong C-backdoor set of size at most k?
The problem Weak C-Backdoor Detection is defined similarly.
Parameterized Complexity We provide basic definitions of parameterized complexity; for an indepth treatment we refer to the recent monograph [11]. A problem is parameterized if each problem instance I is associated with a nonnegative integer k, the parameter. A parameterized problem is fixed-parameter tractable (or FPT, for short) if there is an algorithm, A, a constant c, and a computable function f , such that A solves instances of input size n and parameter k in time f (k)n c . Fixed-parameter tractability extends the conventional notion of polynomial-time tractability, the latter being the special case where f is a polynomial. The so-called Weft-hierarchy W[1] ⊆ W[2] ⊆ . . . contains classes of parameterized decision problems that are presumed to be larger than FPT. It is believed that problems that are hard for any of the classes in the Weft-hierarchy are not fixed-parameter tractable. The classes are closed under fpt-reductions that are fixed-parameter tractable many-one reductions, which map an instance x with parameter k of one problem to a decision-equivalent instance x ′ with parameter k ′ of another problem, where k ′ ≤ f (k) for some computable function f . For instance, the following problem is well-known to be W[2]-complete [11].

Hitting Set
Parameter: k Input: A set system Q over a set (universe) U , and a positive integer k Question: Is there a subset X ⊆ U , with |X| ≤ k such that every set S ∈ Q contains at least one element from X?

Backdoor Detection for SAT
Schaefer's base classes [38] give rise to classes of CNF formulas defined in terms of syntactical properties of clauses. 1 A clause is

Strong Backdoor Sets
In this section we study the parameterized complexity of Strong C-Backdoor Detection, where C is the union of any subset of the Schaefer classes. In the case that C consists only of a single Schaefer class this has been intensively studied before [18,32] and it is known that Strong C-Backdoor Detection is polynomial for 0-VAL and 1-VAL, and FPT for the remaining Schaefer classes.
The results in this subsection are as follows. First we show that Strong H-Backdoor Detection is fixed-parameter tractable parameterized by the size of the backdoor set for various combinations of the Schaefer classes, i.e., the case that H = 2CNF ∪ C for any C ∈ Schaefer is shown in Theorem 2, the cases that H = HORN ∪ 0-VAL and H = HORN − ∪ 1-VAL are shown in Theorem 3, and finally Theorem 4 shows tractability for the cases that H = 2CNF ∪ HORN ∪ 0-VAL and H = 2CNF ∪ HORN − ∪ 1-VAL. In contrast, Theorem 5 captures a condition for hardness of the strong backdoor detection problem, which is complementary to all the cases in the first three results. Together, and combined with known results in the literature, these theorems give us a complete complexity classification, which is summarized in Theorem 6.
Our hardness results rely on the fact that the clauses have unbounded length. Theorem 7 shows that if we consider the maximum length of any clause as an additional parameter, then the problem of finding a strong heterogeneous backdoor becomes fixed-parameter tractable for any combination of the Schaefer classes.
As mentioned above we employ branching algorithms for the detection of strong backdoor sets. In particular, all algorithms are based on a depth-bounded search tree approach and mainly differ in the set of employed branching rules. Informally, the algorithms construct a search tree, where each node is labeled with a potential backdoor set and the crucial difference between the algorithms lies in chosing the set of possible extensions of the potential backdoor set on which to branch on. In this way backdoor set detection can be reduced to the following problem, which given a potential backdoor set B ′ computes the set Q of potential extensions of B ′ , which can be branched on in the next step.

C-Strong Branch
Input: A CNF formula F with variables V , a non-negative integer k, and a subset B ′ ⊆ V with |B ′ | ≤ k. Question: Output: • Yes iff B ′ is a strong C-backdoor set of F , or • a family Q of subsets of V \ B ′ such that: B1 for every Q ∈ Q it holds that |B ′ ∪ Q| ≤ k, and The next theorem shows that Strong C-Backdoor Detection can be reduced to C-Strong Branch via a branching algorithm that uses an algorithm A for C-Strong Branch as a subroutine to determine the set of braching choices. Importantly the running time of the resulting branching algorithm for Strong C-Backdoor Detection crucially depends on the "type" of braching rules returned by A, or in other words the branching factor. To be able to quantify the branching factor we introduce the function T A (k) defined recursively as where O is the set of all possible output sets Q of A on any input F , B ′ ⊆ V with |B ′ | ≤ k, and k. Theorem 1. Let C be a class of CNF formulas, F be a CNF formula, k a non-negative integer, and let A be an algorithm solving C-Strong Branch. Then Strong C-Backdoor Detection can be Proof. We will employ a branching algorithm that employs the algorithm A solving C-Strong Branch as a subroutine. The algorithm uses a depth-bounded search tree approach to find a strong C-backdoor set of size at most k. Let F be any CNF-formula with variables V .
We construct a search tree T , for which every node is labeled by a set B of at most k variables of V . Additionally, every leaf node has a second label, which is either Yes or No. T is defined inductively as follows. The root of T is labeled by the empty set. Furthermore, if t is a node of T , whose first label is B ′ , then the children of t in T are obtained as follows. First we run the algorithm A on F , B ′ , and k. If A returns Yes then t becomes a leaf node, whose second label is Yes. Otherwise let Q be the set of subsets of V \ B ′ returned by A. If Q = ∅, then there is no strong C-backdoor set B of F with B ′ ⊆ B and |B| ≤ k and consequently t becomes a leaf node whose second label is No. Otherwise, i.e., if Q = ∅ then t has a a child for every Q ∈ Q, whose first label is B ′ ∪ Q. This completes the definition of T . If T has a leaf node, whose second label is Yes, then the algorithm returns the first label of that leaf node as a strong C-backdoor set of F . Otherwise the algorithm returns No. This completes the description of the algorithm.
We now show the correctness of the algorithm. First, suppose the search tree T built by the algorithm has a leaf node t whose second label is Yes. Here, the algorithm returns the first label, say B of t. By definition of T , we obtain that |B| ≤ k and B is a strong C-backdoor set of F . Now consider the case where the algorithm returns No. We need to show that F has no strong C-backdoor set of size at most k. Assume, for the sake of contradiction that such a set B exists.
Observe first that for every leaf node t of T whose second label is No, it holds that B ′ B. This is because the algorithm A on input F , B ′ , and k returned the empty set for Q. Hence if t is a leaf node whose first label B ′ satisfies B ′ ⊆ B, then the second label of t must be Yes.
It hence remains to show that T has a leaf node whose first label is a set B ′ with B ′ ⊆ B. This will complete the proof about the correctness of the algorithm. We will show a slightly stronger statement, namely, that for every natural number ℓ, either T has a leaf whose first label is contained in B or T has an inner node of distance exactly ℓ from the root whose first label is contained in B. We show the latter by induction on ℓ.
The claim obviously holds for ℓ = 0. So assume that T contains a node t at distance ℓ from the root of T whose first label, say B ′ , is a subset of B. If t is a leaf node of T , then the claim is shown. Otherwise, the algorithm A determined that B ′ is not a strong C-backdoor set of F and returned a set Q of subsets of V \ B ′ satisfying B2. Hence there is a Q ∈ Q with B ′ ∪ Q ⊆ B and because t contains a child t ′ whose first label is B ′ ∪ Q, we obtain that t ′ is a node at distance ℓ + 1 satisfying the induction invariant. This concludes the proof concerning the correctness of the algorithm.
The running time of the algorithm is obtained as follows. Let T be a search tree obtained by the algorithm. Then the running time of the depth-bounded search tree algorithm is O(|V (T )|) times the maximum time that is spend on any node of T . Since |V (T )| ≤ T A (k) and the time spend on any node is at most R A (F, k), the stated running time follows.
Our first tractability result is for Strong (2CNF ∪ C)-Backdoor Detection, where C ∈ Schaefer. Before formally stating the algorithm, we provide a brief intuition for the branching rules. Typically, we branch on an obstructing clause (or a pair of obstructing clauses), a situation that occurs in one of two flavors: (1) Either there is a clause C that is not in 2CNF ∪ C, or, (2) there is a pair of clauses C and C ′ , where C ∈ 2CNF \ C and C ′ ∈ C \ 2CNF.
Consider the case when C = 0-VAL. In scenario (1), the formula has a clause C of length at least three with only positive literals. Because C has only positive literals, it follows that no subclause of C is 0-valid. Hence every backdoor set has to hit all but at most two literals from C. It follows that if C has more than k + 2 literals, then there is no strong backdoor of size k to 0-VAL ∪ 2CNF. Otherwise, the clause has at most k + 2 literals on which we can branch exhaustively. In scenario (2), we know that C has at most two literals and because C / ∈ 0-VAL we obtain that any strong backdoor set that does not contain a variable from C must reduce C ′ to a clause with at most two literals. Hence, any strong backdoor set has to contain either a variable from C (but there are at most two of those) or must contain a variable from any subset of three variables in C ′ .
Consider the case when C = HORN. In scenario (1) above, the formula has a clause C of length at least three with at least two positive literals, say x and y. Let ℓ be any other literal in C. It is clear that any strong backdoor set must contain one of x, y or ℓ, and we branch accordingly. In scenario (2), we know that C has at most two literals and C ′ contains at least two positive literals. Because every strong backdoor set that does not contain a variable from C must reduce C ′ to a clause with at most two literals, we can branch on the variables in C and any subset of three variables in C ′ .
The intuitive explanations for 1-VAL and HORN − are analogous. Note that the criteria described above need to be refined further at internal nodes of the branching process. We now turn to a formal exposition of the algorithm. Proof. Let H = 2CNF∪C. We will provide an algorithm A solving H-Strong Branch in time O(2 k |F |) and satisfying T A (k) = 9 k . The result then follows from Theorem 1.
Let F be the given CNF formula with variables V , k the given integer, and B ′ ⊆ V with |B ′ | ≤ k. The algorithm A first checks whether F [τ ] ∈ H for every assignment τ : B ′ → {0, 1}. If that is the case then A returns Yes. Otherwise let τ : B ′ → {0, 1} be an assignment such that F [τ ] / ∈ H, we consider two cases: and |B| ≤ k and the algorithm A correctly returns the set Q = ∅, 2. otherwise, i.e., if |B ′ | < k, then we again distinguish two cases: (a) there is a clause C ∈ F [τ ] with C / ∈ H, then we again distinguish two cases: To show the correctness of this step assume that there is a strong H-backdoor set B of F with B ′ ⊆ B and |B| ≤ k. It suffices to show that B ∩O = ∅. Suppose for a contradiction that this is not the case and let τ * : B → {0, 1} be an assignment compatible with τ that does not satisfy any literal of C. Then, F [τ * ] contains a superset of O as a clause and hence F [τ * ] / ∈ 2CNF ∪ C, contradicting our assumption that B is a strong H-backdoor set of F . ii. if C ∈ {1-VAL, 0-VAL}, then we again distinguish two cases: A. |B ′ | + |C| − 2 > k, then the algorithm A returns the set Q = ∅.
The correctness of this step follows from the fact that every strong H-backdoor set B of F with B ′ ⊆ B has to contain all but at most two variables of C and hence B would have size larger than k. B. otherwise, i.e., if |B| + |C| − 2 ≤ k, then the algorithm A returns the set Q containing all sets var(C \ O) for every two element subset O of C.
To show the correctness of this step assume that there is a strong H-backdoor set B of F with B ′ ⊆ B and |B| ≤ k. It remains to show that |var(C) \ B| ≤ 2. Assume not, and let τ * : B → {0, 1} be an assignment compatible with τ that does not satisfy any literal of C. Then, Let O be the set of variables containing the (at most) two variables from C plus any three element subset of variables from C ′ . Then, the algorithm A returns the set To show the correctness of this step assume that there is a strong H-backdoor set B of F with B ′ ⊆ B and |B| ≤ k. It remains to show that B ∩ var(O) = ∅. Assume not, and let τ * : B → {0, 1} be an assignment compatible with τ that does not satisfy any literal of C ′ . Then, F [τ * ] contains the clause C together with a subclause C ′′ of C ′ containing at least three literals. Because C / ∈ C and C ′′ / ∈ 2CNF, we obtain that This completes the description and the proof of correctness of the algorithm A. The running time of A is the number of assignments of the at most k variables in B ′ times the time required to test whether the reduced formula is in H, i.e., A runs in time O(2 k |F |). It remains to obtaine the stated bound of 9 k for the function T A (k). According to the three branching rules given in (2.a.i), (2.a.ii.B), and (2.b) we obtain that T A (k) can be bounded by the maximum of the following recurrence relations: In case of (1) T A (k) is at most 3 k , in case of (2) the maximum of 9 k is obtained for T A (k) by setting r = 3, and in case of (3) We now turn to the case when the base classes are either HORN ∪ 0-VAL or HORN − ∪ 1-VAL. As before, in scenario (1), the length of an obstructing clause must be bounded in a Yes-instance. Indeed, consider a clause C that is not in HORN ∪ 0-VAL. Such a clause has only positive literals, and any strong backdoor set must contain all these literals but one. Therefore, if the clause has more than k + 1 literals, we reject the instance, otherwise the clause length is bounded, allowing for a bounded branching strategy.
In scenario (2), on the other hand, we have a pair of obstructing clauses, say C ∈ HORN \ 0-VAL, and C ′ ∈ 0-VAL \ HORN. Now, note that C can have only one literal by definition. Let O be any subset of two positive literals from C ′ . Note that any strong backdoor must intersect either O or the unique literal in C, which again leads us to a feasible branching step. We now turn to a formal description of the algorithm. Proof. We only give the proof for the class HORN ∪ 0-VAL, as the proof for the class HORN − ∪ 1-VAL is analogous. Let H = HORN ∪ 0-VAL. We will provide an algorithm A solving H-Strong Branch in time O(2 k |F |) and satisfying T A (k) = 3 k . The result then follows from Theorem 1.
Let F be the given CNF formula with variables V , k the given integer, and ∈ H, we consider two cases: To show the correctness of this step assume that there is a strong H-backdoor set B of F with B ′ ⊆ B and |B| ≤ k. It suffices to show that |var(C) \ B| ≤ 1. Assume not, and let τ * : B → {0, 1} be an assignment compatible with τ that does not satisfy any literal of C. Then, ∈ HORN ∪ 0-VAL, contradicting our assumption that B is a strong H-backdoor set of F .
Let O be the set of variables containing the one variable from C plus any two variables corresponding to two positive literals from C ′ . Then A returns the set To show the correctness of this step assume that there is a strong H-backdoor set B of F with B ′ ⊆ B and |B| ≤ k. It sufficies to show that B ∩ O = ∅. Assume not, and let τ * : B → {0, 1} be an assignment compatible with τ that does not satisfy any literal of C ′ . Then, F [τ * ] contains the clause C together with a subclause C ′′ of C ′ containing at least two positive literals. Because C / ∈ 0-VAL and C ′′ / ∈ HORN, we obtain that This completes the description and the proof of correctness of the algorithm A. The running time of A is the number of assignments of the at most k variables in B ′ times the time required to test whether the reduced formula is in H, i.e., A runs in time O(2 k |F |). It remains to obtaine the stated bound of 3 k for the function T A (k). According to the two branching rules given in (2.a.ii) and (2.b) we obtain that T A (k) can be bounded by the maximum of the following recurrence relations: In case of (1) the maximum of 2 k is obtained for T A (k) by setting r = 2, and in case of (2) T A (k) is at most 3 k . It follows that T A (k) ≤ 3 k .
In our next result, we consider heterogeneous base classes comprised of three Schaefer's classes, namely 2CNF ∪ HORN ∪ 0-VAL and 2CNF ∪ HORN − ∪ 1-VAL. We refer the reader to Figure 1 for an overview of the branching strategies employed here. Proof. We only give the proof for the class 2CNF ∪ HORN ∪ 0-VAL, since the proof for the class 2CNF ∪ HORN − ∪ 1-VAL is analogous. Let H = 2CNF ∪ HORN ∪ 0-VAL. We will provide an algorithm A solving H-Strong Branch in time O(2 k |F |) and satisfying T A (k) = 9 k . The result then follows from Theorem 1.
Let F be the given CNF formula with variables V , k the given integer, and ∈ H, we consider two cases: and |B| ≤ k and the algorithm A correctly returns the set Q = ∅, 2. otherwise, i.e., if |B ′ | < k, then we again distinguish two cases: (a) there is a clause C ∈ F [τ ] with C / ∈ H, then we again distinguish two cases: To show the correctness of this step it is sufficient to show that F does not have a strong H-backdoor set B with B ′ ⊆ B and |B| ≤ k. Assume for a contradiction that this is not the case and let B be strong H-backdoor set of F with B ′ ⊆ B and |B| ≤ k. Because |B ′ | + |C| − 2 > k, we obtain that B misses at least three literals from C. Hence, there is an assignment Clearly, C ′ / ∈ 2CNF∪0-VAL and because C contained only positive literals (because C / ∈ 0-VAL)) also C ′ / ∈ HORN. Hence, C ′ / ∈ 2CNF ∪ HORN ∪ 0-VAL contradicting our assumption that B is a strong H-backdoor set for F . (b) there is a clause C ∈ F [τ ] with C ∈ 2CNF and C / ∈ 0-VAL, we again distinguish two cases: i. there is a clause C ′ ∈ F [τ ] with C ′ / ∈ 2CNF ∪ HORN (note that C ′ ∈ 0-VAL). Let O be a set of variables containing all variables of C (at most two) plus three variables of C ′ of which two correspond to positive literals in C ′ . Then the algorithm A returns the set To show the correctness of this step assume that there is a strong H-backdoor set B of F with B ′ ⊆ B and |B| ≤ k. It sufficies to show that B ∩ O = ∅. Assume not and let τ * : B → {0, 1} be an assignment compatible with τ , which does not satisfy any literal of C ′ . Then, F [τ * ] contains C as well as a subclause C ′′ of C ′ of length at least three, which contains at least two positive literals. Then, C ′′ / ∈ HORN ∪ KROM and because C / ∈ 0-VAL, we obtain that F [τ * ] / ∈ 2CNF ∪ HORN ∪ 0-VAL, contradicting our assumption that B is a strong H-backdoor set for F . ii. otherwise, there are clauses C 2CNF , C HORN ∈ F [τ ] with C 2CNF ∈ 2CNF \ HORN and C HORN ∈ HORN \ 2CNF. Let O be a set of variables containing all variables of C 2CNF (at most two) and three variables of C HORN . Then the algorithm A returns the set C ∈ 2CNF and C / ∈ HORN There is a clause C ∈ F [τ ] Branch. Branch.
Implies C / ∈ 0-VAL, subsumed above. To show the correctness of this step assume that there is a strong H-backdoor set B of F with B ′ ⊆ B and |B| ≤ k. It sufficies to show that B ∩ O = ∅. Assume not and let τ * : B → {0, 1} be an assignment compatible with τ , which does not satisfy any literal of C HORN . Then, F [τ * ] contains C 2CNF as well as a subclause C ′ of C HORN of length at least three. Because C 2CNF ∈ 2CNF \ HORN it follows that C 2CNF / ∈ 0-VAL. Because also C ′ / ∈ 2CNF, we obtain that F [τ * ] / ∈ 2CNF ∪ HORN ∪ 0-VAL, contradicting our assumption that B is a strong H-backdoor set for F .
(c) there is a clause C ∈ F [τ ] with C ∈ 2CNF and C / ∈ HORN. In this case also C / ∈ 0-VAL and hence the case is covered by case (2.b).
(d) The cases (2.a), (2.b), and (2.c) completely cover all possible cases, because if none of these cases apply then F [τ ] ∈ 0-VAL, which contradicts the choice of τ . To see this assume there is a clause C ∈ F [τ ] with C / ∈ 0-VAL. Because of the cases (2.b) and (2.c), we obtain that C / ∈ 2CNF. Furthermore, because of case (2.a), we obtain that C ∈ HORN. Hence, C ∈ HORN \ (0-VAL ∪ 2CNF) but such a clause cannot exist.
This completes the description and the proof of correctness of the algorithm A. The running time of A is the number of assignments of the at most k variables in B ′ times the time required to test whether the reduced formula is in H, i.e., A runs in time O(2 k |F |). It remains to obtain the stated bound of 9 k for the function T A (k).
According to the three branching rules given in (2.a.ii), (2.b.i), and (2.b.ii) we obtain that T A (k) can be bounded by the maximum of the following recurrence relations: In case of (2) and (3) T A (k) is at most 5 k and in case of (1) the maximum of 9 k is obtained for T A (k) by setting r = 3. It follows that T A (k) ≤ 9 k .
We say that a pair (C, C ′ ) of Schaefer classes is a bad pair if C ∈ {HORN, 0-VAL} and C ′ ∈ {HORN − , 1-VAL}. Our next result establishes hardness for the case when the base class contains a bad pair.
There is also one clause c U = {¬u : u ∈ U }. This completes the description of the reduction.
We claim that Q has a hitting set of size at most k if and only if the formula F has a strong Cbackdoor set of size at most k. Suppose X ⊆ U , |X| ≤ k, is a hitting set. To show that X is also a strong C-backdoor set, consider any assignment τ : X → {0, 1}. If τ (x) = 0 for some x ∈ X, then τ satisfies the clause c U . Thus, F [τ ] ∈ C since each clause in F [τ ] contains no negative literal and at least one positive literal and is hence in 1-VAL ∩ HORN − . If τ (x) = 1 for all x ∈ X, then all clauses c Q , Q ∈ Q, are satisfied by τ since X is a hitting set. The only remaining clause is HORN and 0-VAL since it has no positive literal and at least one negative literal.
For the other direction, suppose that X is a strong C-backdoor set of size at most k. Obtain X ′ from X by replacing each d i Q ∈ X for any i with 1 ≤ i ≤ |U \ Q| by some variable from Q. The set X ′ is also a strong C-backdoor set of size at most k. Therefore, the assignment τ : X ′ → {0, 1} with τ (x) = 1 for all x ∈ X ′ must satisfy all clauses c Q , Q ∈ Q. Otherwise, F [τ ] contains both a long clause containing only positive and a long clause containing only negative literals and hence F [τ ] / ∈ s∈S s. Thus, X ′ is a hitting set for Q of size at most k.
We now summarize our results in the following theorem. Proof. If S contains a bad pair then the result follows from Theorem 5. So assume that S does not contain a bad pair, we distinguish the following cases: • if |S| = 1, then the theorem follows from known results, see, for example, [18,32].
• if |S| = 2, then either 2CNF ∈ S in which case the result follows from Theorem 2, or S = {HORN, 0-VAL} or S = {HORN − , 1-VAL} in which case the result follows from Theorem 3.
• if |S| = 3, then either 2CNF ∈ S and hence S = {2CNF, HORN, 0-VAL} or S = {2CNF, HORN − , 1-VAL} in which case the result follows from Theorem 4, or 2CNF / ∈ S in which case S contains at least one bad pair, and the result follows from Theorem 5.
• if |S| > 3, then S contains at least one bad pair, and the result follows from Theorem 5.
It is crucial for these hardness proofs that clauses have unbounded length. Indeed, if clause-lengths are bounded or if we add the maximum clause length to the parameter, then strong backdoor detection becomes FPT for any combination of Schaefer classes.
Theorem 7. Let C be a class of CNF-formulas such that C = s∈S s for some S ⊆ Schaefer. Then, Strong C-Backdoor Detection is fixed-parameter tractable for the combined parameter k and the maximum length r of a clause of the input formula.
Proof. We will provide an algorithm A solving C-Strong Branch in time O(2 k |F |) and satisfying T A (k) = (|S|r)) k+1 . The result then follows from Theorem 1. Let F be the given CNF formula with variables V , k the given integer, and B ′ ⊆ V with |B ′ | ≤ k. The algorithm A first checks whether F [τ ] ∈ C for every assignment τ : B ′ → {0, 1}. If that is the case then A returns Yes. Otherwise let τ : B ′ → {0, 1} be an assignment such that F [τ ] / ∈ C, we consider two cases: 1. if |B ′ | = k, then there is no strong C-backdoor set B of F with B ′ ⊆ B and |B| ≤ k and the algorithm A correctly returns the set Q = ∅.
2. otherwise, i.e., if |B ′ | < k, then let C s be an arbitrary clause in F [τ ] with C s / ∈ s for every s ∈ S. The algorithm A then returns the set Q = s∈S { {v} : v ∈ var(C s ) }.
To show the correctness of this step assume that there is a strong C-backdoor set B of F with B ′ ⊆ B and |B| ≤ k. It sufficies to show that B ∩ s∈S var(C) = ∅. Let τ * : B → {0, 1} be any assignment of the variables in B that agrees with τ on the variables in B ′ and let s ∈ S be such that F [τ * ] ∈ s. Because B is a strong C-backdoor set, s clearly exists. We claim that var(C) ∩ B = ∅ for every clause C ∈ F [τ ] with C / ∈ S (and hence in particular for the clause C s chosen by A). Indeed, suppose not. Then C ∈ F [τ * ] a contradiction to our assumption that This completes the description and the proof of correctness of the algorithm A. The running time of A is the number of assignments of the at most k variables in B ′ times the time required to test whether the reduced formula is in C, i.e., A runs in time O(2 k |F |). It remains to obtain the stated bound of (|S|r) k+1 for the function T A (k), which follows because |Q| ≤ |S|r and |Q| = 1 for every Q ∈ Q.

Weak Backdoor Sets
It turns out that the complexity of finding weak backdoors into heterogeneous classes is tightly tied to the complexity of finding weak backdoors into the individual base classes. Let us briefly consider the intuition for this scenario before stating the result. Suppose we are given algorithms for finding weak backdoors into base classes C 1 and C 2 . Observe that a CNF-formula has a weak backdoor of size at most k into (C 1 ∪ C 2 ) if, and only if, it has a weak backdoor of size at most k into at least one of C 1 or C 2 . Thus, if we have a positive algorithmic result for the weak backdoor question with respect to the individual base classes, then these algorithms can be easily combined to obtain an algorithm for finding weak backdoors into the corresponding heterogeneous base class. On the other hand, a hardness result for even one of the involved classes can usually be leveraged to obtain a hardness result for the entire heterogeneous problem, by adding gadgets that isolate the issue to only one of the base classes, typically the one that was hard to begin with. In particular, we obtain the following result. Before we proceed further, we introduce the notion of an obstruction which we will use in the proof. Specifically, for S, S ′ ∈ Schaefer, we say that a clause C is an S-obstruction to S ′ if C ∈ S and C / ∈ S ′ . For any pair of Schaefer classes S and S ′ , it is easy to construct examples of S-obstructions to S ′ . In particular, we have: 1. (¬x, ¬y, ¬z) is a HORN-obstruction to 2CNF, and also a 0-VAL-obstruction to 2CNF.

(x, y, z)
is an HORN − -obstruction to 2CNF, and also a 1-VAL-obstruction to 2CNF. We are now ready to describe our reduction towards Theorem 8.
Proof. If |S| = 1, then the result follows directly from [18,Proposition 1]. Otherwise, let S ∈ C. We reduce an instance (F, k) of Weak S-Backdoor Detection to Weak C-Backdoor Detection. To this end, for all S ′ ∈ C such that S = S ′ , introduce (k + 1) variable-disjoint copies of a S-obstruction to S ′ using fresh variables for each obstruction, and in particular, disjoint from var(F ). We use F ′ to denote the formula obtained from F after adding these obstructions to F , and the reduced instance is given by (F ′ , k).
In the forward direction, if X is a weak backdoor to S for F , and if τ : X → {0, 1} is such that F [τ ] ∈ S, then observe that F ′ [τ ] ∈ S, since all the added obstructions (which are unaffected by τ ) were in S by definition. It is also easy to see that any satisfying assignment for var(F ) \ X can be easily extended to an assignment involving the new variables that satisfy all the obstructions (recall that the obstructions were variable disjoint, and therefore can be easily satisfied independently).
On the other hand, let X be a weak backdoor to C for F ′ . Since X has at most k variables, for any τ : X → {0, 1}, F ′ [τ ] contains at least one S ′ -obstructing clause for each S ′ ∈ C such that S ′ = S. Therefore, F ′ [τ ] must necessarily belong to S, and therefore X ∩ var(F ) is easily checked to be a weak backdoor to S for F , as desired.
On the other hand, as with the strong backdoors, we do obtain tractability when we have bounded clause lengths. We establish this formally below.
Theorem 9. Let C be a class of CNF-formulas such that C = s∈S s for some S ⊆ Schaefer. Then, Weak C-Backdoor Detection is fixed-parameter tractable for the combined parameter k and the maximum length r of a clause of the input formula.
Proof. The algorithm uses a depth-bounded search tree approach to find a weak C-backdoor set of size at most k. Let F be any CNF-formula with variables V and let r be the maximum length of any clause of F .
We construct a search tree T , for which every node is labeled by a set B of at most k variables of V . Additionally, every leaf node has a second label, which is either Yes or No. T is defined inductively as follows. The root of T is labeled by the empty set. Furthermore, if t is a node of T , whose first label is B, the children of t in T are obtained as follows.
If there is an assignment τ : B → {0, 1}, such that F [τ ] ∈ C and F [τ ] is satisfiable, then B is a weak C-backdoor set of size at most k, and hence t becomes a leaf node, whose second label is Yes. Otherwise, i.e., for every assignment τ : is not satisfiable, we consider two cases: (1) |B| = k, then t becomes a leaf node, whose second label is No, and (2) |B| < k, then for every assignment τ : B → {0, 1} such that F [τ ] / ∈ C, for every s ∈ S, and every variable v that occurs in some clause C / ∈ s, t has a child whose first label is B ∪ {v}. If T has a leaf node, whose second label is Yes, then the algorithm returns the first label of that leaf node. Otherwise the algorithm returns No. This completes the description of the algorithm.
We now show the correctness of the algorithm. First, suppose the search tree T built by the algorithm has a leaf node t whose second label is Yes. Here, the algorithm returns the first label, say B of t. By definition of T , we obtain that |B| ≤ k and the set B is a weak C-backdoor set of F , as required. Now consider the case where the algorithm returns No. We need to show that there is no weak C-backdoor set of size at most k for F . Assume, for the sake of contradiction that such a set B exists.
Observe that if T has a leaf node t whose first label is a set B ′ with B ′ ⊆ B, then the second label of t must be Yes. This is because, either |B ′ | < k in which case the second label of t must be Yes, or |B ′ | = k in which case B ′ = B and by the definition of B it follows that the second label of t must be Yes.
It hence remains to show that T has a leaf node whose first label is a set B ′ with B ′ ⊆ B. This will complete the proof about the correctness of the algorithm. We will show a slightly stronger statement, namely, that for every natural number ℓ, either T has a leaf whose first label is contained in B or T has an inner node of distance exactly ℓ from the root whose first label is contained in B. We show the latter by induction on ℓ.
The claim obviously holds for ℓ = 0. So assume that T contains a node t at distance ℓ from the root of T whose first label, say B ′ , is a subset of B. If t is a leaf node of T , then the claim is shown.
Because B is a weak C-backdoor set for F , there is an assignment τ * : B → {0, 1} such that F [τ * ] ∈ C and F [τ * ] is satisfiable. In particular, there is some s ∈ S such that F [τ * ] ∈ s. Let τ : B ′ → {0, 1} be the assignment that agrees with τ * on the variables of B ′ . Because t is not a leaf node, there is a clause C ∈ F [τ ] with C / ∈ s such that t has a child t ′ for every v ∈ var(C). We claim that var(C) ∩ B = ∅ and hence t has a child, whose first label is a subset of B, as required. Indeed, suppose not. Then C ∈ F [τ * ] a contradiction to our assumption that F [τ * ] ∈ s. This concludes our proof concerning the correctness of the algorithm.
The running time of the algorithm is obtained as follows. Let T be a search tree obtained by the algorithm. Then the running time of the depth-bounded search tree algorithm is O(|V (T )|) times the maximum time that is spent on any node of T . Since the number of children of any node of T is bounded by 2 k |S|r (recall that r denotes the maximum length of any clause of F ) and the longest path from the root of T to some leaf of T is bounded by k + 1, we obtain that |V (T )| ≤ O((2 k |S|r) k+1 ). Furthermore, the time required for any node t of T is at most O(2 k |F |). Putting everything together, we obtain O((2 k |S|r) k+1 2 k |F |), as the total running time of the algorithm. This shows that Weak C-Backdoor Detection is fixed-parameter tractable parameterized by k, r.
We close this section by noting that backdoor sets with empty clause detection, as proposed by [9] can be considered as backdoor sets into the heterogeneous base class obtained by the union of a homogeneous base class C and the class of all formulas that contain the empty clause. The detection of strong backdoor sets with empty clause detection is not fixed-parameter tractable for many natural base classes, including Horn and 2CNF [39].

Base Classes via Closure Properties
In this section we provide a very general framework that will give rise to a wide range of heterogeneous base classes for CSP.
Given an r-ary relation R over some domain D and an n-ary operation φ : D n → D, we say that R is closed under φ, if for all collections of n tuples t 1 , . . . , t n from R, the tuple φ(t 1 [1], . . . , t n [1]), . . . , φ(t 1 [r], . . . , t n [r]) belongs to R. The operation φ is also said to be a polymorphism of R. We denote by Pol(R) the set of all operations φ such that R is closed under φ.
Let I = V, D, C be a CSP instance and c ∈ C. We write Pol(c) for the set Pol(R(c)) and we write Pol(I) for the set c∈C Pol(c). We say that I is closed under an operation φ, or φ is a polymorphism of I, if φ ∈ Pol(I).
We say an operation φ is tractable if every CSP instance closed under φ can be solved in polynomial time.
Let P(φ) be a predicate for the operation φ. We call P(φ) a tractable polymorphism property if the following conditions hold.
• There is a constant c P such that for all finite domains D, all operations φ over D with property P are of arity at most c P .
• Given an operation φ and a domain D, one can check in polynomial time whether P(φ) holds on all of the at most D c P tuples over D, • Every operation with property P is tractable.
Every tractable polymorphism property P gives rise to a natural base class C P consisting of all CSP-instances I such that Pol(I) contains some polymorphism φ with P(φ).
In the following we will provide several illustrative examples for classes of CSP instances that can be defined via tractable polymorphism predicates. • An operation φ : D → D is constant if there is a d ∈ D such that for every d ′ ∈ D, it holds that φ(d ′ ) = d; • An operation φ : D 2 → D is a min/max operation if there is an ordering of the elements of D such that for every d, It is known that every constant, min/max, majority, minority, and Mal'cev operation is tractable [5,24]. We denote by VAL, MINMAX, MAJ, MIN, and MAL the class of CSP instances I for which Pol(I) contains a constant, a min/max, a majority, a minority, or a Mal'cev polymorphism, respectively.
In terms of the above definitions we can state the results of [24] and [5] as follows.

Proposition 1. Constant, min/max, majority, minority, and Mal'cev are tractable polymorphism properties.
We want to note here that Proposition 1 also applies for other much more general types of operations such as semilattice operations (sometimes called ACI operation) [24] (a generalization of min/max), k-ary near unanimity operations [15,25] (a generalization of majority), k-ary edge operations [23] (a generalization of Mal'cev), and the two operations of arities three and four [28] that capture the bounded width property [3] (a generalization of semilattice and near unanimity operations).
In the next sections we will study the problems Strong C P -Backdoor Detection for tractable polymorphism properties P.

Tractability of Backdoor Detection for CSP
In this section we will show that both Strong C P -Backdoor Detection and Weak C P -Backdoor Detection parameterized by the size of the backdoor set, the size of the domain, and the maximum arity of the CSP instance are fixed-parameter tractable for any tractable polymorphism property P. We start by giving the tractability results for strong backdoor sets.
Theorem 10. Let P be a tractable polymorphism property. Then Strong C P -Backdoor Detection is fixed-parameter tractable for the combined parameter size of the backdoor set, size of the domain, and the maximum arity of the given CSP instance.
Proof. Let P be a tractable polymorphism property, and let I, k with I = V, D, C be an instance of Strong C P -Backdoor Detection. Let P be the set of all operations on D that have property P. Then, P can be constructed in fpt-time with respect to the size of the domain , because there are at most |D| |D| c P c P -ary operations on D and for each of them we can test in polynomial time, |D| O(c P ) , whether it satisfies property P. The algorithm uses a depth-bounded search tree approach to find a strong C P -backdoor set of size at most k.
We construct a search tree T , for which every node is labeled by a set B of at most k variables of V . Additionally, every leaf node has a second label, which is either Yes or No. T is defined inductively as follows. The root of T is labeled by the empty set. Furthermore, if t is a node of T , whose first label is B, then the children of t in T are obtained as follows. If for every assignment τ : B → D there is an operation φ ∈ P such that I[τ ] is closed under φ, then B is a strong P -backdoor set of size at most k, and hence t becomes a leaf node, whose second label is Yes. Otherwise, i.e., if there is an assignment τ : B → D such that I[τ ] is not closed under any operation φ ∈ P , we consider two cases: (1) |B| = k, then t becomes a leaf node, whose second label is No, and (2) |B| < k, then for every operation φ ∈ P and every variable v in the scope of some constraint c ∈ C[τ ] that is not closed under φ, t has a child whose first label is B ∪ {v}.
If T has a leaf node, whose second label is Yes, then the algorithm returns the first label of that leaf node. Otherwise the algorithm returns No. This completes the description of the algorithm.
We now show the correctness of the algorithm. First, suppose the search tree T built by the algorithm has a leaf node t whose second label is Yes. Here, the algorithm returns the first label, say B of t. By definition, we obtain that |B| ≤ k and for every assignment τ : B → D, it holds that I[τ ] is closed under some operation in P , as required. Now consider the case where the algorithm returns No. We need to show that there is no set B of at most k variables of I such that Pol(I[τ ]) ∩ P = ∅ for every assignment τ of the variables of B. Assume, for the sake of contradiction that such a set B exists.
Observe that if T has a leaf node t whose first label is a set B ′ with B ′ ⊆ B, then the second label of t must be Yes. This is because, either |B ′ | < k in which case the second label of t must be Yes, or |B ′ | = k in which case B ′ = B and by the definition of B it follows that the second label of t must be Yes.
It hence remains to show that T has a leaf node whose first label is a set B ′ with B ′ ⊆ B. This will complete the proof about the correctness of the algorithm. We will show a slightly stronger statement, namely, that for every natural number ℓ, either T has a leaf whose first label is contained in B or T has an inner node of distance exactly ℓ from the root whose first label is contained in B. We show the latter by induction on ℓ.
The claim obviously holds for ℓ = 0. So assume that T contains a node t at distance ℓ from the root of T whose first label, say B ′ , is a subset of B. If t is a leaf node of T , then the claim is shown. Otherwise, there is an assignment τ : B ′ → D such that I[τ ] is not closed under any operation from P . Let τ * : B → D be any assignment of the variables in B that agrees with τ on the variables in B ′ and let φ ∈ P be such that I[τ * ] is closed under φ. Because B is a strong P -backdoor set, the polymorphism φ clearly exists. By definition of the search tree T , t has a child t ′ for every variable v in the scope of some constraint c ∈ C[τ ] that is not closed under φ. We claim that V (c) ∩ B = ∅ and hence t has a child, whose first label is a subset of B, as required. Indeed, suppose not. Then c ∈ C[τ * ] a contradiction to our assumption that I[τ * ] is closed under φ. This concludes our proof concerning the correctness of the algorithm.
The running time of the algorithm is obtained as follows. Let T be a search tree obtained by the algorithm. Then the running time of the depth-bounded search tree algorithm is O(|V (T )|) times the maximum time that is spent on any node of T . Since the number of children of any node of T is bounded by |P |δ(I) (recall that δ(I) denotes the maximum arity of any constraint of I) and the longest path from the root of T to some leaf of T is bounded by k + 1, we obtain that |V (T )| ≤ O((|P |δ(I)) k+1 ). Furthermore, the time required for any node t of T is at most  , φ), because φ is a c P -ary operation. Now, the total running time required by the algorithm is the time required to compute the set P plus the time required to compute T . Putting everything together, we obtain O((|P |δ(I)) k+1 |D| k |P |n O(1) ) = O((|P |δ(I)|D|) k+2 n O(1) ) = O((|D| |D| c P δ(I)|D|) k+2 n O(1) ), r as the total running time of the algorithm, where n denotes the input size of the CSP instance. This shows that Strong C P -Backdoor Detection is fixed-parameter tractable parameterized by k, δ(I), and |D|.
Because of Proposition 1, we obtain the following. We are now ready to provide analogous results for weak backdoor sets. The proof is very similar to the case of strong backdoor sets, however, it becomes slightly simpler, because we do not need to consider different operations for different assignments (since there is only one assignment, required for a weak backdoor set). We can hence branch on the possible operations before we start the depth-bounded search tree procedure, which also results in a slight improvement in the running time of the algorithm.
Theorem 11. Let P be a tractable polymorphism property. Then Weak C P -Backdoor Detection is fixed-parameter tractable for the combined parameter size of the backdoor set, size of the domain, and the maximum arity of the given CSP instance.
Proof. Let P be a tractable property, and let I, k with I = V, D, C be an instance of Weak C P -Backdoor Detection. Let P be the set of all operations on D that have property P. Then, P can be constructed in fpt-time with respect to the size of the domain , because there are at most |D| |D| c P c P -ary operations on D and for each of them we can test in polynomial time, |D| O(c P ) , whether it satisfies property P. The algorithm uses a depth-bounded search tree approach to find a weak {φ}-backdoor set of size at most k for every φ ∈ P .
The algorithm works by constructing a search tree T φ for every operation φ ∈ P . In T φ every node is labeled by a set B of at most k variables of V . Additionally, every leaf node has a second label, which is either Yes or No. T φ is defined inductively as follows. The root of T φ is labeled by the empty set. Furthermore, if t is a node of T φ , whose first label is B, then the children of t in T φ are obtained as follows. If there is an assignment τ : B → D such that I[τ ] is closed under φ and I[τ ] has a solution , then B is a weak P -backdoor set of size at most k, and hence t becomes a leaf node, whose second label is Yes. Otherwise, i.e., for every assignment τ : B → D either I[τ ] is not closed under φ or I[τ ] has no solution, we consider two cases: (1) |B| = k, then t becomes a leaf node, whose second label is No, and (2) |B| < k, then for every assignment τ : B → D t has the following children: for every every variable v in the scope of some constraint c ∈ I[τ ] that is not closed under φ, t has a child whose first label is If there is a φ ∈ P such T φ has a leaf node, whose second label is Yes, then the algorithm returns the first label of that leaf node. Otherwise the algorithm returns No. This completes the description of the algorithm.
We now show the correctness of the algorithm. First, suppose there is a φ ∈ P such that the search tree T φ built by the algorithm has a leaf node t whose second label is Yes. Here, the algorithm returns the first label, say B of t. By the construction of T φ , we obtain that |B| ≤ k and there is an assignment τ : B → D such that I[τ ] is closed φ and I[τ ] has a solution, as required. Now consider the case where the algorithm returns No. We need to show that there is no weak P -backdoor set of size at most k for I. Assume, for the sake of contradiction that such a set B exists. Because B is a weak P -backdoor set for I there must exist an operation φ ∈ P and an assignment τ : B → D such that I[τ ] is closed under φ and I[τ ] has a solution.
Observe that if T φ has a leaf node t whose first label is a set B ′ with B ′ ⊆ B, then the second label of t must be Yes. This is because, either |B ′ | < k in which case the second label of t must be Yes, or |B ′ | = k in which case B ′ = B and by the definition of B it follows that the second label of t must be Yes.
It hence remains to show that T φ has a leaf node whose first label is a set B ′ with B ′ ⊆ B. This will complete the proof about the correctness of the algorithm. We will show a slightly stronger statement, namely, that for every natural number ℓ, either T φ has a leaf whose first label is contained in B or T φ has an inner node of distance exactly ℓ from the root whose first label is contained in B. We show the latter by induction on ℓ.
The claim obviously holds for ℓ = 0. So assume that T φ contains a node t at distance ℓ from the root of T φ whose first label, say B ′ , is a subset of B. If t is a leaf node of T φ , then the claim is shown. Otherwise, for every assignment τ : B ′ → D either I[τ ] is not closed under φ or I[τ ] has no solution. Let τ ′ : B ′ → D be the restriction of τ to B ′ . Because I[τ ] and hence also I[τ ′ ] has a solution, we obtain that I[τ ′ ] is not closed under the operation φ. By the definition of the search tree T φ , it holds that t has a child t ′ whose first label is B ′ ∪ {v}, for every variable v in the scope of some constraint c ∈ I[τ ′ ] that is not closed under φ. We claim that V (c) ∩ B = ∅ and hence t has a child, whose first label is a subset of B, as required. Indeed, suppose not. Then c ∈ I[τ ] a contradiction to our assumption that I[τ ] is closed under φ. This concludes our proof concerning the correctness of the algorithm.
The running time of the algorithm is obtained as follows. Let T φ be a search tree obtained by the algorithm. Then the running time of the depth-bounded search tree algorithm is O(|V (T φ )|) times the maximum time that is spent on any node of T φ . Since the number of children of any node of T φ is bounded by |D| k δ(I) (recall that δ(I) denotes the maximum arity of any constraint of I) and the longest path from the root of T φ to some leaf of T φ is bounded by k + 1, we obtain that |V (T φ )| ≤ O((|D| k δ(I)) k+1 ). Furthermore, the time required for any node t of T is at most , φ), because φ is a c P -ary tractable polymorphism. Now, the total running time required by the algorithm is the time required to compute the set P plus the time required to compute T φ for every φ ∈ P . Putting everything together, we obtain O(|P |(|D| k δ(I)) k+1 |D| k n O(1) ) = O(|P |(|D| k δ(I)) k+1 n O(1) ) = O(|D| |D| c P (|D| k δ(I)) k+2 n O(1) ), as the total running time of the algorithm, where n denotes the input size of the CSP instance. This shows that Weak C P -Backdoor Detection is fixed-parameter tractable parameterized by k, δ(I), and |D|.
Because of Proposition 1, we obtain the following.

Hardness of Backdoor Detection for CSP
In this section we show our parameterized hardness results for Strong C P -Backdoor Detection and Weak C P -Backdoor Detection. In particular, we show that Strong C P -Backdoor Detection and Weak C P -Backdoor Detection are W[2]-hard parameterized by the size of the backdoor set even for CSP instances of Boolean domain and for CSP instances with arity two. We start by showing hardness for CSP instances with Boolean domain.
Theorem 12. Let P be a tractable polymorphism property such that all operations φ with P(φ) are idempotent. Then, Strong C P -Backdoor Detection and Weak C P -Backdoor Detection are W[2]-hard parameterized by the size of the backdoor set, even for CSP instances over the Boolean domain.
Proof. We start by introducing what we call "Boolean barriers" of operations since they form the basis of the proof. Let φ : D n → D be an n-ary operation over D. We say a set λ of r(λ)-ary tuples over {0, 1} is a Boolean barrier for φ if there is a sequence t 1 , . . . , t n of (not necessarily distinct) tuples in λ such that φ(t 1 , . . . , t n ) / ∈ λ. We call a Boolean barrier λ of φ minimal if |λ| is minimal over all Boolean barriers of φ. For an operation φ, we denote by λ(φ) a minimal Boolean barrier of φ. For our reduction below, we will employ the fact that every operation φ with P(φ) has a non-empty Boolean barrier of finite size. The reason that a Boolean barrier must exist is simply because φ is tractable and if φ would not have a Boolean barrier then every Boolean CSP instance would be closed under φ and thus tractable, which unless P = NP is not possible. To see that λ(φ) is finite first note that |λ(φ)| is at most as large as the arity c P of φ. Moreover, r(λ) ≤ 2 c P because there are at most 2 c P distinct c P -ary tuples over {0, 1}. Hence the size of λ(φ) is at most c P · 2 c P .
We show the theorem via an fpt-reduction from Hitting Set. Given an instance (Q, U, k) of Hitting Set, we construct a CSP instance I = V, {0, 1}, C such that Q has a hitting set of size at most k if and only if I has a strong C P -backdoor set of size at most k. Let Λ be the set of all Boolean barriers of polymorphisms with property P, i.e., Λ = { λ(φ) : φ has property P }. Note that the cardinality of Λ only depends on c P and can thus be considered to be finite. The variables of I are 1 (λ, Q), . . . , o r(λ) (λ, Q) : λ ∈ Λ and Q ∈ Q }. Furthermore, for every Boolean barrier λ ∈ Λ with λ = {t 1 , . . . , t n } for some natural number n, and Q ∈ Q with Q = {u 1 , . . . , u |Q| }, C contains a constraint R(λ, Q) with scope o 1 (λ, Q), . . . , o r(λ) (λ, Q), x u1 , . . . , x u |Q| whose relation contains the row t i [1], . . . , t i [r(λ)], i mod 2, . . . , i mod 2 |Q|times for every i in 1 ≤ i ≤ n. This completes the construction of I. Observe that I is satisfiable, because the first rows of every constraint of I are pairwise compatible. In particular, set all the variables of the form {x u : u ∈ U } to zero, and set all remaining variables according to their first-row constraints -note that these rows are the same for different Q = Q ′ associated with the same Boolean barrier λ, while on the other hand, for different Boolean barriers λ = λ ′ , the associated variables are different and there is no cause for conflict. Suppose that Q has a hitting set B of size at most k. We claim that B u = { x u : u ∈ B } is a strong C P -backdoor set of I. Let τ : B u → D be an assignment of the variables in B and λ ∈ Λ be a Boolean barrier of maximum cardinality over all Boolean barriers in Λ. We claim that I[τ ] is closed under any operation φ with property P with λ = λ(phi) and hence B u is a strong C P -backdoor set of I. Because B is a hitting set of Q, it follows that every relation of I[τ ] contains at most half of the tuples of the corresponding relation in I. Furthermore, because φ is idempotent (and hence every tuple is mapped to itself), it holds that |lambda ′ | > 1 for every λ ′ ∈ Λ. It follows that every relation of I[τ ] contains at least one tuple less than the corresponding relation in I. Because of the choice of λ, we obtain that every constraint c ∈ C[τ ] contains less than |λ| tuples, and hence I[τ ] is closed under any operation φ with property P and λ = λ(φ). Hence, B u = { x u : u ∈ B } is a strong C P -backdoor set of I, as required. Towards showing that B u is also a weak C P -backdoor set of I consider the assignment τ : B u → {0}. It follows from the above argumentation that C[τ ] is closed under any operation φ with property P and λ = λ(φ). Furthermore, I[τ ] is satisfiable, because the first row of every constraint in C is also contained in every constraint of I[τ ] and these rows are pairwise compatible. For the reverse direction, suppose that I has a strong C P -backdoor set B of size at most k. Because for every Q ∈ Q it holds that the set of constraints { R(λ, Q) : λ ∈ Λ } is not closed under any operation φ with property P, we obtain that B has to contain at least one variable from λ∈Λ V (R(λ, Q)) for every Q ∈ Q. Since the only variables that are shared between λ∈Λ V (R(λ, Q)) and λ∈Λ V (R(λ, Q ′ )) for distinct Q, Q ′ ∈ Q are the variables in { x u : u ∈ U }, it follows that Q has a hitting set of size at most |B| ≤ k, as required.
Because all min/max, majority, minority and Mal'cev operations can be defined via tractable properties and are idempotent, we obtain. In the following we show that hardness also holds if we drop the restriction on the domain of the CSP instance but instead consider only CSP instances of arity 2. To do so we need the following lemma. Proof. The proof of this lemma is inspired by the proof of [4, Lemma 3]. For every C as in the statement of the lemma, I(C, k) has variables v 1 , . . . , v 2k and contains a constraint c i with scope v 2i−1 , v 2i for every 1 ≤ i ≤ k.
If C = MINMAX, the domain of I(C, k) is {1, . . . , k + 1}, and for every 1 ≤ i ≤ k the relations R(c i ) are defined as follows: R i = {(0, 0), (i, i + 1), (i + 1, i), (i + 1, i + 1)} for every 1 ≤ i < k and R k = {(0, 0), (1, k + 1), (k + 1, 1), (1, 1)}. Clearly, the instance is binary and every relation contains the all 0 tuple. Let φ be a max operation (the proof remains the same if φ is a min operation). Then, for every 1 ≤ i < k, the relation R i implies i < i + 1, but the relation R k implies 1 > k + 1, a contradiction. Hence, the set of all relations R 1 , . . . , R k is not closed under any max operation. On the other hand, for any assignment τ that sets at least 1 variable of I(C, k), it holds that at least one relation of I(C, k)[τ ] contains at most 2 tuples that agree on (at least) one coordinate. This relation is then closed under any max operation and breaks the above chain of implications.
We construct a CSP instance I = V, D, C of arity 2 such that H has a hitting set of size at most k if and only if I has a strong C-backdoor set of size at most k. The variables of I are { x u : u ∈ U } ∪ { y i F : F ∈ F and 1 ≤ i ≤ |F | }. Furthermore, for every F ∈ F with F = {u 1 , . . . , u |F | }, let I(F ) be the CSP instance obtained from I(C, |F |) (see Lemma 1), where for every i with 1 ≤ i ≤ |F |, we replace the scope of the constraint c i with x ui , y i F and adapt I(C, |F |) in such a way that for distinct F, F ′ ∈ F , I(C, |F |) and I(C, |F ′ |) have no common domain value. Then, the constraints of I is the union of the constraints of I(F ) over every F ∈ F . This completes the construction of I. Clearly, I has arity 2 and is satisfiable, e.g., by the all 0 assignment.
Suppose that H has a hitting set B of size at most k. We claim that B u = { x u : u ∈ B } is a strong C-backdoor set of I. We start by showing that B u is a strong C-backdoor set of I. Let τ : B u → D be an assignment of the variables in B. Then, it follows from Lemma 1 that the constraints of I(F )[τ ] are in C. In particular, there is an operation φ (which is either min, max, majority, minority or Mal'cev, depending on C) such that the constraints of I(F )[τ ] are closed under φ. Because for every distinct F, F ′ ∈ F , I(F )[τ ] and I(F ′ )[τ ] do not have a common domain value, it follows that there is an operation (which is a combination of the operations for each I(F )[τ ])) such that I[τ ] is closed under φ and φ is a min/max, majority, minority, or Mal'cev operation (depending on C). Hence, I[τ ] ∈ C, as required. Towards showing that B u is also a weak C-backdoor set of C consider the assignment τ : B u → {0}. It follows from the above argumentation that I[τ ] ∈ C. Furthermore, I[τ ] is satisfiable, because every constraint of I[τ ] still contains the all 0 tuple. For the reverse direction, suppose that I has a strong C-backdoor set B of size at most k. Because for every F ∈ F it holds that the set of constraints of I(F ) is not in C, we obtain that B has to contain at least 1 variable from V (I(F )) for every F ∈ F . Since the only variables that are shared between V (I(F )) and V (I(F ′ )) for distinct F, F ′ ∈ F are the variables in { x u : u ∈ U }, it follows that H has a hitting set of size at most |B| ≤ k, as required.

Comparison to Partition-Backdoors
In this section we draw a comparison between our notion of backdoor sets, and the approach recently introduced by Bessiere et al. (2013), which we will call the partition backdoor set approach. The main difference is that the partition backdoor set approach considers a backdoor with respect to a subset of constraints that is tractable (because it is closed under some tractable polymorphism). In particular, Bessiere et al. (2013) define partition backdoor sets as follows.
Definition 1. Let P be a tractable polymorphism property. A P-partition backdoor of a CSP instance I = V, D, C is a set B of variables, such that there is a partition of C into C 1 and C 2 for which the following holds: • V, D, C 2 ∈ C P , and • If P is characterized using only idempotent polymorphisms, then B is the set of all variables in the scope of the constraints of C 2 , while if P is characterized using only conservative polymorphisms, then the variables of B are a vertex cover of the primal graph of C 1 .
Note that the primal graph of a set C of constraints is the graph, whose vertices are all the variables appearing in the scope of the constraints in C and that has an edge between two variables if and only if they appear together in the scope of at least one constraint in C. Bessiere et al. (2013) show that given a CSP instance and a partition (C 1 , C 2 ) as defined above, then the detection and evaluation of P-partition backdoor sets are fixed-parameter tractable • in the size of the domain and the number of variables in C 1 , if P is characterized using only idempotent polymorphisms; • in the size of the domain and the vertex cover of the primal graph of C 1 , if P is characterized using only conservative polymorphisms.
Observe that the above tractability results only hold when the partition (C 1 , C 2 ) is given as a part of the input, if it is not then the detection of partition backdoors is fixed-parameter intractable (for most combinations of parameters). Apart from the complexity of detecting and evaluating backdoors it is also important that the backdoor sets are as small as possible over a wide variety of CSP instances. In the following we will observe that our backdoor sets are always at most as large as partition backdoors and we exhibit CSP instances where our backdoors have size one but the size of a smallest partition backdoor set can be arbitrary large.
Proposition 2. Let P be a tractable polymorphism property. Then, for every CSP instance I the size of a smallest strong P-backdoor set of I is at most the size of a smallest P-partition backdoor set of I.
Proof. This follows from the observation that any P-partition backdoor set is also a strong P-backdoor set.
Proposition 3. For any tractable property P and any natural number n , there is a CSP instance that has a strong/weak C P -backdoor set of size one, but the size of a smallest P-partition backdoor set is Ω(n).
Proof. Let P be a tractable property and let I = V, D, C be a CSP instance such that: • no constraint of I is closed under a polymorphism with property P; • all constraints of I share a common variable, say x, such that for any assignment τ of x, the CSP instance I[τ ] is closed under some polymorphisms with property P.
It is straightforward to check that for any number of variables n, such a CSP instance using n variables can be easily constructed for every tractable property P that contains at least one operation. Furthermore, the variable x is a strong C P -backdoor set of I. However, because no constraint of I is closed under any operation from P it follows that every partition backdoor has to contain at least all but 1 variable from every constraint of I.