3.2 Definitions and results on CSPs
3.2.1 The computational problem
Recall the definitions introduced in Section 2.2. Let us say we have as inputs PP sentences
ϕ over a structure Γ and the problem is whether ϕ is satisfied in Γ. Many constraint
satisfaction problems can be formalised in this way [17, 18, 21, 15] by choosing an appropriate structure. In this context, the constraints are syntactic objects (the conjuncts of ϕ). We give a formal definition.
Let Γ be a Σ-structure. Recall that PP formulae ϕ over Γ are first-order formulae of the form
∃x1, . . . , xp.ψ1∧ . . . ∧ ψ`,
where each ψi, 1 ≤ i ≤ `, is of the form R(x1, . . . , xk) or x = y, with R a relation symbol from Σ where arity(R) = k. From here on, for a fixed relational structure Γ over a signature Σ, here termed a constraint language or a template,1 we use the following definition:
CSP(Γ)
Input: a PP sentence ϕ over Γ
Question: Γ |= ϕ ?
A satisfying assignment for an instance ϕ ∈ CSP(Γ) is called a solution for ϕ.
Another usual way of defining CSPs is in terms of homomorphisms. Let Γ, Γ0 be Σ-structures. Then a homomorphism from Γ to Γ0 is a function f from dom(Γ) to dom(Γ0) such that for each n-ary relation symbol R in Σ and each n-tuple ¯t ∈ RΓ, we
have that (f (a1), . . . , f (an)) ∈ RΓ
0
. If f is injective (surjective, bijective) we say that f is an injective (surjective, bijective) homomorphism. A bijective homomorphism from a structure Γ to itself is called an automorphism of Γ. If structures Γ, Γ0 are such that there is homomorphism from Γ to Γ0 and a homomorphism from Γ0 to Γ, then we say that Γ is homomorphically equivalent to Γ0. An endomorphism Γ is a homomorphism from Γ to itself. Given an injective homomorphism h from Γ to Γ0 that preserves the complement of each relation, we say that h is an embedding. Finally, a structure Γ is called a core if all its endomorphisms are also embeddings.
For finite structures, the following results are useful:
Proposition 3.2.1. ([58]) Let Γ be a finite structure. Then Γ is homomorphically
equivalent to a unique (up to isomorphism) core Γ0.
Proposition 3.2.2. ([58]) Let Γ, ∆ be finite structures and Γ0, ∆0 be the cores of Γ and
∆, respectively. Then there is a homomorphism from Γ to ∆ if, and only if, there is a
homomorphism from Γ0 to ∆0.
We illustrate this with a very simple example.
Example 3.2.3. Let Γ = ({1, 2, 4, 5}, succ), where succ := {(x, y) ∈ (dom(Γ))2| x + 1 = y}. Also let Γ0 = ({1, 2}, succ). Then Γ and Γ0 are homomorphically equivalent. To check this, let h : dom(Γ) → dom(Γ0) such that h(1) = h(4) = 1, h(2) = h(5) = 2; and let
g : dom(Γ0) → dom(Γ) such that g(1) = 4, g(2) = 5. Also, Γ0 is a core and it is unique, up to isomorphism; that is, Γ0 is isomorphic to any other core of Γ.
Now consider the following fundamental algebraic problem. Fix a Σ-structure Γ. Then CSP(Γ) is the problem to decide, given a Σ-structure Γ0, whether there is a homomorphism
h : Γ0 → Γ. This is a traditional way of defining CSPs, see [50]. The following example illustrates this.
3.2 Definitions and results on CSPs Example 3.2.4. Analogously to the definition of homomorphism given above, a digraph
homomorphism of a directed graph G = (VG, EG) to a directed graph H = (VH, EH) is a function h from VG to VH where for each edge (v, w) ∈ EG we have (h(v), h(w)) ∈ EH. Now fix a directed graph H. Then the digraph homomorphism problem is, given a directed graph G, whether a digraph homomorphism h : G → H can be found. It can be cast as a homomorphism problem as above and is refered to in the combinatorial literature as H-COLOURING [59]. This decision problem generalises k-COLOURING, which is the problem to decide, given an undirected graph G, whether we can assign one out of k possible colours to each vertex in such a way that no two adjacent vertices share the same colour. To see this, let Kn denote the complete loopless undirected graph on n vertices. If there is a homomorphism from a graph G to Kn, then G is n-colourable. The converse also holds. Equivalently, G is a “yes”-instance of CSP(Kn). In other words, a graph G is n-colourable iff there is a homomorphism from G to Kn.
We can recast the problem from Example 3.2.4 again as a CSP for a relational structure and a PP sentence instead. Let H = (VH, EH) be a digraph and G = (VG, EG) be an input to H-COLOURING. To encode the problem we simply translate H into a relational structure ΓH = (VH, EH) and G into a PP sentence ϕG over ΓH, which we encode using the form ∃¯xV
(i,j)∈EGEH(xi, xj). Then G is an instance of H-Colouring
iff ΓH |= ϕG. For instance, let H = (VH, EH) be a digraph with VH = {1, 2, 3, 4} and
EH = {(1, 3), (1, 4), (2, 3)} and G = (VG, EG) be a digraph with VG= {1, 2, 3} and EG= {(1, 2), (1, 3)}. Construct the PP sentence ϕG = ∃x1, x2, x3(EH(x1, x2) ∧ EH(x1, x3)).
Then clearly ΓH |= ϕG, for e.g. the assignment α given by α(x1) = 1, α(x2) = 3, α(x3) =
4 makes ϕG true in ΓH.
Here is another typical problem that can be defined in this way. Example 3.2.5. Let Γlin = (D, R1
lin, R2lin, . . . ) where D is any field (for instance, simply R or the field of p-adic numbers for p a prime number) and each Rlini is a ki-ary relation defined as follows:
Rilin := {(xi1, . . . , xiki) ∈ Dki | ai
1xi1+ . . . + aikxiki = r i},
where all ai1, . . . , aiki, ri ∈ D. An instance of CSP(Γlin) is a system of linear equations
p1, . . . , pm. A solution, when it exists, is a satisfying assignment to the variables; that is, a mapping from all tuples of ki variables in all pi to Dki, for 1 ≤ i ≤ m, such that
ti ∈ Rilin holds for each resulting ki-tuple ti⊆ Dki.
We finish this section by defining reductions between CSPs, a notion that will be used next.
Definition 3.2.6. Given templates Γ, Γ0 we say that CSP(Γ) polynomially reduces
to CSP(Γ0), in symbols CSP(Γ) ≤p CSP(Γ0), if there is a polynomial-time algorithm that transforms any instance ψ of CSP(Γ) into an instance ψ0 of CSP(Γ0) such that
ψ ∈ CSP(Γ) if, and only if, ψ0 ∈ CSP(Γ0). We say that CSP(Γ) is polynomially equivalent
to CSP(Γ0), in symbols CSP(Γ) ≡p CSP(Γ), if it is the case that CSP(Γ) ≤p CSP(Γ0) and CSP(Γ0) ≤pCSP(Γ).