Arc Consistency and Friends
aa r X i v : . [ c s . A I] A p r Arc Consistency and Friends
Hubie Chen ∗ , Victor Dalmau † , Berit Grußien ‡ May 15, 2018
Abstract
A natural and established way to restrict the constraint satisfaction problem is to fix the relationsthat can be used to pose constraints; such a family of relations is called a constraint language . In thisarticle, we study arc consistency, a heavily investigated inference method, and three extensions thereoffrom the perspective of constraint languages. We conduct a comparison of the studied methods on thebasis of which constraint languages they solve, and we present new polynomial-time tractability resultsfor singleton arc consistency, the most powerful method studied.
The constraint satisfaction problem (CSP) involves deciding, given a set of variables and a set of constraints on thevariables, whether or not there is an assignment to the variables satisfying all of the constraints. Cases of the constraintsatisfaction problem appear in many fields of study, including artificial intelligence, spatial and temporal reasoning,logic, combinatorics, and algebra. Indeed, the constraint satisfaction problem is flexible in that it admits a number ofequivalent formulations. In this paper, we work with the formulation as the relational homomorphism problem: giventwo similar relational structures A and B , does there exist a homomorphism from A to B ? In this formulation, onecan view each relation of A as containing variable tuples that are constrained together, and the corresponding relationof B as containing the permissible values for the variable tuples [18].The constraint satisfaction problem is in general NP-hard; this general intractability has motivated the study ofrestricted versions of the CSP that have various desirable complexity and algorithmic properties. A natural and well-studied way to restrict the CSP is to fix the value relations that can be used to pose constraints; in the homomorphismformulation, this corresponds to fixing the right-hand side structure B , which is also known as the constraint lan-guage . Each structure B then gives rise to a problem CSP ( B ) , and one obtains a rich family of problems that includeboolean satisfiability problems, graph homomorphism problems, and satisfiability problems on algebraic equations.One of the primary current research threads involving such problems is to understand for which finite-universe con-straint languages B the problem CSP ( B ) is polynomial-time tractable [9]; there is also work on characterizing thelanguages B for which the problem CSP ( B ) is contained in lower complexity classes such as L (logarithmic space)and NL (non-deterministic logarithmic space) [13, 21]. With such aims providing motivation, there have been effortsto characterize the languages amenable to solution by certain algorithmic techniques, notably, representing solutionspaces by generating sets [19] and consistency methods [22, 2, 6], which we now turn to discuss.Checking for consistency is a primary reasoning technique for the practical solution of the CSP, and has beenstudied theoretically from many viewpoints [22, 2, 4, 1, 3, 6, 5]. The most basic and simplest form of consistency is arc consistency , which algorithmically involves performing inferences concerning the set of feasible values for eachvariable. The question of how to efficiently implement an arc consistency check has been studied intensely, and highly ∗ Chen is supported by the Spanish program “Ramon y Cajal”. † Both Chen and Dalmau are supported by MICINN grant TIN2010-20967-C04-02. ‡ Work by Grußien was supported by the Deutsche Forschungsgemeinschaft (DFG) within the research training group ”Methods for DiscreteStructures” (GrK 1408). unit propagation , a consistency method that can be viewed as arc consistency specialized to SAT formulas,is well-known to decide the Horn-SAT problem in this sense.
In this paper, we study arc consistency and three natural extensions thereof from the perspective of constraint lan-guages. The extensions of AC that we study are look-ahead arc consistency (LAAC) [12]; peek arc consistency(PAC) [8], and singleton arc consistency (SAC) [16, 7]. Each of these algorithms is natural, conceptually simple, read-ily understandable, and easily implementable using arc consistency as a black box. Tractability results for constraintlanguages have been presented for AC by Feder and Vardi [18] (for instance); and for LAAC and PAC in the previouslycited work. In fact, for each of these three algorithms, characterizations of the class of tractable languages have beengiven, as we discuss in the paper.We give a uniform presentation of these algorithms (Section 3), and conduct a comparison of these algorithms onthe basis of which languages they solve (Section 4). Our comparison shows, roughly, that the algorithms can be placedinto a hierarchy: solvability of a language by AC or LAAC implies solvability by PAC; solvability by PAC in turnimplies solvability by SAC (see Section 4 for precise statements). We also study the strictness of the containmentsshown. We thus contribute to a basic, foundational understanding of the scope of these algorithms and of the situationsin which these algorithms can be demonstrated to be effective.We then present new tractability results for singleton arc consistency (Section 5). We prove that languages havingcertain types of can be solved by singleton arc consistency; and, we prove that any lan-guage having a majority polymorphism is solvable by singleton arc consistency. The presence of a majority polymor-phism is a robust and well-studied condition: majority polymorphisms were used to give some of the initial languagetractability results, are known to exactly characterize the languages such that implies global consistency (we refer to [20] for definitions and more details), and gave one of the first large classes of languages whose constraintsatisfaction problem could be placed in non-deterministic logarithmic space [14]. While the languages that we studyare already known to be polynomial-time tractable [20, 10], from the standpoint of understanding the complexity andalgorithmic properties of constraint languages, we believe our tractability results to be particularly attractive for acouple of reasons. First, relative to a fixed language, singleton arc consistency runs in quadratic time [7], constitutinga highly non-trivial running time improvement over the cubic time bound that was previously known for the studiedlanguages. Also, in showing that these languages are amenable to solution by singleton arc consistency, we demon-strate their polynomial-time tractability in an alternative fashion via an algorithm that is different from the previouslyused ones; the techniques that we employ expose a different type of structure in the studied constraint languages.
Our definitions and notation are fairly standard. For an integer k ≥ , we use the notation [ k ] to denote the setcontaining the first k positive integers, that is, the set { , . . . , k } . Structures. A tuple over a set B is an element of B k for a value k ≥ called the arity of the tuple; when t is a tuple,we often use the notation t = ( t , . . . , t k ) to denote its entries. A relation over a set B is a subset of B k for a value k ≥ called the arity of the relation. We use π i to denote the operator that projects onto the i th coordinate: π i ( t ) denotes the i th entry t i of a tuple t = ( t , . . . , t k ) , and for a relation R we define π i ( R ) = { π i ( t ) | t ∈ R } . Similarly,for a subset I ⊆ [ k ] whose elements are i < · · · < i m , we use π I ( t ) to denote the tuple ( t i , . . . , t i m ) , and we define π I ( R ) = { π I ( t ) | t ∈ R } . 2 signature σ is a set of symbols, each of which has an associated arity. A structure B over signature σ consistsof a universe B , which is a set, and a relation R B ⊆ B k for each symbol R ∈ σ of arity k . (Note that in this paper,we are concerned only with relational structures, which we refer to simply as structures.) Throughout, we will use thebold capital letters A , B , . . . to denote structures, and the corresponding non-bold capital letters A, B, . . . to denotetheir universes. We say that a structure B is finite if its universe B has finite size. Unless stated otherwise, we assumeall structures under discussion in this paper to be finite. We say that a structure B has all constants if for each b ∈ B ,there is a relation symbol R b with R B b = { ( b ) } .When two structures A and B are defined over the same signature σ , we say that they are similar . We define thefollowing notions on similar structures. For similar structures A and B over a signature σ , we say that A is an inducedsubstructure of B if A ⊆ B and for every R ∈ σ of arity k , it holds that R A = A k ∩ R B . Observe that for a structure B and a subset B ′ ⊆ B , there is exactly one induced substructure of B with universe B ′ . For similar structures A and B over a signature σ , the product structure A × B is defined to be the structure with universe A × B and suchthat R A × B = { (( a , b ) , . . . , ( a k , b k )) | a ∈ R A , b ∈ R B } for all R ∈ σ . We use A n to denote the n -fold product A × · · · × A .We say that a structure B over signature σ ′ is an expansion of another structure A over signature σ if (1) σ ′ ⊇ σ ,(2) the universe of B is equal to the universe of A , and (3) for every symbol R ∈ σ , it holds that R B = R A . Wewill use the following non-standard notation. For any structure A (over signature σ ) and any subset S ⊆ A , we define [ A , S ] to be the expansion of A with the signature σ ∪{ U } where U is a new symbol of arity , defined by U [ A ,S ] = S and R [ A ,S ] = R A for all R ∈ σ . More generally, for a structure A (over σ ) and a sequence of subsets S , . . . , S n ⊆ A ,we define [ A , S , . . . , S n ] to be the expansion of A with the signature σ ∪ { U , . . . , U n } where U , . . . , U n are newsymbols of arity , defined by U [ A ,S ,...,S n ] i = S i for all i ∈ [ n ] , and R [ A ,S ,...,S n ] = R A for all R ∈ σ . Homomorphisms and the constraint satisfaction problem.
For similar structures A and B over the signature σ , a homomorphism from A to B is a mapping h : A → B such that for every symbol R of σ and every tuple ( a , . . . , a k ) ∈ R A , it holds that ( h ( a ) , . . . , h ( a k )) ∈ R B . We use A → B to indicate that there is a homomorphismfrom A to B ; when this holds, we also say that A is homomorphic to B . It is well-known and straightforward to verifythat the homomorphism relation → is transitive, that is, if A → B and B → C , then A → C .The constraint satisfaction problem (CSP) is the problem of deciding, given as input a pair ( A , B ) of similarstructures, whether or not there exists a homomorphism from A to B . When ( A , B ) is an instance of the CSP, wewill also call a homomorphism from A to B a satisfying assignment ; say that the instance is satisfiable if there existssuch a homomorphism; and, say that the instance is unsatisfiable if there does not exist such a homomorphism. Wegenerally assume that in an instance of the CSP, the left-hand side structure A contains finitely many tuples. Forany structure B (over σ ), the constraint satisfaction problem for B , denoted by CSP ( B ) , is the constraint satisfactionproblem where the right-hand side structure is fixed to be B , that is, the problem of deciding, given as input a structure A over σ , whether or not there exists a homomorphism from A to B . In discussing a problem of the form CSP ( B ) ,the structure B is often referred to as the template or constraint language . There are several equivalent definitions ofthe constraint satisfaction problem. For instance, in logic, the constraint satisfaction problem can be formulated as themodel checking problem for primitive positive sentences over relational structures, and in database theory, it can beformulated as the containment problem for conjunctive queries [11]. Polymorphisms.
When f : B n → B is an operation on B and t = ( t , . . . , t k ) , . . . , t n = ( t n , . . . , t nk ) ∈ B k are tuples of the same arity k over B , we use f ( t , . . . , t n ) to denote the arity k tuple obtained by applying f coordi-natewise, that is, f ( t , . . . , t n ) = ( f ( t , . . . , t n ) , . . . , f ( t k , . . . , t nk )) . An operation f : B n → B is a polymorphism of a structure B over σ if for every symbol R ∈ σ and any tuples t , . . . , t n ∈ R B , it holds that f ( t , . . . , t n ) ∈ R B . That is, each relation R B is closed under the action of f .Equivalently, an operation f : B n → B is a polymorphism of B if it is a homomorphism from B n to B .3 Algorithms
In this section, we give a uniform presentation of the four algorithms under investigation in this paper: arc consistency,look-ahead arc consistency, peek arc consistency, and singleton arc consistency, presented in Sections 3.1, 3.2, 3.3,and 3.4, respectively. The results on the first three algorithms come from previous work, as we discuss in presentingeach of these algorithms; for singleton arc consistency, we here develop results similar to those given for the otheralgorithms.Our treatment of arc consistency, peek arc consistency, and singleton arc consistency is uniform: for each of thesealgorithms, we present a homomorphism-based consistency condition, we show that the algorithm checks preciselythis consistency condition, and we give an algebraic condition describing the structures B such that the algorithmsolves CSP ( B ) . These three algorithms give one-sided consistency checks: each either correctly rejects an instanceas unsatisfiable or outputs “?”, which can be interpreted as a report that it is unknown whether or not the instance issatisfiable. The other algorithm, look-ahead arc consistency, has a somewhat different character. It attempts to build asatisfying assignment one variable at a time, using arc consistency as a filtering criterion; it either returns a satisfyingassignment, or outputs “?”.Throughout this section and in later sections, we will make use of a structure ℘ ( B ) that is defined for every structure B , as follows [18, 15]. For a structure B (over σ ), we define ℘ ( B ) to be the structure with universe ℘ ( B ) \ {∅} andwhere, for every symbol R ∈ σ of arity k , R ℘ ( B ) = { ( π S, . . . , π k S ) | S ⊆ R B , S = ∅} . Here, ℘ ( B ) denotes thepower set of the set B . We now present the arc consistency algorithm. The main idea of the algorithm is to associate to each element a ∈ A aset S a of values which, throughout the execution of the algorithm, has the property that for any solution h , it must holdthat h ( a ) ∈ S a . The algorithm continually shrinks the sets S a in a natural fashion until they stabilize; at this point, ifsome set S a is the empty set, then no solution can exist, and the algorithm rejects the instance. Arc ConsistencyInput : a pair ( A , B ) of similar structures forall a ∈ A do set S a := B ; repeatforall relations R A of A doforall tuples ( a , . . . , a k ) ∈ R A doforall i ∈ [ k ] do set S a i := π i ( R B ∩ ( S a × . . . × S a k )) ; until no set S a is changed ; if there exists a ∈ A such that S a = ∅ then reject ; else return “?”;Feder and Vardi [18] have studied arc consistency, under an equivalent formulation in terms of Datalog Programs,for constraint languages. The results in this section are due to this reference. The connection of the results in Federand Vardi with arc consistency was made explicit in Dalmau and Pearson [15]. Definition 1
An instance ( A , B ) has the arc consistency condition (ACC) if there exists a homomorphism from A to ℘ ( B ) . Proposition 2
The arc consistency algorithm does not reject an instance ( A , B ) if and only if the instance has theACC. Definition 3
Let B be a structure. We say that arc consistency solves CSP ( B ) if for all structures A , the followingholds: ( A , B ) has the ACC implies that there is a homomorphism A → B . h is a homomorphism from A to B , then the mapping sending each a ∈ A to the set { h ( a ) } is a homomorphism from A to ℘ ( B ) . Theorem 4
Let B be a structure. Arc consistency solves CSP ( B ) if and only if there is a homomorphism ℘ ( B ) → B . We now present the look-ahead arc consistency algorithm. It attempts to construct a satisfying assignment by settingone variable at a time, using arc consistency as a filter to find a suitable value for each variable.
Look-Ahead Arc ConsistencyInput : a pair ( A , B ) of similar structures forall a ∈ A do set S a := B ; for i = 1 to | A | do pick arbitrary a i ∈ A with a i
6∈ { a , . . . , a i − } ; forall b ∈ B doif Arc Consistency ([ A , { a } , . . . , { a i − } , { a i } ] , [ B , { b } , . . . , { b i − } , { b } ]) rejects then remove b from S a i ; if S a i = ∅ then return “?”; else choose b i ∈ S a i arbitrarily; accept ;Look-ahead arc consistency was introduced and studied by Chen and Dalmau [12], and the theorem that followsis due to them. This algorithm can be viewed as a generalization of an algorithm for SAT studied by Del Val [17]. Definition 5
Let B be a structure. We say that look-ahead arc consistency solves CSP ( B ) if for all structures A ,the following holds: if there exists a homomorphism A → B , then the look-ahead arc consistency algorithm, given ( A , B ) , outputs such a homomorphism. Theorem 6
Let B be a structure. Look-ahead arc consistency solves CSP ( B ) if and only if there is a homomorphism l : ℘ ( B ) × B → B such that l ( { b } , b ′ ) = b for all b, b ′ ∈ B . We now present the peek arc consistency algorithm. It attempts to find, for each variable a ∈ A , a value b ∈ B suchthat when a is set to b , the arc consistency check is passed. Peek Arc ConsistencyInput : a pair ( A , B ) of similar structures forall a ∈ A do set S a := B ; forall a ∈ A, b ∈ B doif Arc Consistency ([ A , { a } ] , [ B , { b } ]) rejects then remove b from S a ; if there exists a ∈ A such that S a = ∅ then reject ; else return “?”;Peek arc consistency was introduced and studied by Bodirsky and Chen [8]; the notions and results that followcome from them. In their work, the algorithm is shown to solve certain constraint languages, including some languageshaving infinite-size universes; such languages actually gave the motivation for introducing the algorithm. In thiswork, it is pointed out that peek arc consistency can be readily parallelized; by invoking the arc consistency checksindependently in parallel, one can achieve a linear parallel running time.5 efinition 7 An instance ( A , B ) has the peek arc consistency condition (PACC) if for every element a ∈ A , thereexists a homomorphism h from A to ℘ ( B ) such that h ( a ) is a singleton. Proposition 8
The peek arc consistency algorithm does not reject an instance ( A , B ) if and only if the instance hasthe PACC. Definition 9
Let B be a structure. We say that peek arc consistency solves CSP ( B ) if for all structures A , thefollowing holds: ( A , B ) has the PACC implies that there is a homomorphism A → B . The converse of the condition given in this definition always holds. Suppose that h is a homomorphism from A to B ; then, the mapping taking each a ∈ A to the singleton { h ( a ) } is a homomorphism from A to ℘ ( B ) and hence ( A , B ) has the PACC.We use the notation Sing ( ℘ ( B ) n ) to denote the induced substructure of ℘ ( B ) n whose universe contains an n -tupleof ℘ ( B ) n if and only if at least one coordinate of the tuple is a singleton. Theorem 10
Let B be a structure. Peek arc consistency solves CSP ( B ) if and only if for all n ≥ there is ahomomorphism Sing ( ℘ ( B ) n ) → B . We now present the singleton arc consistency algorithm. As with arc consistency, this algorithm associates to eachelement a ∈ A a set S a of feasible values. It then continually checks, for pairs ( a, b ) with a ∈ A and b ∈ S a , whetheror not arc consistency can be established with respect to the sets S a and when a is assigned to b ; if for some pair ( a, b ) it cannot, then b is removed from the set S a . As with arc consistency, this algorithm’s outer loop runs until the sets S a stabilize, and the algorithm rejects if one of the sets S a is equal to the empty set. Singleton Arc ConsistencyInput : a pair ( A , B ) of similar structures forall a ∈ A do set S a := B ;denote A = { a , . . . , a n } ; repeatforall a ∈ A, b ∈ S a doif Arc Consistency ([ A , { a } , . . . , { a n } , { a } ] , [ B , S a , . . . , S a n , { b } ]) rejects then remove b from S a ; until no set S a is changed ; if there exists a ∈ A such that S a = ∅ then reject ; else return “?”;Singleton arc consistency was introduced by Debruyne and Bessiere [16]. We now give a development of singletonarc consistency analogous to that of arc consistency and peek arc consistency. Definition 11
An instance ( A , B ) has the singleton arc consistency condition (SACC) if there exists a mapping s : A → ℘ ( B ) \ {∅} such that for all a ∈ A , b ∈ s ( a ) there exists a homomorphism h a,b : A → ℘ ( B ) where: • h a,b ( a ) = { b } , and • for all a ′ ∈ A , it holds that h a,b ( a ′ ) ⊆ s ( a ′ ) . Proposition 12
The singleton arc consistency algorithm does not reject an instance ( A , B ) if and only if the instancehas the SACC. Proof . Suppose that the singleton arc consistency algorithm does not reject an instance ( A , B ) . Let { S a } a ∈ A denotethe sets computed by the algorithm at the point of termination, and define s to be the mapping where s ( a ) = S a a ∈ A . Let a ∈ A and b ∈ s ( a ) . By the definition of the algorithm, the pair ([ A , { a } , . . . , { a n } , { a } ] , [ B , S a , . . . , S a n , { b } ]) has the ACC, and thus the desired homomorphism h a,b exists.Now, suppose that the instance ( A , B ) has the SACC, and let s be a mapping with the described properties. Weshow that throughout the execution of the algorithm, it holds that s ( a ) ⊆ S a for all a ∈ A . First, S a is initial-ized with B for every a ∈ A . Next, we show that when a ∈ A and b ∈ s ( a ) , then b is never removed from S a by the algorithm. This is because by definition of SACC, there exists a homomorphism h a,b : A → ℘ ( B ) with h a,b ( a ) = { b } such that for all a ′ ∈ A , it holds that h a,b ( a ′ ) ⊆ s ( a ′ ) . Since s ( a ′ ) ⊆ S a ′ by the inductive assumption, ([ A , { a } , . . . , { a n } , { a } ] , [ B , S a , . . . , S a n , { b } ]) has the ACC and hence the algorithm does not remove b from S a . (cid:3) Definition 13
Let B be a structure. We say that singleton arc consistency solves CSP ( B ) if for all structures A , thefollowing holds: ( A , B ) has the SACC implies that there is a homomorphism A → B . The converse of the condition given in this definition always holds: suppose that h is a homomorphism from A to B . Then, the instance ( A , B ) has the SACC via the mapping s where s ( a ) = { h ( a ) } for all a ∈ A and the mappings h a,b defined by h a,b ( a ′ ) = { h ( a ′ ) } for all a ′ ∈ A .We use the notation UnionSing ( ℘ ( B ) n ) to denote the induced substructure of ℘ ( B ) n whose universe contains an n -tuple ( S , . . . , S n ) of ℘ ( B ) n if and only if it holds that S i ∈ [ n ] S i = S i ∈ [ n ] , | S i | =1 S i . Theorem 14
Let B be a structure. Singleton arc consistency solves CSP ( B ) if and only if for all n ≥ there is ahomomorphism UnionSing ( ℘ ( B ) n ) → B . Proof . First we show that if singleton arc consistency solves
CSP ( B ) , then there is a homomorphism from UnionSing ( ℘ ( B ) n ) to B for all n ≥ . Let n ≥ ; we show that ( UnionSing ( ℘ ( B ) n ) , B ) has the SACC. Then, thereis a homomorphism from UnionSing ( ℘ ( B ) n ) to B , since the singleton arc consistency algorithm solves CSP( B ).Let s be the mapping s ( a ) := S i ∈ [ n ] S i for all tuples a = ( S , . . . , S n ) of UnionSing ( ℘ ( B ) n ) . Now let usconsider an arbitrary tuple a = ( S , . . . , S n ) of UnionSing ( ℘ ( B ) n ) and an arbitrary b ∈ s ( a ) . Since S i ∈ [ n ] S i = S i ∈ [ n ] , | S i | =1 S i , there is an i ∈ [ n ] such that { b } = S i . Thus, the homomorphism π i : UnionSing ( ℘ ( B ) n ) → ℘ ( B ) that projects onto the i th coordinate satisfies π i ( a ) = { b } , and for all tuples a ′ of UnionSing ( ℘ ( B ) n ) , it holds that π i ( a ′ ) ⊆ s ( a ′ ) . Hence, ( UnionSing ( ℘ ( B ) n ) , B ) has the SACC.For the other direction, we show that if there is a homomorphism from UnionSing ( ℘ ( B ) n ) to B for all n ≥ , thensingleton arc consistency solves CSP ( B ) . Thus, we have to show that there exists a homomorphism from A to B if ( A , B ) has the SACC. Let s be the homomorphism from the definition of SACC, and let us use { h , . . . , h n } to denotethe set { h a,b | a ∈ A, b ∈ s ( a ) } of homomorphisms. Further, let g be the homomorphism ( h , . . . , h n ) : A → ℘ ( B ) n .Now, for every element a ∈ A the image g ( a ) = ( h ( a ) , . . . , h n ( a )) is a tuple of UnionSing ( ℘ ( B ) n ) : for every b ∈ S j ∈ [ n ] h j ( a ) , it holds that b ∈ s ( a ) and thus there exists a homomorphism h a,b = h i that maps a to the singleton { b } ; so, we have S j ∈ [ n ] h j ( a ) = S i ∈ [ n ] , | h i ( a ) | =1 h i ( a ) . Since g is a homomorphism from A to UnionSing ( ℘ ( B ) n ) ,we can compose g and a homomorphism from UnionSing ( ℘ ( B ) n ) to B , which we know to exist by assumption, toget a homomorphism from A to B . Consequently, singleton arc consistency solves CSP ( B ) . (cid:3) In this section, we investigate relationships among the sets of structures solvable by the various algorithms presented.We show that for the structures having all constants, AC solves a strictly smaller set of structures than LAAC does;on the other hand, we show that there is a structure (not having all constants) solvable by AC but not LAAC. We thenshow that the structures solvable by AC or LAAC are strictly contained in those solvable by PAC; and, in turn, that thestructures solvable by PAC are strictly contained in those solvable by SAC. We also show that the structures solvableby SAC (and hence, those solvable by any of the studied algorithms) all fall into the class of structures having boundedwidth ; bounded width is a well-studied condition admitting multiple characterizations [18, 22, 6].
Proposition 15
Suppose that B is a structure having all constants. If CSP ( B ) is solvable by AC, then it is solvableby LAAC. roof . By Theorem 4, there is a homomorphism f : ℘ ( B ) → B . Since the structure B has all constants, for each b ∈ B there is a relation symbol R b with R B b = { ( b ) } . Since ( { b } ) ∈ R ℘ ( B ) b , it must hold that f ( { b } ) ∈ R B b , fromwhich it follows that f ( { b } ) = b . The mapping l defined by l ( S, b ) = f ( S ) is then a homomorphism of the typedescribed in Theorem 6. (cid:3) Proposition 16
There exists a structure B having all constants such that CSP ( B ) is solvable by LAAC but not by AC. Proof . Take B to be the relational structure with universe { , } over signature { U , U , R (0 , , R (1 , } where U B = { } U B = { } R B (0 , = { , } \ { (0 , } R B (1 , = { , } \ { (1 , } . It is straightforward to verify that the mapping l defined by l ( { , } , b ′ ) = b ′ , l ( { } , b ′ ) = 0 , and l ( { } , b ′ ) = 1 forall b ′ ∈ { , } is a homomorphism from ℘ ( B ) × B to B satisfying the condition of Theorem 6. Hence, the problem CSP ( B ) is solvable by LAAC.To show that the problem CSP ( B ) is not solvable by AC, let f be an arbitrary mapping from ℘ ( B ) \ {∅} to B . Weshow that f cannot be a homomorphism from ℘ ( B ) to B , which suffices by Theorem 4. Let b = f ( { , } ) . It holdsthat ( { , } , { , } ) ∈ R ℘ ( B )( b,b ) , but ( f ( { , } ) , f ( { , } )) = ( b, b ) / ∈ R B ( b,b ) , and we are done. (cid:3) Proposition 17
There exists a structure B (not having all constants) such that CSP ( B ) is solvable by AC but not byLAAC. Proof . Take B to be the relational structure with universe { , } over signature { R, S } where R B = { , } \{ (0 , , } and S B = { , } \ { (1 , , } . The mapping p that sends each element of ℘ ( B ) \ {∅} to is a homomor-phism from ℘ ( B ) to B , and hence AC solves CSP ( B ) by Theorem 4.To show that the problem CSP ( B ) is not solvable by LAAC, let f be an arbitrary mapping from ( ℘ ( B ) \ {∅} ) × B to B that satisfies f ( { b } , b ′ ) = b for all b, b ′ ∈ B . We show that f cannot be a homomorphism from ℘ ( B ) × B to B ,which suffices by Theorem 6. We consider two cases depending on the value of f ( { , } , . • If f ( { , } ,
0) = 1 , then we use the facts that ( { } , { , } , { , } ) ∈ R ℘ ( B ) and that (0 , , ∈ R B ; we havethat ( f ( { } , , f ( { , } , , f ( { , } , , , , which is not contained in R B , implying that f is not ahomomorphism of the desired type. • If f ( { , } ,
0) = 0 , then we use the facts that ( { } , { , } , { , } ) ∈ S ℘ ( B ) and that (0 , , ∈ S B ; we havethat ( f ( { } , , f ( { , } , , f ( { , } , , , , which is not contained in S B , implying that f is not ahomomorphism of the desired type. (cid:3) We now proceed to study PAC, and in particular, show that the structures solvable by AC or LAAC are solvable byPAC.
Proposition 18
Let B be a structure. If CSP ( B ) is solvable by AC, then it is also solvable by PAC. Proposition 18 follows directly from the algebraic characterizations given in Theorems 4 and 10; it can also beseen to follow from the corresponding algorithm descriptions.
Theorem 19
Let B be a structure. If CSP ( B ) is solvable by LAAC, then it is also solvable by PAC. roof . Suppose that look-ahead arc consistency solves CSP( B ). By Theorem 6 there exists a homomorphism l : ℘ ( B ) × B → B such that l ( { b } , b ′ ) = b for all b, b ′ ∈ B . We want to show that peek arc consistency solves CSP( B )by using Theorem 10. Thus, we have to show that for all n ≥ there is a homomorphism g n : Sing ( ℘ ( B ) n ) → B .Let n ≥ . Let us consider the mapping g n with g n ( S , . . . , S n ) = l ( S , l ( S , . . . l ( S n − , l ( S n , b )) . . . )) defined for all tuples T = ( S , . . . , S n ) ∈ Sing ( ℘ ( B ) n ) and all b ∈ B . First we want to show that g n is well defined.Let b , b ∈ B with b = b , let ( S , . . . , S n ) ∈ Sing ( ℘ ( B ) n ) and let i ∈ [ n ] be an index such that S i is a singleton.Let S i = { b ∗ } for a b ∗ ∈ B . We obtain that l ( S , . . . l ( S i − , l ( S i , . . . l ( S n − , l ( S n , b )) . . . )) . . . )= l ( S , . . . l ( S i − , l ( S i , b ′ )) . . . )= l ( S , . . . l ( S i − , b ∗ ) . . . ) with b ′ = l ( S i +1 , . . . l ( S n − , l ( S n , b )) . . . ) ∈ B , because l is applied to the singleton S i = { b ∗ } and b ′ . Similarly,we obtain that l ( S , . . . l ( S i − , l ( S i , . . . l ( S n − , l ( S n , b )) . . . )) . . . )= l ( S , . . . l ( S i − , b ∗ ) . . . ) Consequently, g n is well defined. Next, we prove that g n is a homomorphism. Let R Sing ( ℘ ( B ) n ) be a k -ary relation andlet ( T , . . . , T k ) be a tuple in this relation. Denote T i = ( S i , S i , . . . , S in ) for all i ∈ [ k ] ; then, S ′ j = ( S j , . . . , S kj ) hasto be in R ℘ ( B ) for all j ∈ [ n ] . Further, we know that there exists a tuple ¯ b = ( b , . . . , b k ) ∈ R B , because R ℘ ( B ) is notempty. Since l is a homomorphism, the tuple g n ( S ′ , S ′ , . . . , S ′ n ) = l ( S ′ , l ( S ′ , . . . l ( S ′ n − , l ( S ′ n , ¯ b )) . . . )) is in R B . Thus, g n is a homomorphism from Sing ( ℘ ( B ) n ) to B . (cid:3) Theorem 20
There exists a structure B having all constants such that CSP ( B ) is solvable by PAC but not by LAACnor AC. Proof . Let us consider the structure with universe { , , } over the signature { U , U , U , R , R } where U B = { (0) } U B = { (1) } U B = { (2) } R B = (cid:0) { , } × { , , } (cid:1) \ { (0 , } R B = { (0 , , (1 , , (2 , } . First we show that there is no homomorphism l : ℘ ( B ) × B → B such that l ( { b } , b ′ ) = b for all b, b ′ . Let usassume there is one. Since ( { } , { , } ) ∈ R ℘ ( B )1 and (1 , ∈ R B the tuple ( l ( { } , , l ( { , } , , which isequal to (0 , l ( { , } , , has to be contained in R B . Thus, l ( { , } , cannot be equal to . On the other hand, ( { , } , { , } ) ∈ R ℘ ( B )2 and (0 , ∈ R B implies that ( l ( { , } , , l ( { , } , is in R B . Therefore, l ( { , } , hasto be , which is a contradiction. This establishes that the structure is not solvable by LAAC; by Proposition 15, itfollows that the structure is not solvable by AC. 9ext we show that for all n , there exists a homomorphism f from Sing ( ℘ ( B ) n ) to B . Let n be arbitrary and let ( S , . . . , S n ) be an arbitrary n -tuple of Sing ( ℘ ( B ) n ) . Further, let i be the minimal number such that S i is { } , { } , { , } or { , } ; if such an S i does not exists, then i = 0 . The homomorphism f can be defined as follows: f ( S , . . . , S n ) = if i > and S i is { } or { , } if i > and S i is { } or { , } otherwise.Let us verify that f is indeed a homomorphism: First of all, it is easy to see that f ( S , . . . , S n ) is in U B i whenever ( S , . . . , S n ) is in U Sing ( ℘ ( B ) n ) i . Next, let us consider R . Let ( S , . . . , S n ) and ( T , . . . , T n ) be arbitrary n -tuples of Sing ( ℘ ( B ) n ) such that ( S l , T l ) is in R ℘ ( B )2 for all l . Let i be the minimal number such that S i is { } , { } , { , } or { , } , and let j be the minimal number such that T j is { } , { } , { , } or { , } , and if such an S i or T j does notexists, then i = 0 or j = 0 respectively. If i > , then T i has to be { } , { } , { , } or { , } and hence < j ≤ i .Symmetrically, if j > , then < i ≤ j . Therefore, i = j . Now, if i = j = 0 , then ( f ( S , . . . , S n ) , f ( T , . . . , T n )) =(0 , , which is in R B ; if i = j > , then ( f ( S , . . . , S n ) , f ( T , . . . , T n )) ∈ R B follows directly from ( S i , T i ) beingin R ℘ ( B )2 . Finally, let us consider two arbitrary n -tuples ( S , . . . , S n ) and ( T , . . . , T n ) of Sing ( ℘ ( B ) n ) such that ( S l , T l ) is in R ℘ ( B )1 for all l . If f ( S , . . . , S n ) = 2 , then S i = { } or { , } and ( S i , T i ) cannot be in R ℘ ( B )1 . If f ( S , . . . , S n ) = 1 , then ( f ( S , . . . , S n ) , f ( T , . . . , T n )) is in { } × { , , } and, thus, in R B . If j = 0 , then let k be an index such that T k = { } . Such an index has to exist, because ( T , . . . , T n ) is a tuple of Sing ( ℘ ( B ) n ) . Since ( S k , T k ) is in R ℘ ( B )1 , S k has to be { } , and hence f ( S , . . . ., S n ) ∈ { , } , and we appeal to one of the first two cases.The remaining case is i = 0 and j > . In this case, ( f ( S , . . . , S n ) , f ( T , . . . , T n )) is in { } × { , } and thereforein R B . (cid:3) We now move on to study SAC; we show that SAC is strictly more powerful than PAC.
Proposition 21
Let B be a structure. If CSP ( B ) is solvable by PAC, then it is also solvable by SAC. Proposition 21 follows directly from the algebraic characterizations given in Theorems 10 and 14; it can also beseen to follow from the corresponding algorithm descriptions.
Theorem 22
There exists a structure B having all constants such that CSP ( B ) is solvable by SAC but not by PAC. Proof . We will consider a structure that has as a polymorphism the idempotent binary commutative operation ∗ definedon the set { , , , } by ∗ , ∗ , ∗ , and ∗ a = a for all a ∈ { , , } . We consider the structure B with universe { , , , } over the signature { U , U , U , U , R , R } where we have U B = { (0) } U B = { (1) } U B = { (2) } U B = { (3) } .R B = { , , , } \ { (0 , } ,R B = { (1 , , (2 , , (3 , , (0 , } It is straightforward to verify that this structure B has the operation ∗ as a polymorphism. The solvability of B followsfrom Theorem 32, which is proved in the next section; see also the discussion in Example 33.To show that peek arc consistency does not solve CSP ( B ) , we prove that there is no homomorphism from Sing ( ℘ ( B ) ) to B , which is sufficient by Theorem 10. Define t = ( { } , { , , } ) and t = ( { , , } , { } ) .It is straightforward to verify that ( t , t ) ∈ R ℘ ( B ) ; since each of the tuples t , t contains a singleton, it holdsthat ( t , t ) ∈ R Sing ( ℘ ( B ) )1 . Assume, for a contradiction, that h is a homomorphism from Sing ( ℘ ( B ) ) to B .It then holds that ( h ( t ) , h ( t )) ∈ R B . Since (0 , / ∈ R B , we have that one of the values h ( t ) , h ( t ) is not10qual to . Let us assume that h ( t ) is not equal to ; the other case is symmetric. Denote h ( t ) by b ; we have b ∈ { , , } . Since each of the two tuples ( { } , { } ) , ( { , , } , { , , } ) is contained in R ℘ ( B )2 , we have that (( { } , { , , } ) , ( { } , { , , } )) ∈ R Sing ( ℘ ( B ) )2 . It follows that ( b, b ) ∈ R B , but since no tuple of the form ( c, c ) with c ∈ { , , } is contained in R B , we have reached our contradiction. (cid:3) We close this section by showing that the structures solvable by SAC, and hence those solvable by any of thealgorithms studied here, fall into the class of structures having bounded width . We begin by defining bounded width.A partial homomorphism from A to B is a mapping f : A ′ → B , where A ′ ⊆ A , that defines a homomorphism to B from the substructure of A induced by A ′ . When f and g are partial homomorphisms we say that g extends f , denotedby f ⊆ g , if Dom( f ) ⊆ Dom( g ) and f ( a ) = g ( a ) for every a ∈ Dom( f ) . Definition 23
Let k > . A k -strategy for an instance ( A , B ) is a nonempty collection H of partial homomorphismsfrom A to B satisfying the following conditions:1. (restriction condition) if f ∈ H and g ⊆ f , then g ∈ H ;2. (extension condition) if f ∈ H , | Dom( f ) | < k , and a ∈ A , there is g ∈ H such that f ⊆ g and a ∈ Dom( g ) . When H is a k -strategy for ( A , B ) and a , . . . , a j ∈ A is a sequence, we define H a ,...,a j ⊆ B j to be the relation { ( f ( a ) , . . . , f ( a j )) | f ∈ H, Dom( f ) = { a , . . . , a j }} . Definition 24
Let B be a structure and k ≥ . We say that CSP ( B ) has width k if for all structures A the followingholds: if there is a ( k + 1) -strategy for ( A , B ) then there is a homomorphism A → B . We say that CSP ( B ) has bounded width if it has width k for some k ≥ . Proposition 25
Let B be a structure. If CSP ( B ) is solvable by SAC, then CSP ( B ) has bounded width. Proof . Let r be the maximum of all the arities of the signature of B , and set k = max(2 , r + 1) . We shall show that forany instance A of CSP ( B ) , if H is a k -strategy for ( A , B ) , then the instance ( A , B ) has the SACC, which suffices.Let us define the mapping s : A → ℘ ( B ) \ {∅} as s ( a ) = H a . Furthermore, for every a ∈ A , b ∈ s ( a ) ,define h a,b : A → ℘ ( B ) \ {∅} as the mapping h a,b ( a ′ ) = { b ′ | ( b, b ′ ) ∈ H a,a ′ } . Note that the extension propertyof H guarantees that, for every a ′ ∈ A , h a,b ( a ′ ) is, indeed, nonempty. It follows from the definition of h a,b that h a,b ( a ) = { b } , and that for all a ′ ∈ A , h a,b ( a ′ ) ⊆ s ( a ′ ) .It is only necessary to show that h a,b defines a homomorphism from A to ℘ ( B ) . Let R A be any relation in A ,let ( a , . . . , a i ) ∈ R A , and let S j = h a,b ( a j ) for each j ∈ [ i ] . In order to prove that ( S , . . . , S i ) ∈ R ℘ ( B ) itsuffices to show that for every j ∈ [ i ] and every b j ∈ S j , there exists some ( c , . . . , c i ) ∈ R B ∩ ( S × · · · × S i ) with c j = b j . This is a direct consequence of the properties of the strategy. Indeed, by the definition of h a,b weknow that ( b, b j ) ∈ H a,a j and then, by an iterative application of the extension property, we can show that there existsan extension ( b, c , . . . , c i ) ∈ H a,a ,...,a i with c j = b j . The fact that H contains only partial homomomorphismsguarantees that ( c , . . . , c i ) ∈ R B . Finally, it follows from the restriction condition that for every l ∈ [ i ] , we have c l ∈ S l . (cid:3) An operation m : B → B is a majority operation if it satisfies the identity m ( x, y, y ) = m ( y, x, y ) = m ( y, y, x ) = y for all x, y ∈ B . Relative to a majority operation m : B → B , when I ⊆ J ⊆ B , we say that I is an ideal of J if forevery x, y, z ∈ J such that x, z ∈ I we have m ( x, y, z ) ∈ I . We will establish the following result. Theorem 26 If B is a structure that has a majority polymorphism, then singleton arc consistency solves CSP ( B ) . t [ i ] to denote the i th entry of a tuple t .We introduce the following definitions relative to an instance ( A , B ) with signature σ . A pattern p of A is asequence a , e , a , . . . , e m − , a m such that a , . . . , a m are elements of A and for every n ∈ [ m − , we have that e n is a triple ( R, i, j ) where R is a symbol in σ and i, j are indices such that there is a tuple t ∈ R A with t [ i ] = a n and t [ j ] = a n +1 . The length of pattern p is defined to be m . A pattern is a cycle if a = a m . By a set system , we meanany mapping H : A → ℘ ( B ) \ {∅} .A pattern q = b , e ′ , . . . , e ′ m − , b m of B having the same length as a pattern p of A is a realization of p if e n = e ′ n for all n ∈ [ m − . The pair ( b , b m ) is said to be a support of p . For a set system H , if it holds that b n ∈ H ( a n ) forall n ∈ [ m ] then ( b , b m ) is said to be a support of p inside H .A set system H is a weak strategy if for every pattern p = a , e , . . . , e m − , a m of A , and every b ∈ H ( a ) thereexists some b m ∈ H ( a m ) such that ( b , b m ) supports p inside H . A set system H is a strong strategy if for everycycle p = ( a = a , . . . , a m = a ) in A and every b ∈ H ( a ) , the pair ( b, b ) supports p inside H . Note that every strongstrategy is a weak strategy and that the class of weak strategies remains the same if, in the definition of weak strategy,one replaces “every pattern p = a , e , . . . , e m − , a m ” by “every pattern p = a , e , . . . , e m − , a m of length m = 2 ”. Observation 1
Every strong strategy is a weak strategy, relative to an instance ( A , B ) . Proof . For a pattern p = a , e , . . . , e m − , a m of A , one needs only to apply the definition of strong strategy to thethe pattern a , e , . . . , e m − , a m , e − m − , a m − , . . . , e − , a , where ( R, i, j ) − is defined to be ( R, j, i ) . (cid:3) Lemma 27
There exists a strong strategy for an instance ( A , B ) having the SACC. Proof . Let s : A → ℘ ( B ) \ {∅} , { h a,b } be the mappings witnessing that ( A , B ) has the SACC. We claim that the setsystem H defined by H ( a ) = s ( a ) for all a ∈ A is a strong strategy. Indeed, let p = a , e , . . . , a m be a pattern of A with a = a m = a and let b ∈ H ( a ) . We claim that there exists a realization b , e , . . . , b m of p with b = b m = b such that for every ≤ n ≤ m , b n ∈ h a,b ( a n ) . The realization is constructed in an inductive manner. First, set b to b . Assume now that b n − is already set and let e n − be ( R, i, j ) . There exists a tuple ( x , . . . , x r ) ∈ R A suchthat x i = a n − and x j = a n . Since h a,b is a homomorphism, the subset S ⊆ B r defined by π l S = h a,b ( x l ) forevery ≤ l ≤ r is a subset of R B . From b n − ∈ h a,b ( x i ) it follows that there exists a tuple ( y , . . . , y r ) ∈ S with y i = b n − . Define b n to be y j . Since, by definition of SACC strategy h a,b ( a ) = { b } , it follows that b m = b . (cid:3) We now prove the following lemma, which, as we explain after the proof, essentially establishes the desiredtheorem. In the course of proving this lemma, we establish a number of observations.By a minimal strong strategy, we mean minimal with respect to the ordering where for two strategies
H, H ′ , weconsider H ⊆ H ′ if H ( a ) ⊆ H ′ ( a ) for all a ∈ A . Lemma 28
If the relations of B are invariant under a majority operation φ and H is a minimal strong strategy thenfor every a ∈ A , the set H ( a ) is a singleton. Proof . Towards a contradiction assume that H is a minimal strong strategy and a ∗ ∈ A is such that H ( a ∗ ) , is not asingleton. Consider the digraph G whose nodes are of the form ( a, C ) with a ∈ A and C ⊆ H ( a ) , and there is an edgefrom ( a, C ) to ( a ′ , C ′ ) if there is a pattern p = a , . . . , a m with a = a and a ′ = a m in A such that the followingholds: C ′ is the set containing all b ′ ∈ H ( a ′ ) such that ( b, b ′ ) is supported by p inside H for some b ∈ C . Observation 2
Let p = a , e , . . . , a m be a pattern, let < i < m , let q be the pattern a , e , . . . , a i and r be thepattern a i , e i . . . , e m . If q defines an edge from ( a , C ) to ( a i , C i ) and r defines an edge from ( a i , C i ) to ( a m , C m ) then p defines an edge from ( a , C ) to ( a m , C m ) . Hence, the graph G is transitive. The following observation follows from the definition of strong strategy.
Observation 3
If there is an edge from ( a, C ) to ( a, C ′ ) in G , then necessarily C ⊆ C ′ . Observation 4
If there is an edge from ( a, C ) to ( a ′ , C ′ ) in G , and C is an ideal of H ( a ) , then C ′ is an ideal of H ( a ′ ) . roof (Observation 4). Let us prove the claim by induction on the length m of the pattern that defines the edge.Assume first that m = 2 . Let a, ( R, i, j ) , a ′ be any such pattern. Let x , x , x ∈ H ( a ′ ) and assume that two ofthem, say x , x , belong to C ′ . It follows, by the definition of edge, that for every n ∈ { , } there exists tuple t n ∈ R B with t n [ j ] = x n and t n [ i ] ∈ C . Also, it follows by considering pattern a ′ , ( R, j, i ) , a and from the fact that H is aweak strategy that there exists a tuple t ∈ R B with t [ i ] ∈ H ( a ) and t [ j ] = x . Consider now tuple t = φ ( t , t , t ) .Since C is an ideal of H ( a ) we have that t [ i ] ∈ C . Hence, we conclude that φ ( x , x , x ) = t [ j ] ∈ C ′ .The case m > follows from the inductive hypothesis and Observation 2. (cid:3) Now, let G ′ be the subgraph of G induced by all nodes ( a, C ) such that C is an ideal of H ( a ) and C = H ( a ) .Observe that as H ( a ∗ ) is not a singleton, the graph G ′ is nonempty, because every singleton is an ideal.A subset M of vertices of a directed graph is a strongly connected component if for every pair ( v, w ) ∈ M there exists a path from v to w consisting only of vertices in M . It is a maximal strongly connected component ifadditionally, there is no edge ( v, w ) with v ∈ M and w M .Let M be a maximal strongly connected component of G ′ . The following observation is a direct consequence ofObservations 2 and 3. Observation 5
The maximal strongly connected component M cannot have two vertices ( a, C ) , ( a, C ′ ) with C = C ′ . We shall construct a new strong strategy H ′ as follows. If ( a, C ) belongs to M , then set H ′ ( a ) = C otherwise set H ′ ( a ) = H ( a ) . Clearly H ′ is strictly smaller than H .We shall start by showing that H ′ is a weak strategy. By the note following the definition of weak strategy it isonly necessary to show that for every pattern p = a , e , a of length of A and every b ∈ H ′ ( a ) , there exists asupport ( b , b ) of p inside H ′ .We do a case analysis. If ( a , H ′ ( a )) does not belong to M the claim follows from the fact that H is a weakstrategy. Assume now that ( a , H ′ ( a )) belongs to M . Consider the pattern p = a , e − , a where ( R, i, j ) − =( R, j, i ) . This pattern defines an edge (in G ) from ( a , H ′ ( a )) to a node ( a , C ) . Observe, that by the definition ofthe edges of G , we know that for every element b ∈ C there is some b ′ ∈ H ′ ( a ) such that ( b, b ′ ) is supported by p inside H . Hence we only need to show that H ′ ( a ) ⊆ C .If ( a , C ) is in G ′ then, since M is a maximal strongly connected component of G ′ , we have that ( a , C ) belongsto M as well and hence C = H ′ ( a ) . If ( a , C ) is not in G ′ this must be because C is not an ideal of H ( a ) or because C = H ( a ) . We can rule out the first possibility in the following way: by the definitions of G ′ and H ′ , H ′ ( a ) is anideal of H ( a ) . It follows by observation 4 that C is an ideal of H ( a ) . In consequence C = H ( a ) and the proofthat H ′ is a weak strategy is concluded.It remains to show that H ′ is a strong strategy. Let p = a , e , . . . , e m − , a m be any cycle in A with a = a m = a and let b be any element in H ′ ( a ) . Since H ′ is a weak strategy we know that there is a realization b , . . . , b m of p with b = b inside H ′ . Notice that we do not necessarily have b m = b . Symmetrically, by considering pattern a m , e − m − , . . . , e − , a we know that there is a realization d m , e − m − , . . . , e − , d of p with d m = b inside H ′ . Also,since H is a strong strategy we know that there exists a realization c , e , . . . , c m of p such that c = c m = b inside H (but not necessarily inside H ′ ). Finally consider the sequence x , . . . , x m defined by x j = φ ( b j , c j , d j ) , ≤ j ≤ m .This sequence is a realization of p . Furthermore, we have that x = x m = b . It remains to show that it is inside H ′ .Indeed, for every ≤ j ≤ m , { b j , d j } ⊆ H ′ ( a j ) and c j ∈ H ( a j ) . Since H ′ ( a j ) is an ideal of H ( a j ) the claimfollows. (cid:3) Proof . (Theorem 26) Suppose that the instance ( A , B ) has the SACC and that B has the majority polymorphism φ .By Lemmas 27 and 28 there exists a strong strategy H for ( A , B ) such that H ( a ) is a singleton for every a ∈ A .Consider now the mapping h : A → B that maps every a ∈ A to the only element in H ( a ) . We claim that h is ahomomorphism from A to B . Indeed, let R be any relation symbol, and ( a , . . . , a r ) be any tuple in R A . Fix any ≤ i, j ≤ r and consider pattern a i , ( R, i, j ) , a j . It follows by the definition of strong strategy that there is a t ∈ R B such that t [ i ] = h ( i ) and t [ j ] = h ( j ) . Since R B is necessarily -decomposable [20], h is a homomorphism. (cid:3) A 2-semilattice G = ( G, ⋆ ) consists of a set G , which in this paper we assume to be finite, and a binary operation ⋆ satisfying x⋆x = x (idempotency), x⋆y = y ⋆x (commutativity), and x⋆ ( x⋆y ) = ( x⋆x ) ⋆y (restricted associativity).13ach 2-semilattice naturally induces a directed graph ( G, E ) where ( a, b ) ∈ E if and only if a ⋆ b = b . When ( a, b ) ∈ E , we also write a ≤ b . The graph ( G, E ) is connected, since a ⋆ ( a ⋆ b ) = b ⋆ ( a ⋆ b ) = a ⋆ b for any a, b ∈ G ,and therefore, a, b ≤ a ⋆ b . Each 2-semilattice has a unique maximal strongly connected component, that is a stronglyconnected component with no outgoing edges, denoted by G . The component G is also the unique strongly connectedcomponent of ( G, E ) such that for any a ∈ G , there exists b ∈ G such that a ≤ b . In this section, we will prove that acertain class of 2-semilattices is tractable via singleton arc consistency. Our treatment of 2-semilattices is inspired andinfluenced by the study conducted by Bulatov [10], who proved that they are polynomial-time tractable.A 2-semilattice G = ( G, ⋆ ) is an algebra. By an algebra , we mean a pair ( A, O ) consisting of a set A , the universe of the algebra, and a set O of operations on A . A congruence of an algebra is an equivalence relation preserved by theoperation(s) of the algebra, and an algebra is simple if its only congruences are trivial (that is, if its only congruencesare the equality relation on A and A × A , where A is the universe of the algebra).We will begin by proving some general results on singleton arc consistency. In the following discussion, a subal-gebra is defined, with respect to a relational structure B , as a subset S ⊆ B that is preserved by all polymorphisms of B . For an arbitrary subset T ⊆ B , we use h T i to denote the smallest subalgebra containing T . Proposition 29
Suppose that g , . . . , g k : A → ℘ ( B ) are homomorphisms, and suppose that f : B k → B is apolymorphism of B . Then the map g : A → ℘ ( B ) \ {∅} defined by g ( a ) = f ( g ( a ) , . . . , g k ( a )) for all a ∈ A is ahomomorphism A → ℘ ( B ) . For an operation f : B k → B and a sequence of subsets B , . . . , B k ⊆ B , by the notation f ( B , . . . , B k ) , wedenote the set { f ( b , . . . , b k ) | b ∈ B , . . . , b k ∈ B k } . Regarding this notation, it is easy to verify that f can beunderstood as a polymorphism of ℘ ( B ) if f is a polymorphism of B . Proposition 29 follows straightforwardly fromthe definitions. Proposition 30
Suppose that h : A → ℘ ( B ) is a homomorphism. Then the map h ′ defined by h ′ ( a ) = h h ( a ) i for all a ∈ A is also a homomorphism A → ℘ ( B ) . Proof . Repeatedly apply Proposition 29 with a polymorphism f and g = · · · = g k = h , each time taking theresulting g and updating h to be h ∪ g . Note that at each step, the new h is a homomorphism A → ℘ ( B ) , since theunion operation ∪ is a polymorphism of ℘ ( B ) . When no changes can be made, the resulting h is the desired h ′ . (cid:3) Let us say that a CSP instance ( A , B ) has the subalgebra SACC if ( A , B ) has the SACC relative to mappings s, { h a,b } such that for all a ∈ A , the set s ( a ) is a subalgebra, and for all a, a ′ ∈ A , b ∈ s ( a ) , the set h a,b ( a ′ ) is asubalgebra. Proposition 31
If a pair ( A , B ) of similar structures has the SACC, and all polymorphisms of B are idempotent, thenit has the subalgebra SACC. Proof . Suppose that ( A , B ) has the SACC with respect to the mappings s, { h a,b } . Set s ′ ( a ) = h s ( a ) i for all a ∈ A ,and h ′ a,b ( a ′ ) = h h a,b ( a ′ ) i for all a, a ′ ∈ A , b ∈ s ( a ) . Clearly, for all such a, a ′ , b we have h ′ a,b ( a ′ ) ⊆ s ′ ( a ′ ) , andalso, that h ′ a,b is a homomorphism A → ℘ ( B ) (by Proposition 30). Let b be an element in s ′ ( a ) \ s ( a ) for some a ∈ A . We need to show that there exists a homomorphism h ′ a,b that satisfies the two conditions of Definition 11with respect to s ′ , and that also satisfies the subalgebra condition. As s ′ ( a ) is defined as h s ( a ) i , it holds that s ′ ( a ) = { f ( b , . . . , b k ) | f a polymorphism of B ; b , . . . , b k ∈ s ( a ) } ; the containment ⊇ is clear by definition of subalgebra,and the containment ⊆ follows from the fact that the right hand side is a subalgebra, which in turn follows from thefact that the set of polymorphisms of B forms a clone and is closed under composition [23]. Thus, there exists apolymorphism f of B and elements b , . . . , b k ∈ s ( a ) such that b = f ( b , . . . , b k ) . Let g ′ a,b be the homomorphismobtained from Proposition 29 with g i = h a,b i and f . Set h ′ a,b ( a ′ ) = h g ′ a,b ( a ′ ) i for all a ′ ∈ A . The homomorphism h ′ a,b has the desired properties. (cid:3) We now turn to prove our tractability result. We will now use the term subalgebra to refer to a subalgebra of a2-semilattice ( B, ⋆ ) , that is, a subset of B preserved by ⋆ . Note, however, that we will be working with a relationalstructure B assumed to have ⋆ as a polymorphism, so a subalgebra in the previous sense (that is, with respect to B )will also be a subalgebra in this sense. An algebra ( B, ⋆ ) having a binary operation is conservative if for all b, b ′ ∈ B ,it holds that b ⋆ b ′ ∈ { b, b ′ } . The following is the statement of our tractability result.14 heorem 32 Let ( B, ⋆ ) be a conservative 2-semilattice such that every strongly connected subalgebra is simple. If B is a structure having ⋆ as a polymorphism, then singleton arc consistency solves CSP ( B ) . Example 33
We consider the binary operation ∗ on { , , , } defined by the following table.* 0 1 2 30 0 1 2 31 1 1 2 12 2 2 2 33 3 1 3 3It is straightforward to verify that this operation is commutative and conservative, and is a 2-semilattice. The graphinduced by this operation has edges (0 , , (0 , , (0 , , (1 , , (2 , , (3 , , as well as self-edges on each of the ver-tices. There is thus just one strongly connected component of size strictly greater than one, namely, the component { , , } . This is a subalgebra of the algebra ( { , , , } , ∗ ) and is readily verified to be simple. Hence, the tractabilityvia singleton arc consistency of any structure preserved by the operation ∗ follows from Theorem 32. We will make use of the following results. For our purposes here, a subdirect product of algebras A , . . . , A k is asubalgebra S of A × · · · × A k such that for each i ∈ [ k ] , it holds that π i S = A i . Lemma 34
Suppose that S is a subdirect product of 2-semilattices S , . . . , S n . Then S ∩ ( S ×· · ·× S n ) is a subdirectproduct of S , . . . , S n . Proof . Immediate from [10, Lemma 3.2]. (cid:3)
Definition 35
A relation S ⊆ B n is almost trivial if there exists a partition I , . . . , I k of [ n ] such that • t ∈ S if and only if for all i ∈ [ k ] , it holds that π I i t ∈ π I i S ; and, • for each j ∈ [ k ] , it holds that π I j S has the form { ( π ( p ) , π ( p ) , . . . , π m ( p )) | p ∈ [ q ] } for some q ≥ andwhere each mapping π i is a bijection from [ q ] to a subset of B . Proposition 36
A subdirect product of simple strongly connected 2-semilattices is an almost trivial relation, and ishence itself strongly connected.
Proof . Immediate from [10, Proposition 3.1]. (cid:3)
Proposition 37
Let ( A , B ) be an instance that has the SACC with respect to s : A → ℘ ( B ) \ {∅} . If for each tuple ( a , . . . , a k ) ∈ R A , it holds that R B ∩ ( s ( a ) × · · · × s ( a k )) is almost trivial, then there is a homomorphism from A to B . Proof . Consider the following graph G = ( A, E ) , where { a, b } ∈ E if and only if there is a relation R A in A , and,if I , . . . , I k is its partition regarding almost triviality of R B ∩ ( s ( a ) × · · · × s ( a k )) , there further is an l ∈ [ k ] anda tuple ( a , . . . , a m ) ∈ R A I l such that there are i, j with a = a i and b = a j . For each connected component C ofthe graph G arbitarily choose a ∈ C and b ∈ s ( a ) . Since arc consistency can be established when a is set to b andusing the structure of the projected relations R B I l , there exists a unique extension of a b to a homomorphism on C . Because of the first property of Definition 35 the homomorphisms on the single components can be combined to ahomomorphism on A . (cid:3) The following is the main result used to prove Theorem 32.
Theorem 38
Suppose that B satisfies the hypotheses of Theorem 32, and suppose that ( A , B ) has the subalgebraSACC via s : A → ℘ ( B ) \ {∅} . Then, ( A , B ) has the SACC via the map s ′ : A → ℘ ( B ) \ {∅} defined by s ′ ( a ) = s ( a ) for all a ∈ A . roof . Let a ∈ A and b ∈ s ( a ) . By hypothesis, there exists a homomorphism h : A → ℘ ( B ) where h ( a ) = { b } andfor all a ′ ∈ A , it holds that h ( a ′ ) ⊆ s ( a ′ ) . We want to show that there exists a homomorphism h ′ : A → ℘ ( B ) where h ′ ( a ) = { b } and for all a ′ ∈ A , it holds that h ′ ( a ′ ) ⊆ s ′ ( a ′ ) . Define h ′ ( a ) as h ( a ) if h ( a ) ∩ s ′ ( a ) = ∅ , and as s ′ ( a ) otherwise. Observe that in the first case, we have h ′ ( a ) = h ( a ) ⊆ s ′ ( a ) , and that in both cases, the subset h ′ ( a ) is asubalgebra.We claim that h ′ is a homomorphism from A to ℘ ( B ) . Let a ∈ R A be a tuple in A . For the sake of notation,we assume that a = ( a , . . . , a k + l ) , I = { , . . . , k } , J = { k + 1 , . . . , k + l } , and that I contains exactly thecoordinates i ∈ [ k + l ] such that h ( a i ) ∩ s ′ ( a i ) = ∅ , so that h ′ ( a i ) = h ( a i ) for all i ∈ I and h ′ ( a j ) = s ′ ( a j ) for all j ∈ J . Let T = ( π I R B ∩ ( s ( a ) × · · · × s ( a k ))) ∩ ( s ( a ) × · · · × s ( a k )) . By Lemma 34, we have that relation T is asubdirect product of s ( a ) , . . . , s ( a k ) . Further, let W = ( R B ∩ ( s ( a ) × · · · × s ( a k + l ))) ∩ ( s ( a ) × · · · × s ( a k + l )) .By Lemma 34, we have that W is a subdirect product of s ( a ) , . . . , s ( a k + l ) . Clearly, π I W ⊆ T . We show that T ⊆ π I W (and hence that T = π I W ), as follows. Let t be a tuple in T . Let w be a tuple in W (such a tuple can be obtained,for instance, by ⋆ -multiplying together all tuples of R B ∩ ( s ( a ) × · · · × s ( a k + l )) , in any order). By our assumptionon B and by Proposition 36, there is a sequence of tuples u , . . . , u m in T such that π I w ≤ u ≤ · · · ≤ u m = t . Wehence have tuples v , . . . , v m with v i ∈ R B ∩ ( s ( a ) × · · · × s ( a k + l )) and π I v i = u i for each i ∈ [ m ] . The product ( · · · (( w ⋆ v ) ⋆ v ) ⋆ · · · ⋆ v m ) gives a tuple in W whose projection onto I is t .By Proposition 36, it holds that W is almost trivial with respect to a partition { I i } . Remove from the I i anycoordinates l such that s ′ ( a l ) has just one element. We now show that the resulting partition { I i } has the propertythat each I i is a subset of either I or J . By the homomorphism h and its subalgebra property, there exists a tuple ( t, x ) ∈ R B such that t ∈ T and x j / ∈ s ( a j ) for all j ∈ J (just multiply all tuples in R B ∩ ( h ( a ) × · · · × h ( a k + l )) ).By the fact that T ⊆ π I W , we have a tuple ( t, u ) ∈ W . By the strong connectedness of W (Proposition 36), there is atuple ( t ′ , u ′ ) ∈ W that is distinct from ( t, u ) at each coordinate in ∪ I i and such that ( t ′ , u ′ ) ⋆ ( t, u ) = ( t, u ) . We alsohave ( t ′ , u ′ ) ⋆ ( t, x ) = ( t, u ′ ) ; note that u ′ ⋆ x = u ′ by conservativity of ⋆ . As u and u ′ differ at every coordinate in J ∩ ( ∪ I i ) , the claim follows.As a consequence of this last result, for any tuple t ∈ π I W and any tuple u ∈ π J W , it holds that ( t, u ) ∈ W .Further it holds that ( π I R B ∩ ( h ( a ) ×· · ·× h ( a k ))) ∩ ( h ′ ( a ) ×· · ·× h ′ ( a k )) is a subdirect product of h ′ ( a ) , . . . , h ′ ( a k ) (Lemma 34), and we have that h ′ is a homomorphism from A to ℘ ( B ) . (cid:3) Proof . (Theorem 32) Suppose that ( A , B ) has the SACC. By Proposition 31, the instance ( A , B ) has the subalgebraSACC. By Theorem 38, ( A , B ) has the SACC via a mapping s ′ where for all a ∈ A , it holds that s ′ ( a ) is a stronglyconnected subalgebra. By assumption, each such s ′ ( a ) is simple, and it follows from Propositions 36 and 37 that thereis a homomorphism from A to B . (cid:3) In this work, we performed a systematic study of arc consistency and three simple, natural extensions thereof. We per-formed a comparison of the studied consistency notions based on constraint languages, and proved positive tractabilityresults for singleton arc consistency.Atserias and Weyer [5] gave a uniform treatment of AC, PAC, SAC, and general consistency. Among other results,they show that it can be decided, given a constraint language and any pair of the previous consistency methods, whetherit is true that the set of instances that passes one of the consistency tests coincides with the set of instances that passesthe other. Their results combined with the fact that general consistency/bounded width is decidable [6] implies that itcan be decided whether or not a given constraint language is solvable by any of the other methods.We conclude by posing one question for future work. Barto and Kozik [6] have recently characterized all languagessolvable by bounded width. Can all such languages be solvable by singleton arc consistency, or are there boundedwidth languages not solvable by singleton arc consistency? Resolving this question in the positive would seem toyield an interesting alternative characterization of the bounded width languages.
Acknowledgements.
The authors thank Manuel Bodirsky for his comments and collaboration. The authors alsothank Johan Thapper for his many useful comments. 16 eferences [1] A. Atserias, A. Bulatov, and V. Dalmau. On the power of k-consistency. In
Proceedings of 34th InternationalColloquium on Automata, Languages and Programming (ICALP) , pages 279–290, 2007.[2] A. Atserias, A. Bulatov, and A. Dawar. Affine systems of equations and counting infinitary logic.
TheoreticalComputer Science , 410(18):1666–1683, 2009.[3] A. Atserias, J. K. Fichte, and M. Thurley. Clause-learning algorithms with many restarts and bounded-widthresolution. In
Proceedings of 12th International Conference on Theory and Applications of Satisfiability Testing(SAT) , pages 114–127, 2009.[4] A. Atserias, P. G. Kolaitis, and M. Y. Vardi. Constraint propagation as a proof system. In
Proceedings of 10thInternational Conference on Principles and Practice of Constraint Programming (CP) , pages 77–91, 2004.[5] A. Atserias and M. Weyer. Decidable relationships between consistency notions for constraint satisfaction prob-lems. In
Proceedings of 18th Annual Conference of the European Association for Computer Science Logic (CSL) ,pages 102–116, 2009.[6] L. Barto and M. Kozik. Constraint satisfaction problems of bounded width. In
Proceedings of the 50th AnnualIEEE Symposium on Foundations of Computer Science, FOCS’09 , pages 595–603, 2009.[7] C. Bessiere and R. Debruyne. Theoretical analysis of singleton arc consistency and its extensions.
ArtificialIntelligence , 172(1):29–41, 2008.[8] M. Bodirsky and H. Chen. Peek arc consistency.
Theoretical Computer Science , 411(2):445–453, 2010.[9] A. Bulatov and M. Valeriote. Results on the algebraic approach to the csp. In
Complexity of Constraints: AnOverview of Current Research Themes , pages 68–92, 2008.[10] A. A. Bulatov. Combinatorial problems raised from 2-semilattices.
Journal of Algebra , 298(2):321–339, 2006.[11] A. K. Chandra and P. M. Merlin. Optimal implementation of conjunctive queries in relational data bases. In
Proceddings of STOC’77 , pages 77–90, 1977.[12] H. Chen and V. Dalmau. (Smart) look-ahead arc consistency and the pursuit of CSP tractability. In
Proceedingsof CP’04 , pages 182–196, 2004.[13] V. Dalmau. Linear datalog and bounded path duality of relational structures.
Logical Methods in ComputerScience , 1(1), 2005.[14] V. Dalmau and A. Krokhin. Majority constraints have bounded pathwidth duality.
European Journal on Combi-natorics , 29(4):821–837, 2008.[15] V. Dalmau and J. Pearson. Closure functions and width 1 problems.
Proceedings of CP’99 , pages 159–173,1999.[16] R. Debruyne and C. Bessiere. Some practicable filtering techniques for the constraint satisfaction problem. In
Proceedings IJCAI’97 , pages 412–417, 1997.[17] A. del Val. On 2-sat and renamable horn. In
AAAI/IAAI 2000 , pages 279–284, 2000.[18] T. Feder and M. Vardi. The computational structure of monotone monadic SNP and constraint satisfaction: Astudy through Datalog and group theory.
SIAM Journal on Computing , 28:57–104, 1999.[19] P. M. Idziak, P. Markovic, R. McKenzie, M. Valeriote, and R. Willard. Tractability and learnability arising fromalgebras with few subpowers. In
Proceedings of LICS’07 , pages 213–224, 2007.1720] P. Jeavons, D. Cohen, and M. Cooper. Constraints, consistency and closure. AI , 101(1-2):251–265, 1998.[21] B. Larose and P. Tesson. Universal algebra and hardness results for constraint satisfaction problems. Theoret.Comput. Sci. , 410:1629–1647, 2009.[22] B. Larose and L. Z´adori. Bounded width problems and algebras.
Algebra Universalis , 56(3-4):439–466, 2007.[23] A. Szendrei.
Clones in Universal Algebra , volume 99 of