# User manual | DIPLOMOV´ A PR ´ ACE Jakub Bul´ın ```Univerzita Karlova v Praze
Matematicko-fyzikálnı́ fakulta
DIPLOMOVÁ PRÁCE
Jakub Bulı́n
Algebraický přı́stup k CSP
(The Algebraic Approach to CSP)
Katedra algebry
Vedoucı́ diplomové práce: Mgr. Libor Barto, Ph.D.
Studijnı́ program: Matematika, matematické struktury
2010
Expression of gratitude
I would like to thank the following people:
- My supervisor Libor Barto for introducing me to such interesting
topic, for being the outstanding source of inspiration and for his
patient guidance through all the difficulties.
- Petar Marković for the great lecture on CSP during his stay in
Prague.
- Miklós Maróti for his valuable comments during my visit in Szeged.
- My dear colleagues Alexandr Kazda and Anša Lauschmannová for
always being a great motivation to me.
- Miss Klára Krejčı́čková for brightening up the days of my work on
this thesis.
- And most importantly, my parents, who have been supporting me
during my studies in so many ways.
During writing this thesis I was supported by the Grant Agency of
Charles University, grant no. 67410.
Prohlašuji, že jsem svou diplomovou práci napsal samostatně a výhradně
s použitı́m citovaných pramenů. Souhlası́m se zapůjčovánı́m práce a jejı́m
zveřejňovánı́m.
V Praze dne 25. července 2010
Jakub Bulı́n
2
Contents
0 Introduction
6
I
9
The Constraint Satisfaction Problem
1 Preliminaries
1.1 Relational structures
1.2 Digraphs . . . . . . .
1.3 Oriented trees . . . .
1.4 Algebras, operations
.
.
.
.
10
10
11
12
14
.
.
.
.
15
15
16
17
18
3 Algebraic approach to CSP
3.1 Compatible operations . . . . . . . . . . . . . . . . . . . .
3.2 Weak near-unanimity . . . . . . . . . . . . . . . . . . . . .
3.3 Algebraic tools . . . . . . . . . . . . . . . . . . . . . . . .
21
21
22
23
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
2 Constraint satisfaction problem
2.1 The definition(s) . . . . . . . . . .
2.2 Examples . . . . . . . . . . . . . .
2.3 Complexity of CSP: the dichotomy
2.4 Bounded width . . . . . . . . . . .
4 CSP
4.1
4.2
4.3
II
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
and digraphs
25
H-coloring problem . . . . . . . . . . . . . . . . . . . . . . 25
Known results . . . . . . . . . . . . . . . . . . . . . . . . . 26
CSP and oriented trees . . . . . . . . . . . . . . . . . . . . 27
29
30
5.1 The definition . . . . . . . . . . . . . . . . . . . . . . . . . 30
3
4
CONTENTS
5.2
5.3
5.4
5.5
5.6
The dichotomy theorem . . . .
Preliminary results . . . . . . .
Reduction to A(T) . . . . . . .
A(T) and compatible weak-NUs
Q.E.D . . . . . . . . . . . . . .
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
31
32
34
38
42
43
6.1 From A(T) back to T . . . . . . . . . . . . . . . . . . . . . 43
6.2 An interesting special polyad . . . . . . . . . . . . . . . . . 46
7 Conclusion
50
Bibliography
51
Název práce: Algebraický přı́stup k CSP
Autor: Jakub Bulı́n
Katedra (ústav): Katedra algebry
Vedoucı́ bakalářské práce: Mgr. Libor Barto, Ph.D.
E-mail vedoucı́ho: [email protected]
Abstrakt: Necht’ A je konečná relačnı́ struktura. Problém splňovánı́
omezenı́ s šablonou A, CSP(A), rozhoduje, zda vstupnı́ struktura X je
homomorfnı́ A. Hypotéza o dichotomii CSP Federa a Vardiho řı́ká, že
CSP(A) je vždy bud’ v P nebo NP-úplný. V prvnı́ části představı́me
algebraický přı́stup k CSP a shrneme známé výsledky o CSP pro orientované grafy, tzv. H-barvenı́. Ve druhé části se zabýváme jistou třı́dou
orientovaných stromů, tzv. speciálnı́mi polyádami. Pomocı́ algebraického přı́stupu potvrdı́me dichotomickou hypotézu pro speciálnı́ polyády.
V polynomiálnı́m přı́padě poskytneme jemnějšı́ popis a zkonstruujeme
speciálnı́ polyádu T takovou, že CSP(T) je v P, ale T nemá šı́řku 1 ani
žádné near-unanimity polymorfismy.
Klı́čová slova: Problém splňovánı́ omezenı́, barvenı́ grafů, konečná šı́řka,
speciálnı́ triáda.
Title: The Algebraic Approach to CSP
Author: Jakub Bulı́n
Department: Department of Algebra
Supervisor: Mgr. Libor Barto, Ph.D.
Abstract: For a finite relational structure A, the Constraint Satisfaction
Problem with template A, or CSP(A), is the problem of deciding whether
an input relational structure X admits a homomorphism to A. The CSP
dichotomy conjecture of Feder and Vardi states that for any A, CSP(A)
is either in P or NP-complete. In the first part we present the algebraic
approach to CSP and summarize known results about CSP for digraphs,
also known as the H-coloring problem. In the second part we study a class
of oriented trees called special polyads. Using the algebraic approach we
confirm the dichotomy conjecture for special polyads. We provide a finer
description of the tractable cases and give a construction of a special
polyad T such that CSP(T) is tractable, but T does not have width 1
Keywords: Constraint satisfaction problem, graph coloring, bounded
5
Chapter 0
Introduction
Let A be a fixed finite relational structure. The Constraint Satisfaction
Problem with template A, or CSP(A) for short, is the following decision
problem:
INPUT: A relational structure X (of the same type as A).
QUESTION: Is there a homomorphism from X to A?
This class of problems has recently recieved a lot of attention, mainly
because of the work of Feder and Vardi  from 1998. In this article
the authors conjectured a large natural class of NP decision problems
avoiding the complexity classes between P and NP-complete (assuming
that P6=NP). Many natural decision problems, such as k-SAT, graph kcolorability or solving systems of linear equations over finite fields belong
to this class. The following conjecture which became the most famous
open question in the study of CSP is the central theme of this thesis:
The CSP dichotomy conjecture. For each relational structure A,
CSP(A) is in P or NP-complete.
For brevity, we sometimes say that a relational structure A is tractable
if CSP(A) is tractable and NP-complete if CSP(A) is NP-complete.
The algebraic approach to CSP was invented by Jeavons, Cohen and
Gyssens  and later refined by Bulatov, Jeavons and Krokhin . It
led to an immediate breakthrough in the study of CSP and brought a
rapid development of the subject and a plenty of new results heading
towards the dichotomy conjecture (see , ,  and a survey ).
The revelation of a very strong connection between CSP and universal
algebra allowed to apply deep algebraic tools, namely tame congruence
theory.
6
CHAPTER 0. INTRODUCTION
7
At the core of the algebraic approach to CSP lies the concept of compatible operation or polymorphism, a generalization of homomorphism,
and the fact that the complexity of CSP(A) depends only on the polymorphisms of A. If a structure has ”nice” polymorphisms, then the corresponding CSP is tractable.
A relational structure A is said to have bounded width if CSP(A) can
be solved by a certain polynomial-time algorithm called Local consistency checking (see ). In , Larose and Zádori conjectured a full
characterization of relational strucutres of bounded width. This conjecture was recently confirmed by Barto and Kozik . Our work relies
heavily on their result that relational structures with compatible weak
near-unanimity operations of almost all arities have bounded width (see
Theorem 3.6); as far as we know, our proof of the CSP dichotomy for
special polyads (see Chapter 5) was the first application of the above
result.
In this work we concentrate on CSPs whose template structures are
digraphs. For a digraph H, CSP(H) is also known as H-coloring problem. The complexity of H-coloring has been extensively studied in graph
theory for almost 40 years. In , Feder and Vardi proved that each relational structure can be encoded into a digraph so that the corresponding
CSPs are equivalent; hence the dichotmy conjecture for digraphs implies
the general case.
The dichotomy was established for a number of special cases, including oriented paths (which are all tractable) , oriented cycles ,
undirected graphs  and many others. Using the algebraic approach,
Barto, Kozik and Niven  established the CSP dichotomy for smooth
digraphs (i.e., digraphs such that each vertex has an incoming and an
outgoing edge).
In the class of all digraphs, oriented trees are in some sense very far
from smooth digraphs. Except the oriented paths, the simplest class of
oriented trees are the triads (i.e., oriented trees with one vertex of degree
3 and all other vertices of degree 1 or 2). Though even for triads the
dichotomy conjecture remains open, it was confirmed by Barto, Kozik,
Maróti and Niven  for the so-called special triads, a certain class of
triads possessing sufficient structure to make the problem amenable. It
turned out that each special triad is either NP-complete, or has width 1,
or admits a compatible majority (ternary near-unanimity) operation.
In this work we establish the CSP dichotomy conjecture for special
that each special polyad is either NP-complete or has bounded width.
CHAPTER 0. INTRODUCTION
8
Moreover, we characterize special polyads of width 1 as those whose core
admits a binary idempotent commutative polymorphism.
We concentrated on special polyads for several reasons. Although
special polyads do possess the same kind of structure as special triads,
allowing us to apply some of the techniques used in , it was not obvious whether the results from  can be extended to them. We were also
interested in the following question: Will every tractable special polyad
be tractable for a ”simple” reason, by which we mean satisfying some
strong conditions ensuring tractability (e.g., possessing a compatible majority or near-unanimity operation or having width 1)? The answer to
this question is negative. We construct a tractable core special polyad
T which does not have width 1 and admits no near-unanimity polymorphisms (and thus, by a recent result of Barto , the variety generated
by the algebra of polymorphisms of T is not congruence distributive).
The first part of this thesis serves as a brief summary of the basics of
the Constraint Satisfaction Problem and the algebraic approach to CSP.
In Chapter 1 we define several notions and notation used throughout the
text. Chapter 2 introduces the Constraint Satisfaction Problem and the
dichotomy conjecture. We provide several examples of problems expressible as CSPs and then discuss the notion of bounded width and the Local
consistency checking algorithm. Chapter 3 presents elements of the algebraic approach to CSP and the algebraic tools which will be needed
later in the second part. Chaper 4 summarizes known results on CSP for
digraphs and puts into context special polyads treated in Part II.
In the second part we study special polyads. Chapter 5 contains the
proof of the dichotomy and characterization of width 1. In Chapter 6
we present a method of constructing special polyads with certain desired
properties, using the techniques developed for the proof of the dichotomy.
We apply this method to obtain a tractable core special polyad T which
does not have width 1 and admits no near-unanimity polymorphisms.
Part I
The Constraint Satisfaction
Problem
9
Chapter 1
Preliminaries
In this chapter we define several notions and notation which will be used
throughout the text.
1.1
Relational structures
An r-ary relation R on a set A is a subset R ⊆ Ar ; r is called the arity
of R and denoted ar(R). The definition of the Constraint Satisfaction
Problem is based on the notion of relational structure. All relational
structures in this thesis are assumed to be finite.
Definition 1.1. A (finite) relational structure is a tuple
A = hA, R1 , . . . , Rn i
where A is a finite set and R1 ,. . . ,Rn are relations on A.
Two relational structures A = hA, R1 , . . . , Rn i, B = hB, S1 , . . . , Sm i
are of the same type if n = m and ar(Ri ) = ar(Si ) for every i. In
such situation, a mapping f : A → B is a homomorphism from A
to B if it preserves all the relations, i.e., for every i and every tuple
ha1 , . . . , aar(Ri ) i ∈ Ri we have hf (a1 ), . . . , f (aar(Ri ) )i ∈ Si . We say that A
is homomorphic to B if there exists a homomorphism A → B.
A relational structure A is a core if every homomorphism A → A is
bijective (i.e., an isomorphism). For each relational structure A there
exists a unique (up to isomorphism) core structure A′ such that A ↔ A′ .
Such a structure A′ is called the core of A and denoted core(A). For any
relational structure X, X → A if and only if X → A′ .
For C ⊆ A, the structure A[C] = hC, R1 ∩ C ar(R1 ) , . . . , Rn ∩ C ar(Rn ) i
is the substructure induced by C.
10
11
CHAPTER 1. PRELIMINARIES
1.2
Digraphs
A directed graph, often abbreviated as digraph, can be viewed as a relational structure with just one relation, the binary edge relation. (In
this context, the usual combinatorial notion of (undirected) graph means
a symmetric digraph without loops, i.e., a digraph such that its edge
relation is symmetric and irreflexive.)
Definition 1.2. A digraph G = (G, E) is a set of vertices G together
with a binary relation E ⊆ G2 , the edge relation. For ha, bi ∈ E we write
G
a−
→
b or simply a → b when there is no danger of confusion.
The definition of homomorphism and core for digraphs is similar as
for general relational structures:
Let G and H be digraphs. A mapping f : G → H is a (digraph)
homomorphism from G to H, if it preserves the edges, i.e., for all a, b ∈ G
G
H
such that a −
→
b we have f (a) −
→
f (b). A digraph G is a core, if every
homomorphism G → G is bijective. Again, we denote by core(H) the
unique (up to isomorphism) core digraph H′ such that H ↔ H′ . The
digraph in the figure below contains two isomorphic copies of its core,
marked by ◦’s and ∗’s:
•
•
gOOO
OOO
OOO
◦O
/◦
◦o
◦
o7 • OOOO
OOO
ooo
o
o
OO'
ooo
∗O
/∗O
OOO
OOO
OO'
•
∗o
∗
Figure 1.1: The core of a digraph.
A digraph G′ is a subgraph of G (we write G′ ⊆ G) if G′ ⊆ G and
E ′ ⊆ E. If E ′ = E ∩ G′ 2 , then G′ is an induced subgraph of G (or a
subgraph induced by G′ ), denoted by G[G′ ].
Qn Let G1 , . . . , Gn be digraphs. The product of G1 , . . . , Gn is the digraph
i=1 Gi = (G1 × · · · × Gn , E) where hā, b̄i ∈ E iff hai , bi i ∈ Ei for each
i = 1, . . . , n.
An oriented path of length n is a digraph P = (P, E) with pairwise
distinct vertices P = {v0 , v1 , . . . , vn } and edges E = {e0 , e1 , . . . , en−1 }
such that ei ∈ {hvi , vi+1 i, hvi+1 , vi i} for each i. The vertex v0 is called the
initial vertex, denoted by init(P), and vn is called the terminal vertex,
denoted by term(P).
12
CHAPTER 1. PRELIMINARIES
•
init P = v0
/•
v1
/•o
v2
•
v3
/•o
v4
···
/•
vn = term P
Figure 1.2: An oriented path.
A directed path is an oriented path such that vi−1 → vi for i = 1, . . . , n.
An oriented cycle is a digraph which can be obtained from an oriented
path by identifying its initial and terminal vertex. A circle (or directed
cycle) is a digraph which can be obtained from directed path by identifying its initial and terminal vertex.
Let G = (G, E) be a digraph and a, b ∈ G. We say that a is connected
to b in G via a path P if P ⊆ G, a = init(P) and b = term(P). By
the distance of two connected vertices a, b (denoted distG (a, b)) we mean
the minimal length of an oriented path connecting a to b. The relation
of connectedness is an equivalence relation on G. Its classes are called
components of connectivity. G is connected if each two vertices a, b ∈ G
are connected.
For a vertex a ∈ G, The indegree (deg− (a)), outdegree (deg+ (a)) and
degree (deg(a)) are defined as follows:
deg− (a) = |{b : hb, ai ∈ E},
deg+ (a) = |{b : ha, bi ∈ E},
deg(a) = deg− (a) + deg+ (a).
A vertex a ∈ G is a source if deg− (a) = 0 and a sink if deg+ (a) = 0.
A digraph is smooth if it does not have any sources or sinks.
1.3
Oriented trees
A digraph T = (T, E) is called an oriented tree if for each a, b ∈ T there
exists precisely one path connecting a to b. (Alternatively, an oriented
tree is a digraph which can be obtained from an undirected tree, i.e.,
connected undirected graph without cycles, by orienting its edges.)
Let T = (T, E) be an oriented tree. There exists a unique mapping
lvl : T → N ∪ {0} satisfying the following conditions:
(i) If a → b, then lvl(b) = lvl(a) + 1.
(ii) There exists a vertex a ∈ T with lvl(a) = 0.
13
CHAPTER 1. PRELIMINARIES
For a ∈ T , lvl(a) is called the level of a. The height of T, denoted by
hgt(T), is the highest level of a vertex in T. For any i ≥ 0 we define the
set
LevelT (i) = {a ∈ T : lvl(a) = i}
(dropping the index when T is known from the context).
The following notion plays a crucial role in Chapter 5.
Definition 1.3. An oriented path P is minimal if it satisfies the following:
(i) lvl(init(P)) = 0,
(ii) lvl(term(P)) = hgt(P),
(iii) 0 < lvl(v) < hgt(P) for all v ∈ P \ {init(P), term(P)}.
For an illustration of the definition see Figure 1.3 below.
term(P)
D•
•
D
•
•
D
D Z444
44
4 •
•
•
D Z444
D Z444
44
44
4
4 •
• Z4
•
•
44
D
D Z444
44
44
4 4 •
•
D
•
•
init(P)
Figure 1.3: A minimal path of height 4.
Lemma 1.4. Let P1 , . . . , Pn be minimal paths of the same height l.
There exists a minimal path Q of height l homomorphic to all the paths
P1 , . . . , Pn .
Proof. The proof is easy (see , Lemma 2.36).
CHAPTER 1. PRELIMINARIES
1.4
14
Algebras, operations
An r-ary operation on a set A is a mapping f : Ar → A. By an algebra we
mean a structure A = hA, F i, where A is a nonvoid set (the universe of
A) and F , the set of basic operations of A, is a set of finitary operations
on A (i.e., for each f ∈ F there exists r ≥ 0 such that f : Ar → A).
A term operation of an algebra A is any operation which can be
obtained by composing basic operations of A and the projection operations (i.e., the operations pir (r ∈ N, 0 ≤ i < r) satisfying pir (x0 , . . . ,
xr−1 ) = xi ).
Throughout the text, we will occasionally mention some notions standard in universal algebra. For definitions and an elaborate treatment see
for example .
Chapter 2
Constraint satisfaction
problem
In this chapter we will give the definition of the Constraint satisfaction
problem and provide several examples. Then we will discuss its computational complexity, introducing the famous CSP dichotomy conjecture,
and present two algorithmical approaches that solve certain large classes
of CSPs in polynomial time. The last section is devoted to the notion of
bounded width which will play an important role later.
2.1
The definition(s)
As Constraint Satisfaction Problems naturally arise in various fields of
mathematics and computer science, there are several equivalent ways to
define them. We will use the following so-called ”combinatorial”definition
of CSP:
Definition 2.1 (The Constraint Satisfaction Problem). Let A be a
relational structure. The Constraint satisfaction problem with template
A, CSP(A) for short, is the following decision problem:
INPUT: A relational structure X (of the same type as A).
QUESTION: Is there a homomorphism from X to A?
In the context of CSP, such a homomorphism is often called a solution.
The above definition is the most suitable for our purposes, namely for
the algebraic approach to CSP.
The term ”constraint satisfaction” comes from the following so-called
”Variable-Value” definition which originated in computer science, namely
in the field of artificial intelligence.
15
CHAPTER 2. CONSTRAINT SATISFACTION PROBLEM
16
The Variable-Value definition of CSP. Let D be a finite set (the
domain; elements of D are values) and Γ a finite collection of relations
on D (the basis). CSP(D, Γ) is the following decision problem:
INPUT: V – a finite set of variables,
C = {C1 , . . . , Cm } – a finite set of constraints;
each constraint Ci is a tuple (s̄i , Ri ), where s̄i is
a ki -tuple of variables (the scope of Ci ) and Ri ⊆
Dki is a relation from Γ.
QUESTION: Is there a solution, i.e., ϕ : V → D such that
ϕ(s̄i ) ∈ Ri ?
Informally speaking, in the above definition CSP(D, Γ) asks if there
exists a way to evaluate the variables without violating any constraints;
in each constraint the list of permitted evaluations must come from the
basis (which is fixed in advance).
Another approach to define CSP is via mathematical logic. The next
definition was motivated by database theory (conjunctive queries).
The definition of CSP via logic. Let L be a first-order language constisting of finitely many relational symbols and let Γ be an L-structure.
Then CSP(Γ) is the following decision problem:
INPUT: A primitive positive L-sentence ϕ (i.e., an existentially closed conjunction of predicates).
QUESTION: Does ϕ hold in Γ?
It is not hard to prove that the above three definitions are equivalent.
2.2
Examples
In this section we provide a few examples of decision problems which can
be formulated as CSPs. For each example we give an idea how to encode
the problem into the language of CSP. The list below is by no means
complete, the problems were chosen to demonstrate the diversity of the
problems expressible as CSPs.
Boolean formula satisfiability
Example (k-SAT). Let k be fixed.
INPUT: A propositional formula ϕ in conjunctive normal
form such that each clause has at most k literals.
QUESTION: Is ϕ satisfiable?
CHAPTER 2. CONSTRAINT SATISFACTION PROBLEM
17
It is easy to construct a structure A such that the above problem is
equivalent to CSP(A). Its base set will be {0, 1} and for each type of
clause it will have one k-ary relation, consisting of just one tuple: the
only possible evaluation of that clause.
Solving linear equations over a finite field F
Example (k-SysLinEq). Let k and F be fixed.
INPUT: A finite system of linear equations over F in k
variables.
QUESTION: Is there a solution?
This problem is equivalent to CSP(A) for a relational structure A
whose base set is the universe of F and whose relations are all affine
subspaces of Fk .
Graph coloring
Example (k-COL).
INPUT: A graph G.
QUESTION: Is there a way of coloring the vertices of G so that
no two adjacent vertices have the same color?
A graph G is k-colorable if and only if it is homomorphic to Kk (the
complete graph on k vertices).
2.3
Complexity of CSP: the dichotomy
The key question in the study of CSPs is their computational complexity.
It is easily seen that each CSP is in NP:
Observation. For each relational structure A, CSP(A) is in NP.
Proof. Given a relational structure X (of the same type as A) and a mapping f : X → A, it can be easily verified whether f is a homomorphism
in a time polynomial in the size of the encoding of X.
Notice the following fact, which follows directly from the definition of
core. It implies that when investigating CSPs, we can restrict ourselves
to core structures.
Observation. For each relational structure A, CSP(A) is equivalent to
CSP(core(A)). In particular, they have the same computational complexity.
CHAPTER 2. CONSTRAINT SATISFACTION PROBLEM
18
In their celebrated paper , Feder and Vardi formulated the following conjecture which became the most famous open question in the study
of CSP (and which is a central theme of this thesis):
The CSP dichotomy conjecture. For each relational structure A,
CSP(A) is in P or NP-complete.
So far, the dichotomy has been confirmed in many special cases: for
CSPs over two-element  and three-element  domains, conservative
CSPs  (i.e., such that the template contains all unary relations, which
allows us to restrict possible values for every variable; such problems are
also called list homomorphism problems) and many more. The known
partial results in the case of CSP(H) where H is a digraph (also known
as H-coloring problem) will be discused in Chapter 4.
As for the examples from Section 2.2,
• k-SAT is tratable for k = 1, 2 and NP-complete else; by a famous
result of Cook (1971) and Levin (1973),
• k-SysLinEq is tractable for every k (Gaussian elimination works in
polynomial time),
• k-COL is tractable for k = 1, 2 and NP-complete else.
There are two main polynomial-time algorithms (or algorithmical approaches) both of which solve large classes of CSPs. One of them generalizes the Gaussian elimination and can be used for CSPs with so-called
”few subpowers”. A relational structure A has few subpowers if there exists a polynomial p(x) such that the algebra of compatible operations of
A (see Section 3.1) has for each n > 0 at most 2p(n) subalgebras (see 
for details). A typical problem solvable by the ”few subpowers” algorithm
is k-SysLinEq.
The other one, the Local consistency checking algorithm, will be
treated in the next section. It is widely believed that all tractable CSPs
can be solved by a certain combination of these two algorithms. All
tractable CSPs that we encounter in this thesis are, in fact, solvable by
the Local consistency checking algorithm.
2.4
Bounded width
Bounded width can be defined in several ways (bounded tree-width duality, solvability in Datalog, pebble games). We will introduce the approach
via (k, l)-strategies.
CHAPTER 2. CONSTRAINT SATISFACTION PROBLEM
19
Let A = hA, R1 , . . . , Rn i and X = hX, S1 , . . . , Sn i be relational structures of the same type and let L ⊆ X. A mapping f : L → A is a partial
homomorphism from X to A if it is a homomorphism from the induced
substructure X[L] to A.
Definition 2.2. Let k ≤ l be positive integers. A nonempty family
[
F=
FL
L⊆X,|L|≤l
of partial homomorphisms from X to A is called a (k, l)-strategy for (X, A)
if it satisfies the following:
(S0) dom(f ) = L for each f ∈ FL .
(S1) For any f ∈ FL and K ⊆ L the function f |K belongs to FK .
(S2) If K ⊆ L ⊆ X with |K| ≤ k, |L| ≤ l and f ∈ FK , then there exists
g ∈ FL such that g|K = f .
It is easy to see that if there exists a homomorphism from X to A,
then there exists a (k, l)-strategy for (X, A). A is said to have bounded
width if the converse is true for some k ≤ l:
Definition 2.3. Let A be a relational structure.
• A has width (k, l) if the following is true: For each X, if there exists
a nonempty (k, l)-strategy for (X, A), then X is homomorphic to A.
• A has bounded width if it has width (k, l) for some k ≤ l.
• A has width 1 if it has width (1, k) for some k ≥ 1.
Informally speaking, a (k, l)-strategy is a family of ”locally consistent”
partial solutions and A has width (k, l) if we can recover a solution from
each (k, l)-strategy targeting A.
The notion of width (k, l) (bounded width, width 1) cannot distinguish between homomorphically equivalent structures; if there exists a
nonempty (k, l)-strategy for (X, A) and A is homomorphic to B, then
there also exists a nonempty (k, l)-strategy for (X, B). We will use this
fact for cores:
Observation. Let A be a relational structure. A has width (k, l) if and
only if core(A) has width (k, l).
CHAPTER 2. CONSTRAINT SATISFACTION PROBLEM
20
We will now introduce the Local consistency checking algorithm,
which solves CSPs of bounded width in polynomial time. Let A be a
relational structure of width (k, l). The idea is simple: Take all partial homomorphisms from X to A with at most l-element domain. Then
throw away one by one those which falsify conditions (S1) or (S2). We
end up with the biggest (k, l)-strategy, which is nonempty if and only if
there exists a homomorphism from X to A.
The (k, l)-consistency checking algorithm
A structure X of the same type as A.
For each L ⊆ X, |L| ≤ l let FL := all partial
homomorphisms from X to A with domain L.
Iteration step: If there exist f ∈ F falsifying (S1) or (S2), remove
f from F.
Output:
If F = ∅, return NO, else return YES.
Input:
Initial step:
Lemma 2.4. The (k, l)-consistency checking algorithm runs in polynomial time.
Proof. We have at most |X|l · |A|l = O(|X|l ) partial mappings. In the
initial step we verify for each of them if it is a partial homomorphism;
this can be done in polynomial time. The number of iterations is O(|X|l );
as in each iteration we remove one partial homomorphism from F. In
every iteration step we simply go through F and for each f ∈ F check if
(S1) and (S2) holds; this is tractable as well.
More about bounded width and Local consistency checking can be
found in ,  and .
Chapter 3
Algebraic approach to CSP
In this chapter we introduce the ”algebraic approach” to the Constraint
Satisfaction Problem and present the algebraic tools which will be used
later in the text. At the core of the algebraic approach to CSP lies the
concept of compatible operation.
3.1
Compatible operations
In this section we define the notion of compatible operation (polymorphism). Note that the unary operations compatible with a relational
structure A are precisely the endomorphisms A → A. Recall that by an
r-ary operation on a set A we wean a mapping Ar → A.
Definition 3.1. Let R be a k-ary relation and f an r-ary operation on a
set A. We say that f is compatible with R if whenever ha1i , . . . , aki i ∈ R
for i = 1, . . . , r we have hf (a11 , . . . , a1r ), . . . , f (ak1 , . . . , akr )i ∈ R.
The above condition means that if we arrange elements of A into a
matrix such that its columns are tuples from R and apply f on the rows
of that matrix, the resulting column must belong to R as well.
Definition 3.2. Let A = (A, R1 , . . . , Rn ) be a relational structure and
let f be an operation on A. We say that f is compatible with A (or
f is a polymorphism of A) if it is compatible with all the relations Ri ,
i = 1, . . . , n.
Remark. Using the language of universal algebra, the above definition
can be formulated as follows: an operation f is compatible with A if for
each i, Ri is a subalgebra of the algebra hA, f iar(Ri ) .
21
CHAPTER 3. ALGEBRAIC APPROACH TO CSP
22
For digraphs the definition is somewhat simpler (see the diagram below the definition):
Definition 3.3. Let H = (H, E) be a digraph. An r-ary operation f
H
on H is compatible with H if whenever ai −
→
bi for i = 1, . . . , r we have
H
f (a1 , . . . , ar ) −
→
f (b1 , . . . , br ).
f (a1
↓
f (b1
a2
↓
b2
...
...
ar )
↓
br )
= a
=⇒ ↓
= b
The fact crucial to the algebraic approach to CSP is that the computational complexity of CSP(A) is fully determined by the polymorphisms
of A (up to log-space reductions). See ,  and  for more details.
3.2
Weak near-unanimity
In this section we introduce some ”nice” polymorphisms connected to the
complexity of CSP.
Definition 3.4. An r-ary operation f on a set A is idempotent if it
satisfies f (a, a, . . . , a) = a for all a ∈ A.
• Let r ≥ 2. An r-ary operation ω on A is called a weak nearunanimity operation (or a weak-NU ), if it is idempotent and satisfies
ω(a, . . . , a, b) = ω(a, . . . , a, b, a) = · · · = ω(b, a, . . . , a)
for all a, b ∈ A. We define the binary operation ◦ω by setting
a ◦ω b = ω(a, . . . , a, b).
• A weak-NU ν of arity ≥ 3 is called a near-unanimity operation
(NU ), if a ◦ν b = a for all a, b ∈ A. A ternary NU is called a
majority operation.
• An r-ary operation τ is totally symmetric idempotent (TSI ), if it
is idempotent and satisfies
τ (a1 , a2 , . . . , ar ) = τ (a′1 , a′2 , . . . , a′r )
whenever {a1 , a2 , . . . , ar } = {a′1 , a′2 , . . . , a′r }. (Note that a totally
symmetric idempotent operation is a weak-NU.)
CHAPTER 3. ALGEBRAIC APPROACH TO CSP
23
Remark. It can be easily seen that an operation obtained by composing
operations compatible with A is also compatible with A. In particular, if
ω is a weak-NU operation compatible with A, then ◦ω is also compatible
with A, as we can obtain it by composing ω with the projection operations
(which are indeed compatible with A).
3.3
Algebraic tools
There are many theorems connecting the computational complexity of
CSP(A) with the existence or non-existence of certain types of polymorphisms. In this section we present a few of them; those that are to be used
later in the text. As the algebraic approach to CSP is vividly evolving,
there is no comprehensive list of such theorems. The survey  might
serve as a good starting point.
Our tool to prove NP-completeness of CSPs is the following theorem,
a combination of a result of Bulatov, Jeavons and Krokhin from  and
a result of Maróti and McKenzie .
Theorem 3.5. Let A be a relational structure. If core(A) admits no
compatible weak-NU operations, then CSP(A) is NP-complete.
The algebraic dichotomy conjecture – a strengthening of the conjecture of Feder and Vardi – states that the converse is also true. It can be
formulated as follows:
The algebraic dichotomy conjecture. Let A be a core relational
structure. If A admits a compatible weak-NU operation, then CSP(A)
is tractable, otherwise it is NP-complete.
The ”Bounded width conjecture” of Larose and Zádori which was recently proved by Barto and Kozik  states that a core relational structure A has bounded width if and only if the algebra of polymorphisms
of A generates a congruence meet semi-distributive variety. By a result
of Maróti and McKenzie from , the latter holds for an algebra if and
only if it has weak-NU terms of almost all arities. Hence the following
theorem from , which is our main tool to establish tractability of CSPs:
Theorem 3.6. Let A be a core relational structure. The following conditions are equivalent:
(i) A has bounded width.
CHAPTER 3. ALGEBRAIC APPROACH TO CSP
24
(ii) A admits compatible weak-NU operations of almost all arities (i.e.,
there exists r0 such that for all r ≥ r0 A admits a compatible r-ary
weak-NU).
For a finer description of the tractable CSPs, we will use the following
characterization of structures of width 1 by Dalmau and Pearson :
Theorem 3.7. Let A be a core relational structure. The following conditions are equivalent:
(i) A has width 1.
(ii) A admits compatible totally symmetric idempotent operations of all
arities.
Admitting a near-unanimity polymorphism also ensures tractability,
the proof of the following theorem can be found in .
Theorem 3.8. Let A be a relational structure. If A admits an r-ary
compatible near-unanimity, then A has width (r, r + 1).
Chapter 4
CSP and digraphs
In this chapter we will focus on Constraint Satisfaction Problems such
that the template relational structure is a digraph. In graph theory,
such problems are called H-coloring problems and their computational
complexity has been extensively studied since 1970s. There are several
reasons to restrict to digraphs:
• Digraphs provide a good test field for hypotheses in CSP and an
inspiration for ideas which can be usually generalized. They are
much easier to deal with than general relational structures (one
can ”draw pictures”) while preserving the difficulty and diversity of
general CSPs.
• H-coloring has the same ”computational power” as the general CSP:
Each relational structure can be encoded into a digraph so that
the corresponding CSPs are polynomially equivalent (see  for
proof). Therefore, proving the CSP dichotomy conjecture for digraphs would imply the general case.
• The H-coloring itself is an interesting problem in combinatorics and
theoretical computer science.
4.1
H-coloring problem
Definition 4.1 (The H-coloring problem). Let H be a digraph. The
H-coloring problem is the problem CSP(H), i.e., the following decision
problem:
INPUT: A digraph G.
QUESTION: Is there a homomorphism from G to H?
25
CHAPTER 4. CSP AND DIGRAPHS
26
The following reduction was proved by Feder and Vardi :
Proposition 4.2. For each relational structure A there exists a digraph
H such that the problems CSP(A) and CSP(H) are polynomially equivalent.
The above proposition implies that the CSP dichotomy conjecture is
equivalent to the following:
Conjecture. For each digraph H, CSP(H) is tractable or NP-complete.
Recall that for a digraph H, CSP(H) = CSP(core(H)); and so when
studying CSP we can restrict ourselves to core digraphs.
4.2
Known results
The CSP dichotomy conjecture has been confirmed for a number of
classes of digraphs so far. In this section we will mention some of the
most important results.
Oriented paths
All oriented paths are tractable (see ). Using the algebraic approach,
the proof is quite easy:
Proposition 4.3. Every oriented path has width 1; and thus is tractable.
Proof. Let P = (P, E) be an oriented path. For r ≥ 1 we define an
r-ary operation τr on P by setting τr (a1 , . . . , ar ) to be the vertex from
{a1 , . . . , ar } with minimal distance from the initial vertex of P. It is easy
to see that τr is a totally symmetric idempotent operation compatible
with P. The rest follows by Theorem 3.7.
Oriented cycles
The dichotomy for oriented cycles was proved by Feder in . Each
oriented cycle is either NP-complete or has bounded width.
Undirected graphs
The dichotomy for undirected graphs was established by Hell and Nešetřil
in : an undirected graph is tractable if and only if it is bipartite;
otherwise it is NP-complete. In , Bulatov reproved their result using
algebraic methods and confirmed that it agrees with the algebraic version
of the dichotomy conjecture.
CHAPTER 4. CSP AND DIGRAPHS
27
Smooth digraphs
A digraph is smooth if it does not have any sources or sinks. In , Barto,
Kozik and Niven confirmed the CSP dichotomy for smooth digraphs,
generalizing the above result of Hell and Nešetřil. The core of their proof
is the following theorem:
Theorem 4.4. Let G be a smooth digraph. If G admits a compatible
weak-NU operation, then the core of G is a disjoint union of circles.
A disjoint uninon of circles is tractable; it is not hard to see that
it admits a compatible majority operation. The dichotomy for smooth
digraphs now follows from Theorem 3.5.
4.3
CSP and oriented trees
In the class of all digraphs, oriented trees are in some sense very far from
smooth digraphs; therefore once the dichotomy for smooth digraphs was
proved it was logical to direct attention to oriented trees. Except the
oriented paths (which are ”too easy”), the simplest class of oriented trees
are the triads (i.e., oriented trees with one vertex of degree 3 and all
other vertices of degree 1 or 2). Even for triads the dichotomy remains
an unsolved problem.
In , Hell, Nešetřil and Zhu identified a certain subclass of triads,
which they called special triads, possessing enough structure to deal with
at least some examples. They were able to construct an NP-complete special triad (with 45 vertices; at that time the smallest known NP-complete
oriented tree). Using the most up to date algebraic machinery, Barto,
Kozik, Maróti and Niven  confirmed the CSP dichotomy conjecture
for special triads. They proved that for each special triad T, one of the
following is true (the definition of special triad can be found in Chapter
5):
• T admits a compatible majority operation,
• T admits compatible TSI operations of all arities,
• T admits no compatible weak-NU operation.
Moreover, they provided a structural description of the above three
cases. And, as a by-product, an NP-complete special triad with 39 vertices which is very likely to be the smallest NP-complete oriented tree.
CHAPTER 4. CSP AND DIGRAPHS
28
The rest of this thesis is devoted to a generalization of the above
result to special polyads and problems related to them. A polyad is an
oriented tree with at most one vertex of degree greater than 2. Special
Part II
29
Chapter 5
the dichotomy
In this chapter we investigate special polyads, a certain class of oriented
trees generalizing special triads treated in . We establish the CSP dichotomy conjecture for special polyads, proving that every special polyad
is either NP-complete or has bounded width. Moreover, we characterize special polyads of width 1 as those whose core admits a compatible
binary idempotent commutative operation.
5.1
The definition
called a polyad if at most one of its vertices has degree greater than 2.
Definition 5.1. (i) By a half-branch we mean a minimal path, the
root of the half-branch P is its initial vertex.
(ii) Let P and P′ be two disjoint minimal paths of the same height.
The branch hP, P′ i is the oriented tree obtained by identifying the
terminal vertices of P and P′ into a single vertex. The root of the
branch hP, P′ i is the initial vertex of P.
(iii) Let n, k be nonnegative integers, n + k > 0 and let hPi , P′i i (1 ≤
i ≤ n) and Pn+i (1 ≤ i ≤ k) be n branches and k half-branches
of the same height (pairwise disjoint). The special polyad given by
hP1 , P′1 i, . . . , Pn+k is the oriented tree T obtained by identifying the
roots of hP1 , P′1 i, . . . , Pn+k into a single vertex, the root.
30
CHAPTER 5. SPECIAL POLYADS: THE DICHOTOMY
31
In the following, we will denote the root of T by 0, the initial vertex
of P′i by i and the top-level vertex of hPi , P′i i or Pi by bi (see the figure
below, arrows indicate ”direction” of paths). Let us also define
BaseT = LevelT (0) = {0, 1, . . . , n},
TopT = LevelT (hgt(T)) = {b
1, . . . , n[
+ k}
Half T = {n[
+ 1, . . . , n[
+ k}
and
PathsT = {P1 , P2 , . . . , Pn+k , P′1 , P′2 , . . . , P′n }
(we will usually drop the index T).
1
2
P′1
P′2
...
n
P′n
...
b
1 jTTTTTTT b
2 gOOO
TTTT OOOO
OO
TTT
T
P1
...
+k
j4 n[

jjjj
j

j
j


jj
Pn Pn+1
TTTPT2 OOO
jPn+k
j

j
TTTTOOO
j

TTTOTOO jjjjjj
T jj
n
bO
n[
? +1
0
In our terminology, a special triad from  is a special polyad with 3
branches and no half-branches.
5.2
The dichotomy theorem
The following theorem is the main result of this thesis:
Theorem 5.2. For every special polyad T, CSP(T) is either NP-complete
or tractable. More specifically, let T′ be the core of T.
(i) T has bounded width, if and only if T′ admits a compatible weak
near-unanimity operation, otherwise T is NP-complete.
(ii) T has width 1, if and only if T′ admits a compatible binary weak-NU
(i.e., a binary idempotent commutative operation).
Corollary 5.3. The CSP dichotomy conjecture holds for special polyads.
In order to prove Theorem 5.2, we will need several lemmata.
CHAPTER 5. SPECIAL POLYADS: THE DICHOTOMY
5.3
32
Preliminary results
In the following, for a positive integer n, let [n] = {1, . . . , n}.
First, we will reduce the problem to core special polyads. In the next
two easy lemmata we prove that the core of a special polyad is still a
special polyad and inherits its ”nice” polymorphisms.
Lemma 5.4. Let T be a special polyad with n branches and k halfbranches. Then core(T) is a special polyad with n′ branches and k ′ halfbranches, where n′ ≤ n and k ′ ≤ k.
Proof. It is easily seen that a homomorphism from a minimal path of
height l to an oriented tree of height l maps the initial vertex to a vertex
of level 0 and the terminal vertex to a vertex of level l. The rest follows
directly from this fact.
Lemma 5.5. Let H be a digraph. If H has a compatible r-ary weak-NU
ω, then there exists an r-ary weak-NU ω ′ compatible with core(H) such
that if ω is a NU, then ω ′ is also a NU and if ω is TSI, then ω ′ is also
TSI.
Proof. Let f : H → core(H) and g : core(H) → H be homomorphisms.
Then the homomorphism f ◦ g : core(H) → core(H) is bijective and since
core(H) is finite, there exists k > 0 such that (f ◦ g)k = idcore(H) . For
x̄ ∈ core(H)r we define ω ′ (x̄) = (f ◦ (g ◦ f )k−1 )(ω(g(x1 ), . . . , g(xr ))). The
rest is easy.
In the rest of this section we show that if an oriented tree T has a
compatible partial weak-NU, NU or TSI operation defined for the tuples
of vertices of the same level, it can be easily extended to a full weak-NU,
NU or TSI operation, respectively.
Let A be any set and K ⊆ Ar . By a partial r-ary operation on a set
A with domain K we mean a mapping f : K → A. We define partial
weak-NU, partial NU and partial TSI in an obvious fashion, restricting
the conditions required in Definition 3.4 to tuples from the domain. The
notion of compatibility generalizes to partial operations similarly:
Definition 5.6. Let H = (H, E) be a digraph and let f be a partial r-ary
operation on H with domain K. We say that f is compatible with H if it
H
satisfies the following condition: if ā, b̄ ∈ K and ai −
→
bi for i = 1, . . . , r,
H
then f (ā) −
→
f (b̄).
Lemma 5.7. Let T be an oriented tree.
CHAPTER 5. SPECIAL POLYADS: THE DICHOTOMY
33
(i) Each
operation compatible with T with domain
Shgt T partial weak-NU
r
k=0 Level(k) (i.e., tuples of vertices of the same level) can be
extended to a weak-NU ω ′ ⊇ ω compatible with T in such a way
that if ω is a partial NU, then ω ′ is a NU.
S T
r
(ii) Each partial TSI τr compatible with T with domain hgt
k=0 Level(k)
′
can be extended to a TSI operation τr ⊇ τr compatible with T.
Proof. To prove (i), we define ω ′ as follows (let ā ∈ T r ):
(1) If all the vertices ai have the same level, then we put ω ′ (ā) = ω(ā).
(2) If there exists i ∈ [r] such that lvl(aj ) = k for all j 6= i and
lvl(ai ) 6= k, then
(2a) if r = 2, we define ω ′ (a1 , a2 ) = a1 if lvl(a1 ) < lvl(a2 ) and
ω ′ (a1 , a2 ) = a2 else,
(2b) if r ≥ 3, we define ω ′ (ā) = a2 if i = 1 and ω ′ (ā) = a1 else.
(3) In all other cases we put ω ′ (ā) = a1 .
First, we will prove that ω ′ is a weak-NU. We want to prove that for
any a, b ∈ T , ω ′ (a, . . . , a, b) = ω ′ (a, . . . , a, b, a) = · · · = ω ′ (b, a, . . . , a).
Clearly, for all of these tuples the same case of the definition applies.
In case (1) the equalities hold because ω is a weak-NU, while in case
(2) the result is independent on the coordinate at which the ’b’ occurs.
Moreover, a ◦ω′ b = a in case (2b); and so ω ′ is a NU whenever ω is a
partial NU.
To prove compatibility, choose ā, b̄ ∈ T r such that ai → bi for each i.
The same case of the definition applies for both ω ′ (ā) and ω ′ (b̄). From
the compatibility of ω ′ (case (1)) and the fact that ai → bi (cases (2) and
(3)) it follows that ω ′ (ā) → ω ′ (b̄) and (i) is proved.
In order to prove (ii), for ā ∈ T r let ai1 , . . . , aik (i1 < · · · < ik ) be the
vertices of minimal level among {a1 , . . . , ar }. We define
τr′ (ā) = τr (ai1 , . . . , aik , aik , . . . , aik ).
| {z }
(r−k)-times
It is easy to check that τr′ is TSI. The compatibility of τr′ follows
immediately from the compatibility of τr .
CHAPTER 5. SPECIAL POLYADS: THE DICHOTOMY
5.4
34
Reduction to A(T)
Let T be a special polyad. In this section we translate the question if
T has a compatible r-ary weak-NU, NU or TSI operations of all arities
into a question whether there exists a weak-NU, NU or TSI operations of
all arities compatible with a certain family A(T) of digraphs on the set
Base ∪ Top. This translation significantly simplifies the proof of Theorem
5.2 and also allows us to construct special polyads with some desired
properties such as the one in Section 6.2.
Definition 5.8.
N
(i) Let I ⊆ Paths be nonempty. We define
S∈I S to be the comQ
ponent of connectivity of the N
digraph S∈I S containing the tuple
hinit(S) : S ∈ Ii. (Note that
is, up to isomorphism, associative
and commutative.)
(ii) Let us denote by R the mapping from the set P(Paths) (the power
set of Paths) to itself defined by
O
R(I) = {P ∈ Paths :
S → P}
S∈I
for I 6= ∅; we put R(∅) = ∅.
We will need the following easy lemma.
Lemma 5.9. Let I = {S1 , . . . , Sr } ⊆ Paths be nonempty.
the tuple
NThen
r
of terminal vertices hterm(S
1 ), . . . , term(Sr )i belongs to
i=1 Si and any
N
homomorphism ψ : ri=1 Si → T maps the tuple hinit(S1 ), . . . , init(Sr )i
to a vertex of level 0N
and hterm(S1 ), . . . , term(Sr )i to a vertex of level
hgt(T); the image of ri=1 Si under ψ is a minimal path from Paths.
Proof. Let Q be a minimal path (of height hgt(T)) homomorphic to all
the paths S1 , . . . , Sr via Q
ϕ1 , . . . , ϕr , respectively. Consider the natural
homomorphism ϕ : Q → ri=1 Si defined by ϕ(x̄)
Nr = hϕ1 (x1 ), . . . , ϕr (xr )i.
Since Q is connected, it follows
that
ϕ
:
Q
→
i=1 Si ; thus ϕ(term(Q)) =
Nr
hterm(S1 ), . . . , term(Sr )i ∈ i=1 Si . The homomorphism ψ ◦ ϕ : Q → T
maps Q onto a minimal path P ∈ Paths. Thus ψ(init(S1 ), . . . , init(Sr )) =
(ψ ◦ ϕ)(init(Q)) = init P has level 0 and ψ(term(S1 ), . . . , term(Sr )) has
level hgt(T). The rest is obvious.
In the following lemma we prove that R is a closure operator on the
set Paths.
CHAPTER 5. SPECIAL POLYADS: THE DICHOTOMY
35
Lemma 5.10. The following statements hold:
(i) I ⊆ R(I) for any I ⊆ Paths. (extensivity)
(ii) If I ⊆ J ⊆ Paths, then R(I) ⊆ R(J ). (monotonicity)
(iii) R(R(I)) = R(I) for all I ⊆ Paths. (idempotency)
Proof. In the following, letN
I = {S1 , . . . , Sr }. The projection homomorphisms πj (x̄) = xj witness ri=1 Si → SN
j for all j and (i) is proved.
r
To prove (ii), let P ∈ R(I), ϕ :
P. By (i), for each
i=1 Si → N
i there existsN
a (projection) homomorphism πSi :
S∈J S → Si . The
mapping ψ : S∈J S → P defined by ψ(x̄) = ϕ(πS1 (x̄), . . . , πSr (x̄)) is a
homomorphism witnessing P ∈ R(J ).
It remains to prove (iii). The inclusion
R(R(I)) ⊇ R(I) follows from
N
(i). Let P ∈ R(R(I)) and let ϕ : S∈R(I) S → P. For each S ∈ R(I)
N
there exists a homomorphism ϕS : ri=1 Si → S. Similarly as before the
composition ψ(x̄) = ϕ(hϕS (x̄) : S ∈ R(I)i) is a homomorphism from
N
r
i=1 Si to P, and the proof is finished.
Now we are ready to define the family A(T).
Definition 5.11. For any I ⊆ Paths, let T(I) be the digraph on the set
Base ∪ Top defined by the following condition:
T(I)
a −−→ b iff a is connected to b via P for some P ∈ R(I).
Let us denote by A(T) the family of digraphs A(T) = {T(I) : I ⊆
Paths}. We say that an operation on the set Base ∪ Top is compatible
with A(T), if it is compatible with all the digraphs T(I) ∈ A(T).
Below is a figure of the digraph T(Paths). From Lemma 5.10 it follows
that all digraphs from A(T) are subgraphs of this digraph.
1
2
...
b
1 jTTTTTb
2TTgOOOO.O. .
TTTTOOO
TTTOTOO
T
n
n
bO n[
+ 1 . j. j.j4 n[
+k
j
?
0
j
 jjjjj
jjjj
Figure 5.2: The digraph T(Paths).
The following immediate corollary summarizes the connection between R and compatible operations of T.
CHAPTER 5. SPECIAL POLYADS: THE DICHOTOMY
36
Corollary 5.12. Let f be an r-ary operation compatible with T and
T(I)
I ⊆ Paths. If ai −−→ bi for all i = 1, . . . , r, then
T(I)
f (ā) −−→ f (b̄).
Finally, we conclude this section with the ”reduction” lemma, which
allows us to look for compatible weak-NUs on A(T), a family of quite
Lemma 5.13. Let T be a special polyad. The following statements hold:
(i) T admits an r-ary compatible weak-NU, if and only if A(T) admits
an r-ary compatible weak-NU.
(ii) T admits an r-ary compatible NU, if and only if A(T) admits an
r-ary compatible NU.
(iii) T admits an r-ary compatible TSI, if and only if A(T) admits an
r-ary compatible TSI.
Proof. For an r-ary operation f compatible with T, let f ′ be the restriction of f to the domain Baser ∪ Topr . Choose arbitrary I ⊆ Paths,
T(I)
ā ∈ Baser and b̄ ∈ Topr such that ai −−→ bi (1 ≤ i ≤ r). From the
previous corollary it follows that the partial operation f ′ is compatible
with A(T). The first implications now follow from Lemma 5.7 (which
can be easily generalized to compatibility with a family of oriented trees
on a set), as the properties of being weak-NU, NU or TSI are preserved
by restriction.
It remains to prove the converse implications.
For each I ⊆ Paths
N
we fix an arbitrary SI ∈ I and whenever N S∈I S is homomorphic to
P ∈ Paths, we fix a homomorphism ϕI,P :
S∈I S → P in such a way
that if P ∈ I, then ϕI,P is the projection homomorphism.
To prove the converse implications of (i) and (ii), let ω ′ be an r-ary
weak-NU compatible
We will define a partial operation ω on
S T with A(T).
r
T with domain hgt
Level(k)
.
Let
ā ∈ Level(k)r . For k ∈
/ {0, hgt(T)},
k=0
let Si ∈ Paths be such that ai ∈ Si and denote the set {S1 , . . . , Sr } by
I. For each i let a′i be the vertex from {a1 , . . . , ar } ∩ Si second closest to
init(Si ). (To be precise, if {a1 , . . . , ar } ∩ Si = {ai }, then a′i = ai , else if aj
is the vertex from {a1 , . . . , ar } ∩ Si with minimal distance from init(Si ),
then we define a′i to be the vertex from {a1 , . . . , aj−1 , aj+1 , . . . , ar } ∩ Si
with minimal distance from init(Si ). This is needed to ensure the NU
property, i.e., that a ◦ω b = a, in the case that a, b ∈ P for some P ∈ Paths
and b is closer to init(Paths) than a.)
CHAPTER 5. SPECIAL POLYADS: THE DICHOTOMY
37
(1) If k = 0 or k = hgt(T), we put ω(ā) = ω ′ (ā).
N
(2) Else, if ā ∈ ri=1 Si , let P ∈ Paths be the minimal path connecting
ω ′ (hinit(Si ) : 1 ≤ i ≤ ri) to ω ′ (hterm(Si ) : 1 ≤ i ≤ ri). We put
ω(ā) = ϕI,P (ha′i : Si ∈ Ii).
N
(3) If ā ∈
/ ri=1 Si , then
(3a) if r ≥ 3 and there exist i, j ∈ [r] such that {al : l 6= j} ⊆ Si ,
we put ω(ā) = a′i .
(3b) if r = 2, we put ω(a1 , a2 ) = a′1 if SI = S1 and ω(a1 , a2 ) = a′2
else.
(3c) In all other cases we define ω(ā) = a1 .
It is straightforward to verify that ω is a weak-NU and that if ω ′ is a NU,
then ω is also a NU. To prove compatibility, choose any ā ∈ Level(k)r
T
and b̄ ∈ Level(k + 1)r such that ai −
→
bi , i = 1, . . . , r. We can assume
′
that hgt(T) > 1 (otherwise ω = ω ). If ω(ā) is defined by (1), then
ω(b̄) is defined by (2). It is easily seen that in this case b̄ = b̄′ and
T
ω(ā) = ϕI,P (ha′i : Si ∈ Ii) →
−
ϕI,P (hb′i : Si ∈ Ii) = ω(b̄) follows from the
fact that ϕI,P is a homomorphism. The proof is analogous for the case
when ω(b̄) is defined by (1). Now assume that neither ω(ā) nor ω(b̄) are
defined by (1). In this situation, both ω(ā) and ω(b̄) fall into the same
case of the definition. Observe that a′i → b′i , i = 1, . . . , r, and the set I is
T
the same for both ā and b̄. Now ω(ā) −
→
ω(b̄) follows from the fact that
ϕI,P (case (2)) and projections (cases (3a)-(3c)) are homomorphisms. We
extend ω using Lemma 5.7 and the proof of (i) and (ii) is finished.
To prove the converse implication of (iii) we slightly modify the construction. Assume that A(T) admits r-ary compatible TSI τr′ . Similarly
as before, we will
construct a partial TSI operation τr compatible with
Shgt
/ {0, hgt(T)},
T with domain k=0T Level(k)r . Let ā ∈ Level(k)r . For k ∈
let Si ∈ Paths be such that ai ∈ Si and denote the set {S1 , . . . , Sr } by
I. For each i let a′i be the vertex from {a1 , . . . , ar } ∩ Si with minimal
distance from init(Si ).
(1) If k = 0 or k = hgt(T), we put τr (ā) = τr′ (ā).
N
(2) Else, if ā ∈ ri=1 Si , let P ∈ Paths be the minimal path connecting
τr′ (hinit(Si ) : 1 ≤ i ≤ ri) to τr′ (hterm(Si ) : 1 ≤ i ≤ ri). We put
τr (ā) = ϕI,P (ha′i : Si ∈ Ii).
N
(3) If ā ∈
/ ri=1 Si , then τr (ā) = a′i , where i is such that Si = SI .
CHAPTER 5. SPECIAL POLYADS: THE DICHOTOMY
38
It is not hard to verify that τr is a TSI operation, just note that if
{a1 , . . . , ar } = {b1 , . . . , br }, then the set I and the paths P (case (2)) and
SI (case (3)) are the same for both ā and b̄. The argumentation to verify
compatibility is similar as before. We conclude the proof by extending
τr using Lemma 5.7.
5.5
A(T) and compatible weak-NUs
In this section we will be constructing operations compatible with A(T).
The main goal is to prove that if A(T) admits a compatible r-ary weakNU, then it admits a compatible (r + 1)-ary weak-NU.
Lemma 5.14. If A(T) admits a compatible binary weak-NU (i.e., a commutative idempotent operation), then A(T) admits compatible TSI operations of all arities.
Proof. Let ⋆ be a binary weak-NU compatible with A(T). First, we will
prove that the following holds:
(∃z ∈ Base)(∀a ∈ Base, a 6= z) a ⋆ 0 = 0.
Let z, z ′ ∈ Base be such that z ⋆ 0 6= 0, z ′ ⋆ 0 6= 0. Since ⋆ is compatible
with the digraph T(Paths) in which a → b
a and 0 → b
a for all a 6= 0, it
follows that a ⋆ 0 → b
a⋆b
a=b
a; and so a ⋆ 0 ∈ {0, a} for all a ∈ Base.
Therefore z ⋆ 0 = z and z ′ ⋆ 0 = z ′ . But as z ⋆ 0 → zb ⋆ zb′ and z ′ ⋆ 0 =
0 ⋆ z ′ → zb ⋆ zb′ in T(Paths), we conclude that z = z ′ .
Now fix z ∈ Base with the above property. We will define a partial
order on the set Base ∪ Top and then use ⋆ to ”compare the incomparable”
elemets. For all b
a ∈ Top, b
a 6= zb we put z ≺ zb ≺ 0 ≺ b
a and if b
a∈
/ Half,
then also b
a ≺ a. We define to be the partial order generated by these
relations. Let us fix an arbitrary linear order ≤ on the set Top \{b
z }. (We
can assume without loss of generality that z = 1 and Top \{b
z } = {b
2<
[
b
3 < · · · < n + k}.)
For each i > 0 we denote by ti the i-ary operation defined in the
following way (note that all these operations are compatible with A(T)):
t1 (x) = x,
t2 (x1 , x2 ) = x1 ⋆ x2 ,
..
.
ti (x1 , . . . , xi ) = ti−1 (x1 , . . . , xi−1 ) ⋆ xi .
CHAPTER 5. SPECIAL POLYADS: THE DICHOTOMY
2•
3•
...
39
•n
b
2 •RRRRb
3R•RLLLL . . .
•
• . . .llll•n[
+k
l
RRR LLL
llllll
RRR LL
RRRLL lll
RRL lll
0•
zb•
z•
Figure 5.3: The partial order .
For each b
c ∈ Top we define the set R(b
c) as follows: we put R(b
c) = {b
c}
if b
c ∈ Half and R(b
c) = {b
c, c} else.
Now we are ready to define the TSI operations. For each r ≥ 1, we define an r-ary operation τr in the following way: For any ā ∈ (Base ∪ Top)r
let S(ā) be the smallest subset of Base ∪ Top containing {a1 , . . . , ar } and
closed under the operation ⋆ (i.e., c ⋆ c′ ∈ S(ā) whenever c, c′ ∈ S(ā)).
(1) If S(ā) has the least element with respect to , we define τr (ā) to
be that element,
(2) else let {cb1 < cb2 < · · · < cc
c ∈ Top \{b
z } such
m } be the set of all b
that S(ā) ∩ R(b
c) 6= ∅. Note that m ≥ 2. For i = 1, . . . , m we
denote by a′i the -least element of S(ā) ∩ R(b
ci ). Finally, we put
′
′
′
τr (ā) = tm (a1 , a2 , . . . , am ).
It is easy to check that τr is totally symmetric and idempotent. To
verify compatibility, choose I ⊆ Paths, ā ∈ Baser and b̄ ∈ Topr such that
T(I)
ai −−→ bi , i = 1, . . . , r. If τr (ā) and τr (b̄) are defined by the same case,
T(I)
then it is not hard to see that τr (ā) −−→ τr (b̄).If ā falls into case (2), then
so does τr (b̄). Thus it only remains to investigate the case when τr (ā) is
defined by (1) and τr (b̄) by (2). In this case, we have that τ (ā) = 0 and
τ (b̄) = tm (cb1 , . . . , cc
bi ∈ Top \{b
z }.
m ) for some m ≥ 2 and c
T(I)
′
For each i, let ci ∈ S(ā) be -minimal such that c′i −−→ cbi (c′i = 0 if
cbi ∈ Half and c′i ∈ {0, ci } else.) Since 0 ∈ S(ā), there exists j such that
c′j = 0. We will prove that tm (c′1 , . . . , c′m ) = 0. Then the proof will be
concluded, as we will have that
T(I)
τr (ā) = 0 = tm (c′1 , . . . , c′m ) −−→ tm (b
c1 , . . . , b
cm ) = τr (b̄).
CHAPTER 5. SPECIAL POLYADS: THE DICHOTOMY
40
Since the -least element of S(ā) is 0 and S(ā) is closed under
⋆, it follows that tj−1 (c′1 , . . . , c′j−1 ) 6= z; and so tj (c′1 , . . . , c′j−1 , c′j ) =
tj−1 (c′1 , . . . , c′j−1 ) ⋆ 0 = 0. Now we have that
tj+1 (c′1 , . . . , c′j+1 ) = tj (c′1 , . . . , c′j ) ⋆ c′j+1 = 0 ⋆ c′j+1
and since c′j+1 6= z, it follows that tj+1 (c′1 , . . . , c′j+1 ) = 0. We can proceed
by induction, proving that tm (c′1 , . . . , c′m ) = 0.
The following lemma plays a key role in our proof of Theorem 5.2.
Lemma 5.15. If A(T) admits an r-ary weak-NU ω, then it admits an
(r + 1)-ary weak-NU ω ′ .
Proof. First, let us consider the case when there exists z ∈ Base, z 6= 0
such that 0 ◦ω z = z. We will prove that then A(T) admits a binary
idempotent commutative operation ⋆; and thus by Lemma 5.14 also an
(r + 1)-ary weak-NU (even totally symmetric) operation.
Let , ≤ and R(b
c), b
c ∈ Top be the same as in the proof of Lemma
5.14. We will define ⋆ for ha, bi ∈ Base2 ∪ Top2 and then extend it using
Lemma 5.7.
(1) If a b, then we put a ⋆ b = b ⋆ a = a and if b a, we put
a ⋆ b = b ⋆ a = b.
b for
(2) If a and b are -incomparable, then a ∈ R(b
c) and b ∈ R(d)
some b
c 6= db ∈ Top \{b
z }. We define a ⋆ b = b ⋆ a = a if b
c < db and
a ⋆ b = b ⋆ a = b else.
From the compatibility of ◦ω with T(Paths) we get that b
c ◦ω zb = zb for
all b
c ∈ Top. Since c ◦ω 0 → b
c ◦ω zb = zb and
0 ◦ω c = ω(c, 0, . . . , 0, 0) → ω(b
c, b
c, . . . , b
c, zb) = b
c ◦ω zb = zb
in T(Paths), we conclude that 0 ◦ω c = c ◦ω 0 = 0 for all b
c ∈ Top, b
c 6=
zb. Now it is not hard to prove that ⋆ is an idempotent commutative
operation compatible with A(T), we leave the verification to the reader.
Second, we consider the case when ω satisfies
(∀a ∈ Base) 0 ◦ω a = 0.
We may assume that for all a, b ∈ Base \{0}, if b
a ◦ω bb = b
a, then a ◦ω b = a;
otherwise we can ”redefine” ω to satisfy the desired property, i.e., replace
ω with the operation ω ∗ defined by

a if x̄ ∈ {ha, . . . , a, bi, ha, . . . , a, b, ai, . . . , hb, a, . . . , ai}

∗
ω (x̄) =
for some a, b ∈ Base \{0} such that b
a ◦ω bb = b
a,

ω(x̄) else.
CHAPTER 5. SPECIAL POLYADS: THE DICHOTOMY
41
It is easy to see that ω ∗ is also an r-ary weak-NU compatible with A(T)
satisfying (∀a ∈ Base) 0 ◦∗ω a = 0.
Let us define the set Maj = {a ∈ Base : a ◦ω 0 = a}. We will prove
the following:
(∀a ∈ Maj)(∀b ∈ Base) a ◦ω b = a.
For a = 0 the claim follows from the assumptions and for b = 0 from the
definition of Maj. Let a, b 6= 0. Since ◦ω is compatible with T(Paths)
and a ◦ω 0 = a, it follows that b
a ◦ω bb = b
a. Hence a ◦ω b = a and the
claim is proved.
We will define ω ′ (ā) for ā = ha1 , . . . , ar+1 i ∈ Baser+1 ∪ Topr+1 and
then apply Lemma 5.7.
(1) If ā = ha, . . . , a, bi for some a, b ∈ Base, a ∈
/ Maj, we put ω ′ (ā) =
a ◦ω b, and if ā = hb
a, . . . , b
a, bbi for some b
a, bb ∈ Top, a ∈
/ Maj, we put
′
b
ω (ā) = b
a ◦ω b,
(2) else we define ω ′ (ā) = ω(a1 , . . . , ar ).
To prove that ω ′ is a weak-NU, choose a, b ∈ Base. For b
a, bb ∈ Top
we can proceed analogously. If a ∈ Maj, then case (2) applies. We
have that ω ′ (b, a, . . . , a) = · · · = ω ′ (a, . . . , a, b, a) = a ◦ω b = a, while
ω ′ (a, . . . , a, b) = ω(a, . . . , a) = a. Now suppose that a ∈
/ Maj. In
′
′
that case ω (a, . . . , a, b) = a ◦ω b by (1) and ω (a, . . . , a, b, a) = · · · =
ω ′ (b, a, . . . , a) = a ◦ω b by (2); and so the weak-NU property is verified.
To verify compatibility, choose I ⊆ Paths, ā ∈ Baser+1 and b̄ ∈
T(I)
Topr+1 such that ai −−→ bi , i = 1, . . . , r +1. If ω ′ (ā) and ω ′ (b̄) are defined
T(I)
by the same case, then ω ′ (ā) −−→ ω ′ (b̄) follows from the compatibility
of ◦ω in case (1) and ω in case (2). If ā falls into case (1), then so does
b̄. The only remaining case is when ω ′ (ā) is defined by (2) and ω ′ (b̄) by
b for some b
(1). In this situation we have that b̄ = hb
c, . . . , b
c, di
c, db ∈ Top,
T(I)
b Since ai −−→ b
c ∈
/ Maj and ω ′ (b̄) = b
c ◦ω d.
c for i = 1, . . . , r, we get
T(I)
′
ω (ā) = ω(a1 , . . . , ar ) −−→ ω(b
c, . . . , b
c) = b
c; and so ω(a1 , . . . , ar ) ∈ {0, c}.
We also know that 0 ∈ {a1 , . . . , ar }, as otherwise case (1) would apply
for ā.
T(I)
T(I)
b from the
First, let ω(a1 , . . . , ar ) = 0. Since 0 −−→ b
c and ar+1 −−→ d,
compatibility of ◦ω we obtain
T(I)
ω ′ (ā) = ω(a1 , . . . , ar ) = 0 = 0 ◦ω ar+1 −−→ b
c ◦ω db = ω ′ (b̄),
proving the compatibility condition for ω ′ in this case.
CHAPTER 5. SPECIAL POLYADS: THE DICHOTOMY
42
Second, assume that ω(a1 , . . . , ar ) = c. Notice that c ∈ {a1 , . . . , ar }
T(I)
(as ω(0, . . . , 0) = 0), implying that c −−→ b
c. We will prove that b
c ◦ω db = b
c.
ω ′ (ā) = ω(a1 , . . . , ar ) = c −−→ b
c=b
c ◦ω db = ω ′ (b̄),
T(I)
which will conclude the proof. Let j ∈ [r] be such that aj = 0. In
the digraph T(Paths) we have aj → db and ai → b
c for all i = 1, . . . , r.
Therefore
bb
b
c = ω(a1 , . . . , aj−1 , aj , aj+1 , . . . , ar ) → ω(b
c, . . . , b
c, d,
c, . . . , b
c) = b
c ◦ω d.
Hence b
c ◦ω db = b
c and the proof is finished.
5.6
Q.E.D
Finally, everything is set to prove the dichotomy theorem.
Proof of Theorem 5.2. Let T be a special polyad and let T′ be its core.
By Lemma 5.4, T′ is also a special polyad.
(i) If T′ admits no compatible weak-NUs, then CSP(T) is NP-complete
by Theorem 3.5. By Theorem 3.6 and the ”reduction” Lemma 5.13, it is
enough to prove that if A(T′ ) admits a weak-NU of arity r0 , then A(T′ )
admits weak-NUs of all arities r ≥ r0 . But the latter fact follows by
induction from Lemma 5.15.
(ii) By Lemma 5.14 (and Lemma 5.13), T′ admits a binary weak-NU,
if and only if it admits TSI operations of all arities. The rest follows from
Theorem 3.7.
Chapter 6
Using the techniques developed for the proof of the dichotomy in the
previous chapter (namely A(T) and the ”reduction” from Lemma 5.13),
we present a method of constructing special polyads with certain desired properties. We apply this method to obtain an interesting special
polyad: a core special polyad which has bounded width, but not width 1
and which does not admit any near-unaninimty polymorphism (implying
that the variety generated by the algebra of its polymorphisms is not
congruence distributive); such case did not occur in special triads.
6.1
From A(T) back to T
Our aim in this section is to provide a characterization of families of
digraphs A for which we can construct a special polyad T such that
Definition 6.1. By a closure system on a finite set A we mean a family
C ⊆ P(A) of subsets of A such that
(i) A ∈ C,
(ii) if C1 , C2 ∈ C, then C1 ∩ C2 ∈ C.
The sets C ∈ C are called C-closed sets.
Let D be a closure system on a finite set B. We say that C and D are
isomorphic if there exists a bijection f : A → B such that D = {f [C] :
C ∈ C}.
Closure systems can be in a natural way identified with closure operators. The following definition is essentially just a reformulation of
Definition 5.8 (ii):
43
44
Definition 6.2. Let Paths = {P1 , . . . , Pn } be a finite set of minimal
N
paths of the same height. We define the closure system RPaths
on Paths
Paths
N
in the following way: let the R
-closed sets be precisely the empty set
and the nonempty sets I ⊆ Paths such that
O
I = {P ∈ Paths :
S → P}.
S∈I
N
It is easy to check that RPaths
is indeed a closure system. The following proposition states that each closure system on a finite set (such that
N
the empty set is closed) is isomorphic to RPaths
for some set of minimal
paths.
Proposition 6.3. Let C be a closure system on [n], ∅ ∈ C. There exists
a set Paths = {P1 , . . . , Pn } of minimal paths of the same height such that
for each I ⊆ [n],
N
I ∈ C ⇐⇒ {Pi : i ∈ I} ∈ RPaths
.
Proof. Let us fix an arbitrary linear order of the nontrivial C-closed sets
(i.e., C \ {∅, [n]}), say C = {∅, C1 , . . . , Cq , [n]}. By an arrow we mean
a digraph with a single edge a → b (and possibly some other discrete
vertices); a zig-zag is a digraph with just three edges a → b, c → b, c → d
(see the figure below).
bJ
a
bJ T*
***
*
a
dJ
c
Figure 6.1: An arrow and a zig-zag.
We say that a minimal path P has an arrow at level k if P[LevelP (k) ∪
LevelP (k + 1)] (the subgraph induced by vertices of level k or k + 1) is
an arrow; if it is a zig-zag, then P has a zig-zag at level k. It is an easy
excercise to prove the following claim:
Claim. Let l be a positive integer and for I ⊆ [l] let PI denote the minimal
path of height l +2 which has zig-zag’s at levels i ∈ I and arrows
Nmat levels
j ∈ {0, . . . , l + 1} \ I. For any I1 , . . . , Im ⊆ [l] the core of
i=1 PIi is
isomorphic to PI1 ∪···∪Im .
The above claim is the key to our construction: For i ∈ [n], let Pi be
the minimal path of height q + 2 (uniquely) determined by the following
conditions:
45
(i) Pi has an arrow at level 0,
(ii) for k = 1, . . . , q, Pi has an arrow at level k if i ∈ Ck and a zig-zag
at level k else,
(iii) Pi has an arrow at level q + 1.
To demonstrate the construction, consider the following example: let
n = 3, q = 3, C1 = {1}, C2 = {1, 2}, C3 = {1, 3}. The minimal paths
P1 , P2 and P3 are depicted in Figure 6.2.
•K
•K
•K
C3
•K S' •K
''' ' •K
C2
•K
•K •
•K
C1
•K
•K S' •K
''' ' •K
•K •
•
P1
•
P2
•K S' •K
''' ' •K S' •K •
''' ' •K •
•
P3
Figure 6.2: The resulting minimal paths.
N The above claim implies that for all nonempty I ⊆ [n] and j ∈ [n],
/ C there exists
i∈I Pi → Pj , if and only if for all C ∈ C such that j ∈
i ∈ I with i ∈
/ C. Equivalently,
O
Pi → Pj ⇐⇒ (∀C ∈ C) (I ⊆ C → j ∈ C).
i∈I
T
Now, choose arbitrary nonempty I ⊆ [n]. Let D = {C ∈ C : I ⊆ C}
be the minimal (w.r.t. inclusion) C-closed set containg I. From the above
we get that
O
Pi → Pj ⇐⇒ j ∈ D.
i∈I
N
Thus I ∈ C (i.e., I = D), if and only if {Pi : i ∈ I} is RPaths
-closed.
46
Remark. The above construction of minimal paths was chosen for its
simplicity, it is by no means optimal regarding the number of vertices of
the resulting paths.
We conclude this section with an easy corollary of the above proposition; a key to the construction below.
Corollary 6.4. Let A be a family of digraphs on the same vertex set H.
The following are equivalent:
(i) A = A(T) for some special polyad T,
(ii) There exists a special polyad H = (H, E) of height 1 such that
(H, ∅) ∈ A and the edge relations of members of A form a closure
system on E.
Moreover, if (ii) holds and (H, {e}) ∈ A for all e ∈ E, then T is a core.
Proof. (i) ⇒ (ii): For a special polyad T, A = A(T) clearly satisfies (ii).
(Note that T(PathsT ) is a special polyad of height 1).
(ii) ⇒ (i): Label the edges of H with positive integers 1, . . . , n and
use the previous proposition to construct the minimal paths Pi . For
i = 1, . . . , n, replace the edge i with the minimal path Pi . The resulting
digraph T is a special polyad such that A = A(T).
The rest follows from the fact that if T is not a core, then P → P′ for
some P, P′ ∈ PathsT .
6.2
Finally, in this section we construct a special polyad satisfying the following:
Proposition 6.5. There exists a core special polyad T having the following properties:
(i) CSP(T) is tractable,
(ii) T does not have width 1,
(iii) T does not admit any compatible near-unanimity operation.
In order to construct such a special polyad, we will first introduce
some notation. Let H = (H, E) be a special polyad of height 1 with 4
branches with the vertices and edges labeled as in Figure 6.3 below.
47
1
2
3
4
P′1
P′2
P′3
P′4
b
1 dJJJJ
b
2 W/
//
JJJ
b
G3
P
JJJ /// ttt 4
t
JJ tt
t
P1 JJ P2/
P3
:t b
4
ttt
ttt
0
Figure 6.3: The special polyad H of height 1.
For J ⊆ , we denote the set {j ′ : j ∈ J} by J ′ . For I, J ⊆ ,
′
we define HJI to be the subgraph of H with vertex set H and edges
{Pi : i ∈ I} ∪ {P′j : j ∈ J}.
We define the family A of subgraphs of H in the following way:
A = A0 ∪ A1 ∪ A2 ∪ A3 ,
where
• A0 = {H, H∅∅ },
4
1
2
3
4
b
b
G 3 ttt: 4
JJ // tt
JJ tt
t
b
1
b
2
b
3
b
4
1
2
3
b
1 dJJJ b
2
J W//
0
0
′
• A1 = {H∅i : i ∈ } ∪ {Hi∅ : i ∈ },
2
3
4
1
2
3
4
b
2
1 dJJJ b
b
3
b
4
b
1
b
2
b
3
b
4
1
JJ
JJ
J
...
0
0
′
• A2 = {Hji : i, j ∈ , i 6= j},
1
2
3
b
1 dJJJ b
2
JJ
JJ
J
b
3
1
4
2
b
1
b
4
3
b
2 W/
4
b
3
//
/
b
4
0
0
′
′
′
′
• A3 = {H42,3 , H23 ,4 , H32 ,4 , H42 , H43 }.
′
′
′
1
...
b
1
2
b
2
0
3
4
b
b
4
G3
48
1
b
1
2
3
b
2 W/
b
4
3
// G
/ b
4
3
4
1
b
1
2
b
2 W/
b
1
2
b
2 W/
b
3
//
/
4
b
3
//
/
b
4
1
b
1
0
0
1
3
b
4
2
3
4
b
1
b
2
G3
b
b
4
0
b
2
0
1
0
2
3
4
b
b
4
G3
It can be easily seen that the edge relations of the members of A form
a closure system. The rest of the proof follows:
Proof of Proposition 6.5. By Corollary 6.4, there exists a core special
polyad T such that A = A(T). In the following, we use Theorem 5.2 and
the ”reduction” Lemma 5.13.
(i) It is enough to prove that A admits a compatible weak nearunanimity operation. We will define a 4-ary weak-NU ω on the set H.
Let x̄ ∈ {0, 1, 2, 3, 4}4 .
(1) If 4 ∈
/ {x1 , x2 , x3 }, then
(1.1) if {x1 , x2 , x3 } = {1, 2, 3}, we put ω(x̄) = 1
(1.2) else x1 , x2 , x3 lie on an oriented path in H; we define ω(x̄) to
be the middle vertex from x1 , x2 , x3 on this path.
(2) If 4 ∈ {x1 , x2 , x3 }, then
(2.1) if x̄ = h4, 4, 4, 4i, we put ω(x̄) = 4
(2.2) else ω(x̄) = xi where i is smallest such that xi 6= 4.
c4 we put ω(x)
[ Finally, we extend ω using Lemma
b̄ ∈ 
b̄ = ω(x̄).
For x
5.7. It can be easily verified that ω is a weak-NU. (In fact, ω restricted
to H \ {4, b
4} is a near-unanimity.)
Compatibility with A0 is trivial and compatibility with A1 follows
from the idempotency of ω. Let x̄ ∈ ({0} ∪ )4 , ȳ ∈ 4 . To prove
′
compatibility with A2 , pick any i, j ∈ , i 6= j. If x̄ → b̄
y in Hji ,
then both ω(x̄) and ω(b̄
y) are defined by (1.2) and it is easily seen that
′
ω(x̄) → ω(b̄
y) in Hji . As for compatibility with A3 , let x̄ → b̄
y in some
′
H ∈ A3 . The only interesting case is when 4 ∈ x̄; we see that xi = 4
iff yi = 4 for all i ∈ . It follows that ω(x̄) and ω(b̄
y) are defined by
the same case of the definition, (1.2), (2.1) or (2.2); in all of these cases
49
we have ω(x̄) → ω(b̄
y) in H′ . Thus ω is compatible with A and we have
proved that CSP(T) is tractable.
(ii) It suffices to prove that A does not admit a compatible binary
weak-NU (binary idempotent commutative operation). Striving for contradiction, let ⋆ be a binary weak-NU compatible with A. In the following, a digraph above an arrow indicates that the implication was deduced
from the compatibility with that digraph.
For any i 6= j ∈  we have
Hi
′
′
Hi , Hj
′
j
j
i
H
bi ⋆ bi = bi =⇒
i ⋆ 0 ∈ {i, 0} =⇒ bi ⋆ b
j ∈ {bi, b
j} =⇒ i ⋆ 0 = i or j ⋆ 0 = j.
Without loss of generality we may assume that 1 ⋆ 0 = 1. Now
′
H12 , H13
=⇒
1⋆0=1
′
b
1⋆b
2=b
1⋆b
3=b
1
′
H21 , H31
′
=⇒
2 ⋆ 0 = 3 ⋆ 0 = 0;
(iii) Again, it is enough to prove that A admits no compatible nearunanimity operation. Suppose for contradiction that there exists an r-ary
NU operation ν compatible with A. We will prove the following claim:
For all i ∈ [r − 2],
ν(4, . . . , 4, 0, 0, . . . , 0) = 0 =⇒ ν(4, . . . , 4, 4, 0, . . . , 0) = 0.
| {z }
| {z }
i-times
(i + 1)-times
This claim contradicts the fact that ν(4, 0, . . . , 0) = 0 and ν(4, . . . , 4, 0) =
4.
Fix i ∈ [r − 2] and let
t(x, y, z) = ν(x, . . . , x, y, z, . . . , z).
| {z }
i-times
As t is also compatible with A, we have that
′
H42,3
t(4, 0, 0) = 0 =⇒ t(b
4, b
2, b
3) ∈ {b
2, b
3}.
′
′
If t(b
4, b
2, b
3) = b
2, then by compatibility with H23 ,4 we have t(4, 2, 0) = 2
and from H we get t(b
4, b
2, b
4) = b
2; a contradiction with the NU property
b
b
b
b
of ν. Therefore t(4, 2, 3) = 3. But
3′ ,4′
2′ ,4′
H2
H3
H
t(b
4, b
2, b
3) = b
3 =⇒
t(4, 0, 3) = 3 =⇒ t(b
4, b
4, b
3) = b
3) =⇒
t(4, 4, 0) = 0;
and the claim is proved.
Chapter 7
Conclusion
Our work represents another evidence of the usefulness of the algebraic
approach to CSP. We managed to extend the dichotomy result from 
to special polyads, for which the problem is substantially more complex
(as witnessed by the construction in Chapter 6). On the other hand, the
most up to date algebraic tools were needed.
We believe that the methods developed for the proof of the dichotomy
for special polyads can be generalized to a far broader class of oriented
trees. However, the dichotomy question for oriented trees is still far from
being solved and it is very likely that it will require a deeper understanding of the algebraic side of the Constraint Satisfaction Problem.
The following two open questions naturally arise from our work:
Question 1. Does every tractable oriented tree have bounded width?
Question 2. Does every oriented tree which admits a binary idempotent
commutative polymorphism have width 1?
50
Bibliography
 L. Barto. CD implies NU. Personal communication.
 L. Barto and M. Kozik. Constraint Satisfaction Problems of Bounded
Width. Proceedings of the 50th Annual IEEE Symposium on Foundations of Computer Science, FOCS’09 (2009), 595-603.
 L. Barto, M. Kozik, M. Maróti and T. Niven. CSP dichotomy for
special triads. Proc. Amer. Math. Soc. 137/9 (2009), 2921-2934.
 L. Barto, M. Kozik and T. Niven. The CSP dichotomy holds for
digraphs with no sources and no sinks (a positive answer to a conjecture of Bang-Jensen and Hell). SIAM Journal on Computing 38/5
(2009), 1782-1802.
 A. Bulatov. A dichotomy theorem for constraint satisfaction problems on a 3-element set. J. ACM, 53(1):66–120 (electronic), 2006.
 A. Bulatov. H-coloring dichotomy revisited. Theoret. Comput. Sci.
349 (2005), no. 1, 31–39.
 A. Bulatov. Tractable conservative constraint satisfaction problems.
Proceedings of the 18th IEEE Symposium on Logig in Computer
Science (LICS’03), Ottawa, Canada, 2003, 321-330.
 A. Bulatov, P. Jeavons and A. Krokhin. Classifying the complexity
of constraints using finite algebras. SIAM J. Comput., 34(3):720-742
(electronic), 2005.
 A. Bulatov and M. Valeriote. Recent results on the algebraic approach to the CSP. Complexity of Constraints: An Overview of
Current Research Themes, Springer-Verlag, 2008, 68-92.
 S. N. Burris and H. P. Sankappanavar. A course in universal algebra.
Volume 78 of Graduate Texts in Mathematics. Springer-Verlag, New
York, 1981.
51
BIBLIOGRAPHY
52
 V. Dalmau and J. Pearson. Closure functions and width 1 problems.
Proceedings of the 5th International Conference on Constraint Programming (CP99), Lecture Notes in Comput. Sci. 1713, SpringerVerlag, Berlin, 1999, pp. 159-173.
 T. Feder. Classification of homomorphisms to oriented cycles and of
k-partite satisfiability. SIAM J. Discrete Math., 14(4):471-480 (electronic), 2001.
 T. Feder and M. Vardi. The computational structure of monotone
monadic SNP and constraint satisfaction: a study through Datalog
and group theory. SIAM J. Comput., 28(1):57-104 (electronic), 1999.
 W. Gutjahr, E. Welzl and G. Woeginger. Polynomial graphcolorings. Discrete Appl. Math., 35(1):29-45, 1992.
 P. Hell and J. Nešetřil. Graphs and Homomorphisms. Oxford Lecture
Series in Mathematics and Its Applications. Oxford University Press,
2004.
 P. Hell and J. Nešetřil. On the complexity of H-coloring. J. Combin.
Theory Ser. B, 48(1):92-110, 1990.
 P. Hell, J. Nešetřil and X. Zhu. Complexity of tree homomorphisms.
Discrete Appl. Math. 70 (1996), no. 1, 23–36.
 P. Idziak, P. Marković, R. McKenzie, M. Valeriote and R. Willard.
Tractability and learnability arising from algebras with few subpowers. Accepted for publication in the SIAM Journal on Computing,
2010.
 P. Jeavons, D. Cohen and M. Gyssens. Closure properties of constraints. J. ACM, 44(4):527-548, 1997.
 A. Krokhin, A. Bulatov and P. Jeavons. The complexity of constraint
satisfaction: An algebraic approach. Structural Theory of Automata,
Semigroups and Universal Algebra (Montreal, 2003), NATO Sci. Ser.
II: Math., Phys., Chem., volume 207, 181-213, 2005.
 B. Larose and L. Zádori. Bounded width problems and algebras. Algebra Universalis, 56(3-4):439?66, 2007.
 M. Maróti and R. McKenzie. Existence theorems for weakly symmetric operations. Algebra Universalis 59 (2008), no. 3-4, 463-489.
BIBLIOGRAPHY
53
 T. Schaefer. The complexity of satisfiability problems. Proceedings of
the 10th ACM Symposium on Theory of Computing (STOC 1978),
pp. 216–226, 1978.
```