You are on page 1of 53

Language and Automata Theory and

Applications Shmuel Tomi Klein


Visit to download the full and correct content document:
https://textbookfull.com/product/language-and-automata-theory-and-applications-shm
uel-tomi-klein/
More products digital (pdf, epub, mobi) instant
download maybe you interests ...

Cellular Learning Automata: Theory and Applications


Reza Vafashoar

https://textbookfull.com/product/cellular-learning-automata-
theory-and-applications-reza-vafashoar/

Language and Automata Theory and Applications 11th


International Conference LATA 2017 Umeå Sweden March 6
9 2017 Proceedings 1st Edition Frank Drewes

https://textbookfull.com/product/language-and-automata-theory-
and-applications-11th-international-conference-lata-2017-umea-
sweden-march-6-9-2017-proceedings-1st-edition-frank-drewes/

Language and Automata Theory and Applications 9th


International Conference LATA 2015 Nice France March 2
6 2015 Proceedings 1st Edition Adrian-Horia Dediu

https://textbookfull.com/product/language-and-automata-theory-
and-applications-9th-international-conference-lata-2015-nice-
france-march-2-6-2015-proceedings-1st-edition-adrian-horia-dediu/

Research on Tibetan Spelling Formal Language and


Automata with Application Nyima Tashi

https://textbookfull.com/product/research-on-tibetan-spelling-
formal-language-and-automata-with-application-nyima-tashi/
Mathematical Foundations of Automata Theory Jean-Éric
Pin

https://textbookfull.com/product/mathematical-foundations-of-
automata-theory-jean-eric-pin/

Mathematical foundations of automata theory Pin J.-E

https://textbookfull.com/product/mathematical-foundations-of-
automata-theory-pin-j-e/

Linear Algebra and Matrices 1st Edition Shmuel


Friedland And Mohsen Aliabadi

https://textbookfull.com/product/linear-algebra-and-matrices-1st-
edition-shmuel-friedland-and-mohsen-aliabadi/

Eye Movement Research An Introduction to its Scientific


Foundations and Applications Christoph Klein

https://textbookfull.com/product/eye-movement-research-an-
introduction-to-its-scientific-foundations-and-applications-
christoph-klein/

Acquired language disorders : a case-based approach


Third Edition. Edition Evelyn R. Klein

https://textbookfull.com/product/acquired-language-disorders-a-
case-based-approach-third-edition-edition-evelyn-r-klein/
Shmuel Tomi Klein
Carlos Martín-Vide
Dana Shapira (Eds.)

Language
LNCS 10792

and Automata Theory


and Applications
12th International Conference, LATA 2018
Ramat Gan, Israel, April 9–11, 2018
Proceedings

123
Lecture Notes in Computer Science 10792
Commenced Publication in 1973
Founding and Former Series Editors:
Gerhard Goos, Juris Hartmanis, and Jan van Leeuwen

Editorial Board
David Hutchison
Lancaster University, Lancaster, UK
Takeo Kanade
Carnegie Mellon University, Pittsburgh, PA, USA
Josef Kittler
University of Surrey, Guildford, UK
Jon M. Kleinberg
Cornell University, Ithaca, NY, USA
Friedemann Mattern
ETH Zurich, Zurich, Switzerland
John C. Mitchell
Stanford University, Stanford, CA, USA
Moni Naor
Weizmann Institute of Science, Rehovot, Israel
C. Pandu Rangan
Indian Institute of Technology Madras, Chennai, India
Bernhard Steffen
TU Dortmund University, Dortmund, Germany
Demetri Terzopoulos
University of California, Los Angeles, CA, USA
Doug Tygar
University of California, Berkeley, CA, USA
Gerhard Weikum
Max Planck Institute for Informatics, Saarbrücken, Germany
More information about this series at http://www.springer.com/series/7407
Shmuel Tomi Klein Carlos Martín-Vide

Dana Shapira (Eds.)

Language
and Automata Theory
and Applications
12th International Conference, LATA 2018
Ramat Gan, Israel, April 9–11, 2018
Proceedings

123
Editors
Shmuel Tomi Klein Dana Shapira
Bar-Ilan University Ariel University
Ramat Gan Ariel
Israel Israel
Carlos Martín-Vide
Rovira i Virgili University
Tarragona
Spain

ISSN 0302-9743 ISSN 1611-3349 (electronic)


Lecture Notes in Computer Science
ISBN 978-3-319-77312-4 ISBN 978-3-319-77313-1 (eBook)
https://doi.org/10.1007/978-3-319-77313-1

Library of Congress Control Number: 2018934364

LNCS Sublibrary: SL1 – Theoretical Computer Science and General Issues

© Springer International Publishing AG, part of Springer Nature 2018


This work is subject to copyright. All rights are reserved by the Publisher, whether the whole or part of the
material is concerned, specifically the rights of translation, reprinting, reuse of illustrations, recitation,
broadcasting, reproduction on microfilms or in any other physical way, and transmission or information
storage and retrieval, electronic adaptation, computer software, or by similar or dissimilar methodology now
known or hereafter developed.
The use of general descriptive names, registered names, trademarks, service marks, etc. in this publication
does not imply, even in the absence of a specific statement, that such names are exempt from the relevant
protective laws and regulations and therefore free for general use.
The publisher, the authors and the editors are safe to assume that the advice and information in this book are
believed to be true and accurate at the date of publication. Neither the publisher nor the authors or the editors
give a warranty, express or implied, with respect to the material contained herein or for any errors or
omissions that may have been made. The publisher remains neutral with regard to jurisdictional claims in
published maps and institutional affiliations.

Printed on acid-free paper

This Springer imprint is published by the registered company Springer International Publishing AG
part of Springer Nature
The registered company address is: Gewerbestrasse 11, 6330 Cham, Switzerland
Preface

These proceedings contain the papers that were presented at the 12th International
Conference on Language and Automata Theory and Applications (LATA 2018), held
at Bar-Ilan University near Tel Aviv, Israel, during April 9–11, 2018.
The scope of LATA is rather broad, including: algebraic language theory,
algorithms for semi-structured data mining, algorithms on automata and words, auto-
mata and logic, automata for system analysis and program verification, automata
networks, automatic structures, codes, combinatorics on words, computational com-
plexity, concurrency and Petri nets, data and image compression, descriptional com-
plexity, foundations of finite-state technology, foundations of XML, grammars
(Chomsky hierarchy, contextual, unification, categorial, etc.), grammatical inference
and algorithmic learning, graphs and graph transformation, language varieties and
semigroups, language-based cryptography, mathematical and logical foundations of
programming methodologies, parallel and regulated rewriting, parsing, patterns, power
series, string processing algorithms, symbolic dynamics, term rewriting, transducers,
trees, tree languages and tree automata, weighted automata.
LATA 2018 received 58 submissions. Every paper was reviewed by three Pro-
gramme Committee members. There were also a few external experts consulted. After a
thorough and vivid discussion phase, the committee decided to accept 20 papers (which
represents a competitive acceptance rate of about 34%). The conference program
included five invited talks as well.
The excellent facilities provided by the EasyChair conference management system
allowed us to deal with the submissions successfully and handle the preparation
of these proceedings in time.
We would like to thank all invited speakers and authors for their contributions, the
Program Committee and the external reviewers for their cooperation, and Springer for
its very professional publishing work.

January 2018 Shmuel Tomi Klein


Carlos Martín-Vide
Dana Shapira
Organization

Program Committee
Christel Baier Technical University of Dresden, Germany
Pablo Barceló University of Chile, Chile
Francine Blanchet-Sadri University of North Carolina, Greensboro, USA
Alexander Clark King’s College London, UK
Frank Drewes Umeå University, Sweden
Manfred Droste University of Leipzig, Germany
Dora Giammarresi University of Rome Tor Vergata, Italy
Erich Grädel RWTH Aachen University, Germany
Peter Habermehl Paris Diderot University, France
Jeffrey Heinz Stony Brook University, USA
Pedro Rangel Henriques University of Minho, Portugal
Hendrik Jan Hoogeboom Leiden University, The Netherlands
Christian Honer zu University of Leipzig, Germany
Siederdissen
David Janin University of Bordeaux, France
Marcin Jurdziński University of Warwick, UK
Makoto Kanazawa National Institute of Informatics, Japan
Jarkko Kari University of Turku, Finland
Shmuel Tomi Klein Bar-Ilan University, Israel
Salvatore La Torre University of Salerno, Italy
Salvador Lucas Polytechnic University of Valencia, Spain
Stuart W. Margolis Bar-Ilan University, Israel
Carlos Martín-Vide (Chair) Rovira i Virgili University, Spain
Fernando Orejas Polytechnic University of Catalonia, Spain
Paritosh K. Pandya Tata Institute of Fundamental Research, India
Gennaro Parlato University of Southampton, UK
Dominique Perrin University Paris-Est Marne-la-Vallée, France
Detlef Plump University of York, UK
Matteo Pradella Polytechnic University of Milan, Italy
Arend Rensink University of Twente, The Netherlands
Kai Salomaa Queen’s University, Canada
Sven Schewe University of Liverpool, UK
Helmut Seidl Technical University of Munich, Germany
William F. Smyth McMaster University, Canada
Jiri Srba Aalborg University, Denmark
Benjamin Steinberg City College of New York, USA
Frank Stephan National University of Singapore, Singapore
K. G. Subramanian University Sains Malaysia, Malaysia
VIII Organization

Klaus Sutner Carnegie Mellon University, USA


Menno van Zaanen Tilburg University, The Netherlands
Margus Veanes Microsoft Research, USA
Eric Villemonte de la Inria, France
Clergerie
Mahesh Viswanathan University of Illinois, Urbana-Champaign, USA
Mikhail Volkov Ural State University, Russia

Additional Reviewers

Baldan, Paolo Löding, Christof


Basset, Nicolas Maletti, Andreas
Berglund, Martin Mandrioli, Dino
Björklund, Johanna Manea, Florin
Blair, Dakota Mardare, Radu
Blumensath, Achim Margolis, Stuart
Carmona, Josep Minas, Mark
Carreras, Xavier Mitrana, Victor
Case, John Morzenti, Angelo
Ciobanu, Laura Nolte, Dennis
Crespi Reghizzi, Stefano Peltomäki, Jarkko
Daviaud, Laure Rossi, Matteo
Enea, Constantin Ryzhikov, Andrew
Fici, Gabriele Salo, Ville
Gawrychowski, Pawel Sears, David
Julian-Iranzo, Pascual Sharan, Shambhu
Kobele, Greg Shur, Arseny
Koppitz, Jörg Steffinlongo, Enrico
Krishna, S. Tao, Jim
König, Barbara Vatter, Vincent
Lee, Edmond Vogler, Walter
Lohrey, Markus
Contents

Constraint Satisfaction Problems: Complexity and Algorithms . . . . . . . . . . . 1


Andrei A. Bulatov

Sliding Window Algorithms for Regular Languages . . . . . . . . . . . . . . . . . . 26


Moses Ganardi, Danny Hucke, and Markus Lohrey

Underlying Principles and Recurring Ideas of Formal Grammars . . . . . . . . . . 36


Alexander Okhotin

Reshaping the Context-Free Model: Linguistic and Algorithmic Aspects . . . . 60


Eli Shamir

Formal Languages over GF(2) . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 68


Ekaterina Bakinova, Artem Basharin, Igor Batmanov,
Konstantin Lyubort, Alexander Okhotin, and Elizaveta Sazhneva

Event-Clock Nested Automata . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 80


Laura Bozzelli, Aniello Murano, and Adriano Peron

On the Synchronization of Planar Automata . . . . . . . . . . . . . . . . . . . . . . . . 93


J. Andres Montoya and Christian Nolasco

Descriptional and Computational Complexity of the Circuit Representation


of Finite Automata . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 105
Māris Valdats

Disturbance Decoupling in Finite Automata . . . . . . . . . . . . . . . . . . . . . . . . 118


Alexey Zhirabok and Alexey Shumsky

Default Logic and Bounded Treewidth. . . . . . . . . . . . . . . . . . . . . . . . . . . . 130


Johannes K. Fichte, Markus Hecher, and Irina Schindler

A General Class of Monoids Supporting Canonisation and Minimisation


of (Sub)sequential Transducers . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 143
Stefan Gerdjikov

Deciding Regular Intersection Emptiness of Complete Problems


for PSPACE and the Polynomial Hierarchy . . . . . . . . . . . . . . . . . . . . . . . . 156
Demen Güler, Andreas Krebs, Klaus-Jörn Lange, and Petra Wolf

Learners Based on Transducers . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 169


Sanjay Jain, Shao Ning Kuek, Eric Martin, and Frank Stephan
X Contents

Model Learning as a Satisfiability Modulo Theories Problem . . . . . . . . . . . . 182


Rick Smetsers, Paul Fiterău-Broştean, and Frits Vaandrager

Analytic Combinatorics of Lattice Paths with Forbidden Patterns:


Enumerative Aspects . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 195
Andrei Asinowski, Axel Bacher, Cyril Banderier,
and Bernhard Gittenberger

Bubble-Flip—A New Generation Algorithm for Prefix Normal Words . . . . . . 207


Ferdinando Cicalese, Zsuzsanna Lipták, and Massimiliano Rossi

Permutations Sorted by a Finite and an Infinite Stack in Series . . . . . . . . . . . 220


Murray Elder and Yoong Kuan Goh

On Periodicity Lemma for Partial Words . . . . . . . . . . . . . . . . . . . . . . . . . . 232


Tomasz Kociumaka, Jakub Radoszewski, Wojciech Rytter,
and Tomasz Waleń

Measuring Closeness Between Cayley Automatic Groups


and Automatic Groups . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 245
Dmitry Berdinsky and Phongpitak Trakuldit

Pomsets and Unfolding of Reset Petri Nets . . . . . . . . . . . . . . . . . . . . . . . . 258


Thomas Chatain, Maurice Comlan, David Delfieu, Loïg Jezequel,
and Olivier H. Roux

Timed Comparisons of Semi-Markov Processes . . . . . . . . . . . . . . . . . . . . . 271


Mathias R. Pedersen, Nathanaël Fijalkow, Giorgio Bacci,
Kim G. Larsen, and Radu Mardare

Handling Ties Correctly and Efficiently in Viterbi Training


Using the Viterbi Semiring. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 284
Markus Saers and Dekai Wu

Over-Approximative Petri Net Synthesis for Restricted


Subclasses of Nets . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 296
Uli Schlachter

Efficient Translation with Linear Bimorphisms . . . . . . . . . . . . . . . . . . . . . . 308


Christoph Teichmann, Antoine Venant, and Alexander Koller

Author Index . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 321


Constraint Satisfaction Problems:
Complexity and Algorithms

Andrei A. Bulatov(B)

School of Computing Science, Simon Fraser University,


8888 University Drive, Burnaby, Canada
abulatov@sfu.ca

Abstract. In this paper we briefly survey the history of the Dichotomy


Conjecture for the Constraint Satisfaction problem, that was posed 25
years ago by Feder and Vardi. We outline some of the approaches to this
conjecture, and then describe an algorithm that yields an answer to the
conjecture.

1 Constraint Satisfaction Problem

We begin with definitions, examples and brief historical remarks on the


Constraint Satisfaction Problem.

1.1 The Problem

The archetypal example of the Constraint Satisfaction Problem is a Sudoku


puzzle, see, Fig. 1: One needs to assign values to every cell of the puzzle so
that the assignment satisfies certain constraints, such as the values in every
row, column, and smaller block are different. This example can be naturally
generalized in the following way. In the definition below tuples of elements are
denoted in boldface, say, a, and the ith component of a is referred to as a[i].

Definition 1. Let A1 , . . . , An be finite sets. An instance I of the Constraint


Satisfaction Problem (CSP for short) over A1 , . . . , An consists of a finite set of
variables V such that each v ∈ V is assigned a domain Aiv , iv ∈ {1, . . . , n},
and a finite set of constraints C. Each constraint is a pair s, R where R is a
relation over A1 , . . . , An (say, k-ary), often called the constraint relation, and s
is a k-tuple of variables from V , called the constraint scope. Let σ : V → A =
A1 ∪· · ·∪An with σ(v) ∈ Aiv ; we write σ(s), for (σ(s[1]), . . . , σ(s[k])). A solution
of I is a mapping σ : V → A such that for every constraint a, R ∈ C we have
σ(s) ∈ R. The objective in the CSP is to decide whether or not a solution of a
given instance I exists.

This research was supported by an NSERC Discovery grant.


c Springer International Publishing AG, part of Springer Nature 2018
S. T. Klein et al. (Eds.): LATA 2018, LNCS 10792, pp. 1–25, 2018.
https://doi.org/10.1007/978-3-319-77313-1_1
2 A. A. Bulatov

Fig. 1. A Sudoku puzzle as a CSP. The ellipses inducate some of the constraints

Since its inception in the early 70s [59], the CSP has become a very popular
and powerful framework, widely used to model computational problems first in
artificial intelligence, [34] and later in many other areas.
Modeling a specific computational problem usually gives rise to a restricted
CSP. Such restrictions can be imposed either on the type of the allowed con-
straint relations, or on the way the constraint scopes interact, or both. Restric-
tions of the first kind—the main subject of this paper—are usually given by
specifying a constraint language, that is, a set of relations Γ over a set, or a
collection of sets such that every constraint relation has to belong to Γ . More
formally, let A1 , . . . , A be finite sets and Γ a set (finite or infinite) of relations
over A1 , . . . , A , called a constraint language. Then CSP(Γ ) is the class of all
instances I of the CSP such that R ∈ Γ for every constraint s, R from I. The
following examples are just a few of the problems representable as CSP(Γ ).

k-Col The standard k-Coloring problem has the form CSP(Γk−Col ), where
Γk−Col = {=k } and =k is the disequality relation on a k-element set
(of colours).
3-SAT An instance of the 3-SAT problem is a propositional logic formula in
CNF each clause of which contains 3 literals, and asking if it has a sat-
isfying assignment. Thus, 3-SAT is equivalent to CSP(Γ3SAT ), where
Γ3SAT is the constraint language on {0, 1} and containing relations
R1 , . . . , R8 , which are the 8 ternary relations that can be expressed by
a 3-clause.
Lin Let F be a finite field and let 3Lin(F ) be the problem of deciding the
consistency of a system of linear equations over F each of which con-
tains at most 3 variables. Then 3Lin(F ) is equivalent to CSP(Γ3Lin(F ) ),
where Γ3Lin(F ) is the constraint language over F whose relations are
given by an equation with at most 3 variables.
MonEq Let M be a monoid (or a semigroup). An equation over M is an expres-
sion of the form t = s, where t and s are words that involve indeter-
minates and constants from M . A solution of t = s is an assignment
of elements from M to the indeterminates such that t and s evaluate
to the same element of M . In the problem MonEq(M ) we are given
Constraint Satisfaction Problems: Complexity and Algorithms 3

a system of equations over monoid M , and the objective is to decide,


whether or not there exists an assignment to the indeterminates that is
a solution for each of the given equations. Similar to 3Lin, MonEq(M )
is the problem CSP(ΓMonEq(M ) ), where ΓMonEq(M ) is the constraint lan-
guage consisting of all relations representable by an equation over M .
Note that ΓMonEq(M ) is infinite in general.

1.2 Logic and Databases

The next step in the CSP research was motivated by its applications in the theory
of relational databases. The Query Evaluation problem can be thought of as
deciding whether a first order sentence in the vocabulary of a database is true
in that database (that is, whether or not the query has an answer). The Query
Containment problem asks, given two queries Φ and Ψ , whether Φ → Ψ is
true in any database with the appropriate vocabulary. The former problem is
of course the main problem relational databases are needed for, while the latter
is routinely used in various query optimization techniques. It turns out that
both problems have intimate connections to the CSP, if the CSP is properly
reformulated. We need some terminology from model theory.
A vocabulary is a finite set of relational symbols R1 , . . . , Rn each of which
has a fixed arity ar(Ri ). A relational structure over vocabulary R1 , . . . , Rn is a
tuple H = (H; R1H , . . . , RnH ) such that H is a non-empty set, called the universe
of H, and each RiH is a relation over H having the same arity as the symbol Ri .
A sentence is said to be a conjunctive query if it only uses existential quantifiers
and its quantifier-free part is a conjunction of atomic formulas.

Definition 2. An instance of the CSP is a pair (Φ, H), where H is a relational


structure in a certain vocabulary, and Φ is a conjunctive sentence in the same
vocabulary. The objective is to decide whether Φ is true in H.

To see that the definition above is equivalent to the original definition of the
CSP, we consider its special case, k-Colouring. The vocabulary corresponding
to the problem contains just one binary predicate R= . Let Hk be the relational
Hk
structure with universe [k] = {1, . . . , k} in the vocabulary {R= }, where R= is
interpreted as the disequality relation on the set [k]. (In the future we will tend
to omit the superscripts indicating an interpretation, whenever it does not lead
to a confusion.) Then an instance G =(V, E) of k-Colouring is equivalent to
testing whether conjunctive sentence (u,v)∈E R= (u, v) (we omit the quantifier
prefix) is true in H.
The Query Evaluation problem is thus just the CSP, when restricted to
conjunctive queries. A database is then cosidered as the input relational struc-
ture. The Chandra-Merlin Theorem [29] shows that the Query Containment
problem is also equivalent to the CSP.
Relational database theory also massively contributed to the CSP research,
most notably by techniques related to local propagation algorithms and the logic
language Datalog. We will return to this subject in Sect. 3.1.
4 A. A. Bulatov

1.3 Homomorphisms and Dichotomy

The complexity of the CSP and its solution algorithms have been a major theme
since the problem was introduced. The general CSP is NP-complete, as it can
be easily shown. However, various restrictions of the CSP may result in more
tractable problems. Papers [36,37] by Feder and Vardi marked the beginning of a
systematic research of the complexity of the CSP. Among the numerous insights
of this paper, it introduced a new definition of the CSP.
Let G and H be relational structures over the same vocabulary. A homomor-
phism from G to H is a mapping ϕ : G → H from the universe G of G (the
instance) to the universe H of H (the template) such that, for every relation RG
of G and every tuple a ∈ RG , we have ϕ(a) ∈ RH .

Definition 3. An instance of the CSP is a pair of relational structures G, H


over the same vocabulary. The objective is to decide whether or not there exists
a homomorphism from G to H.

The homomorphic definition of the CSP makes its restricted version very ele-
gant. Let H be a relational structure. An instance of the nonuniform constraint
satisfaction problem CSP(H) is a structure G over the same vocabulary as H,
and the question is whether there is a homomorphism from G to H.
We again illustrate the correspondence between the definition above and
Definition 1 with an example. Consider again the k-Colouring problem, and
let Hk denote the relational structure with universe [k] over vocabulary {R= }
Hk
and R= is interpreted as the disequality relation. In other words, Hk = Kk is
a complete graph with k vertices. Then a homomorphism from a given graph
G = (V, E) to Kk exists if and only if it is possible to assign vertices of Kk
(colours) to vertices of G in such a way that for any (u, v) ∈ E the vertices u
and v are assigned different colours. The latter is just a proper k-colouring of G.
Using the homomorphism framework the k-Colouring problem can be gen-
eralized to the H-Colouring problem, where H is a graph or digraph: Given
a (di)graph G, decide whether or not there is a homomorphism from G to H.
Using the CSP notation the H-Colouring is CSP(EH ), where EH denotes the
edge relation of H. The H-Colouring problem has received much attention in
graph theory, see, e.g. [48,49].
Feder and Vardi in [36,37] also initiated the line of research that is central
for this paper, the study of the complexity of nonuniform CSPs. They observed
that in all known cases a nonuniform CSP either can be solved in polynomial
time, e.g. CSP(Γ3Lin ) or 2-Colouring, or is NP-complete, e.g., 3-SAT or k-
Colouring for k > 2. Two results were quite suggestive at that point. The first
one is the classification of the complexity of CSP(H) for 2-element structures (or
the Generalized Satisfiability problem, as it was referred to) by Schaefer
[68]; who proved that every such problem is either solvable in polynomial time,
or is NP-complete. The second result by Hell and Nešetřil [49] establishes that
the H-Colouring problem, where H is a graph, follows the same pattern: The
H-Colouring problem can be solved in polynomial time if H is bipartite or
Constraint Satisfaction Problems: Complexity and Algorithms 5

has a loop, and it is NP-complete otherwise. This allowed Feder and Vardi to
pose the following
Conjecture 4 (The Dichotomy Conjecture). For every finite relational structure
H the problem CSP(H) is either solvable in polynomial time or is NP-complete.
Most of the remaining part of this paper is devoted to resolving the
Dichotomy Conjecture.

1.4 The Other Side and Other Types


In nonuniform CSPs we restrict a constraint language or a template relational
structure. Clearly, other kinds of restrictions are also possible. For instance, in
database theory one cannot assume any restrictions on the possible content of a
database—which is a template structure in the Conjunctive Query Evalua-
tion problem—but some restrictions on the possible form of queries make much
sense. If a CSP is viewed as in Definition 1, the cosntraint scopes of an instance
I form a hypergraph on the set of variables. In a series of works [40,43,44,46,47]
it has been shown that if this hypergraph allows some sort of decomposition, or
is tree-like, then the CSP can be solved in polynomial time. The tree-likeness
of a hypergraph is usually formalized as having bounded treewidth, or bounded
hypertree width, or bounded fractional hypertree width. This line of work cul-
minated in [64], in which Marx gave an almost tight description of classes of
hypergraphs that give rise to a CSP solvable in polynomial time. Hybrid restric-
tions are also possible, although research in this direction has been more limited,
see, [30,38,39] as an example.
Along with the decision version of the CSP, other versions of the problem
have been intensively studied, see, [31] for definitions and early results on many
of them. These include the Quantified CSP, which is the problem of checking
whether or nor a conjunctive sentence allowing both universal and existential
quantifiers is true in a given relational structure [11]. In the MaxCSP one needs
to maximize the number of satisfied constraints. Note that often constraints in
MaxCSP are considered weighted and the the problem is to maximize the total
weight of satisfied constraints. Another variation of this problem is Valued CSP,
in which the constraints are replaced by functions that give a weight to each
assignment. The problem is to minimize (or maximize) the weight of an assign-
ment. This problem has been considered for both exact optimization [56,57,69]
and approximation algorithms [5,33,66]. The Counting CSP has received much
attention, particularly due to its connections to statistical physics. In this prob-
lem the goal is to count the number of solutions of a CSP (the unweighted version)
or to evaluate the total weight of the assignments (the weighted version). The
complexity of exact counting is well understood [18,28,35], while approximate
counting remains a largely open area [54].

2 Algebraic Approach
The most successful approach to tackling the Dichotomy Conjecture turned out
to be the algebraic one. In this section we introduce the algebraic approach to the
6 A. A. Bulatov

CSP and show how it can be used to determe the complexity of nonuniform CSPs.
A keen reader can find more details on the algebraic approach, its applications,
and the underlying algebraic facts from the following books [45,50], surveys
[6,7,26,27], and research papers [2–4,9,16,17,19,24,25,51].

2.1 Primitive Positive Definitions


Let Γ be a set of relations (predicates) over a finite set A. A relation R over A
is said to be primitive-positive (pp-) definable in Γ if R(x) = ∃y Φ(x, y), where
Φ is a conjunction that involves predicates from Γ and equality relations. The
formula above is then called a pp-definition of R in Γ . A constraint language Δ
is pp-definable in Γ if so is every relation from Δ. In a similar way pp-definability
can be introduced for relational structures.
Example 5. Let K3 = ([3], E) be a 3-element complete graph. Its edge relation
is the binary disequality relation on [3]. Then the pp-formula

Q(x, y, z) = ∃t, u, v, w(E(t, x) ∧ E(t, y) ∧ E(t, z) ∧ E(u, v) ∧ E(v, w)


∧E(w, u) ∧ E(u, x) ∧ E(v, y) ∧ E(w, z))

defines the relation Q that consists of all triples containing exactly 2 different
elements from [3].
A link between pp-definitions and reducibility between nonuniform CSPs was
first observed in [52].
Theorem 6 ([52]). Let Γ and Δ be constraint languages and Δ finite. If Δ is
pp-definable in Γ then CSP(Δ) is polynomial time reducible1 to CSP(Γ ).
It was later shown that pp-definability in Theorem 6 can be replaced with a
more general notion of pp-constructibility [7,8].

2.2 Polymorphisms and Invariants

Primitive positive definability can be concisely characterized using polymor-


phisms. An operation f : Ak → A is said to be a polymorphism of a relation
R ⊆ An if for any a1 , . . . , ak ∈ R the tuple f (a1 , . . . , ak ) also belongs to R, where
f (a1 , . . . , ak ) stands for (f (a1 [1], . . . , ak [1]), . . . , f (a1 [n], . . . , ak [n])). Operation
f is a polymorphism of a constraint language Γ if it is a polymorphism of every
relation from Γ . Similarly, operation f is a polymorphism of a relational structure
H if it is a polymorphism of every relation of H. The set of all polymorphisms of
language Γ or relational structure H is denoted by Pol(Γ ), Pol(H). If F is a set
of operations, Inv(F ) denotes the set of all relations R such that every operation
from F is a polymorphism of R.

1
In fact, due to the result of [67] this reduction can be made log-space.
Constraint Satisfaction Problems: Complexity and Algorithms 7

Example 7. Let R be an affine relation, that is, R is the solution space of a system
of linear equations over a field F . Then the operation f (x, y, z) = x − y + z is
a polymorphism of R. Indeed, let A · x = b be the system defining R, and
x, y, z ∈ R. Then

A · f (x, y, z) = A · (x − y + z) = A · x − A · y + A · z = b.

In fact, the converse can also be shown: if R is invariant under f , where f is


defined in a certain finite field F then R is the solution space of some system of
linear equations over F .

Example 8. In [55] it was shown that MonEq(M ) for a monoid M can be solved
in poltnomial time if and only if M is commutative and is the union of its sub-
groups. If this is the case then the operation t(x, y, z) = xy ω−1 z is a polymor-
phism of ΓMonEq(M ) (see also [58]). Here xω denotes the power of x such that
xω is an idempotent of M .

Several other useful polymorphisms are the following


Example 9 ([24,52,53]). (1) A binary semilattice operation.
(2) A k-ary operation g on A is called a near-unanimity operation, or NU if

g(y, x, . . . , x) = g(x, y, x, . . . , x) = · · · = g(x, . . . , x, y) = x

for any x, y ∈ A. A ternary NU is also referred to as a majority operation.


(3) A k-ary operation g on A is called a weak near-unanimity operation, or
WNU if it satisfies all the equations of an NU except for the last one

g(y, x, . . . , x) = g(x, y, x, . . . , x) = · · · = g(x, . . . , x, y).

(4) A ternary operation h on A is called Mal’tsev if

h(x, y, y) = h(y, y, x) = x

for any x, y ∈ A. As we saw in Example 7 any structure whose relations can


be represented by linear equations has the Mal’tsev polymorphism x − y + z
where + and − are the operations of the underlying field. Note that the
operation xy ω−1 z from Example 8 is not necessarily Mal’tsev.
(5) If every polymorphism f of a relational structure H is such that
f (x1 , . . . , xn ) = xi for some i and all x1 , . . . , xn ∈ H, then CSP(H) is
NP-complete.
(6) Schaefer’s Theorem [68] can be stated in terms of polymorphisms. Let H be
a 2-element relational structure (we assume its universe to be {0, 1}). The
problem CSP(H) is solvable in polynomial time if and only if one of the
following operations is a polymorphism of H: the constant operations 0 or 1,
the semilattice operations of conjunction and disjunction, the majority oper-
ation on {0, 1} (there is only one such operation), or the Mal’tsev operation
x − y + z where + and − are modulo 2. Otherwise CSP(H) is NP-complete.
8 A. A. Bulatov

A link between polymorphisms and pp-definability of relations is given by


Galois connection.
Theorem 10 (Galois connection, [10,42]). Let Γ be a constraint language
on A, and let R ⊆ An be a non-empty relation. Then R is preserved by all
polymorphisms of Γ if and only if R is pp-definable in Γ .

2.3 Algebras and the CSP

Recall that a (universal) algebra is an ordered pair A = (A, F ) where A is a


non-empty set, called the universe of A, and F is a family of finitary operations
on A, called the basic operations of A. Operations that can be obtained from F
by means of composition are said to be term operations of the algebra. Every
constraint language on a set A can be associated with an algebra Alg(Γ ) =
(A, Pol(Γ )). In a similar way any relational structure A (with universe A) can be
paired up with the algebra Alg(A) = (A, Pol(A)). On the other hand, an algebra
A = (A, F ), can be associated with the constraint language Inv(F ) or the class
Str(A) of structures A = (A, R1 , . . . , Rk ) such that R1 , . . . , Rk ∈ Inv(F ).
This correspondence can be extended to CSPs: For an algebra A by CSP(A)
we denote the class of problems CSP(A), A ∈ Str(A). Equivalently, CSP(A)
can be thought of as CSP(Inv(F )) for the infinite constraint language Inv(F ).
Note, however, that there is a subtle difference in the notion of polynomial time
solvability in these two cases that we will address next.
We say that algebra A is tractable if every CSP(A), A ∈ Str(A), is solv-
able in polynomial time. Observe that this does not guarantee that there is
a single solution algorithm for all such problems, nor it guarantees that there
is any uniformity among those algorithms. In general, it is plausible that for
a tractable algebra A = (A, F ) the problem CSP(Inv(F )) is NP-hard. If the
problem CSP(Inv(F )) is solvable in polynomial time, we call A globally tractable.
Algebra A is called NP-complete if some CSP(A), A ∈ Str(A) is NP-complete.
Algebra A is globally NP-complete if CSP(Inv(F )) is NP-complete.
Using the algebraic terminology we can pose a stronger version of the
Dichotomy Conjecture.

Conjecture 11 (Dichotomy Conjecture+). Every finite algebra is either globally


tractable or NP-complete (in the local sense).

Our next goal is to make Conjecture 11 more precise. We achieve this goal in
Sect. 2.4, while now we observe that the standard algebraic constructions behave
quite well with respect to reducibility between CSPs.

Theorem 12 ([25]). Let A = (A; F ) be a finite algebra. Then

(1) if A is tractable then so is every subalgebra, homomorphic image, and direct


power of A.
(2) if A has a NP-hard subalgebra, homomorphic image, or direct power, then
A is NP-hard.
Constraint Satisfaction Problems: Complexity and Algorithms 9

Fig. 2. (a) Algebra AM . (b) The congruence lattice of AM

More reducibility properties related to term operations of an algebra can


be proved. Recall that an operation f on a set A is said to be idempotent if
the equality f (x, . . . , x) = x holds for all x ∈ A. An algebra all of whose term
operations are idempotent is said to be idempotent.

Theorem 13 ([25]). For any finite algebra A there is an idempotent finite alge-
bra B such that:
– A is globally tractable if and only if B is globally tractable;
– A is NP-complete if and only if B is NP-complete.

Theorem 13 reduces the Dichotomy Conjecture+ 11 to idempotent algebras.

Example 14. The next example will be our running example throughout the
paper. Let A = {0, 1, 2}, and let AM be the algebra with universe A and two
basic operations: a binary operation r such that r(0, 0) = r(0, 1) = r(2, 0) =
r(0, 2) = r(2, 1) = 0, r(1, 1) = r(1, 0) = r(1, 2) = 1, r(2, 2) = 2; and a ternary
operation t such that t(x, y, z) = x − y + z if x, y, z ∈ {0, 1}, where +, − are
the operations of Z2 , t(2, 2, 2) = 2, and otherwise t(x, y, z) = t(x , y  , z  ), where
x = x if x ∈ {0, 1} and x = 0 if x = 2; the values y  , z  are obtained from
y, z by the same rule. It is an easy excercise to verify the following facts: (a)
B = ({0, 1}, r {0,1}, t {0,1}) and C = ({0, 2}, r {0,2}, t {0,2}) are subalgebras of AM ,
(b) the partition {0, 1}, {2} is a congruence of AM , let us denote it θ, (c) algebra C
is basically a semilattice, that is, a set with a semilattice operation, see Fig. 2(a).
The classes of congruence θ are 0θ = {0, 1}, 2θ = {2}. Then the quotient
algebra AM /θ is also basically a semilattice, as r/θ(0θ , 0θ ) = r/θ(0θ , 2θ ) =
r/θ(2θ , 0θ ) = 0θ and r/θ(2θ , 2θ ) = 2θ .

2.4 The CSP and Omitting Types


In the 1980s Hobby and McKenzie developed tame congruence theory that stud-
ies the local structure of algebras [50]. They discovered that the local structure
of universal algebras is surprisingly well behaved and can be classified into just
five types. Each type is associated with a certain basic algebra, and if an algebra
admits a type, it means that its local structure resembles that of the correspond-
ing basic algebra. The five basic algebras and corresponding types are:
10 A. A. Bulatov

1. A unary algebra whose basic operations are permutations (unary type);


2. A one-dimensional vector space over some finite field (affine type);
3. A 2-element boolean algebra whose basic operations include conjunction, dis-
junction, and negation (boolean type);
4. A 2-element lattice whose basic operations include conjunction and disjunc-
tion (lattice type);
5. A 2-element semilattice whose basic operations include a semilattice operation
(semilattice type).
Omitting or admitting types is strongly related to the complexity of the CSP.
Theorem 5 from [25] claims that if a relational structure A is such that Alg(A) is
idempotent and admits the unary type then CSP(A) is NP-complete. Combined
with Theorem 12 this allows for a more precise Dichotomy Conjecture.
Conjecture 15. If a relational structure A is such that Alg(A) is idempotent, then
CSP(A) is solvable in polynomial time if and only if no subalgebra of Alg(A)
admits the unary type. Otherwise it is NP-complete.
Or in the stronger algebraic version.
Conjecture 16 (Dichotomy Conjecture ++). An idempotent algebra A is globally
tractable if and only if none of its subalgebras admits the unary type. Otherwise
it is NP-complete.
The results [63] imply that the latter condition in Conjecture 16 is also equiv-
alent to the existence of a weak near-unanimity term operation in A.
Conjecture 16 has been confirmed in a number of special cases.
– Schaefer’s classification of 2-element structures [68] with respect to complexity
can be easily extended to 2-element algebras. Then it claims that an idem-
potent 2-element algebra is globally tractable if and only if it has one of the
following term operations: a semilattice operation, a majority operation, or
the affine operation x − y + z. By [65] this is equivalent to having a term weak
near-unanimity operation.
– Let H be a graph, A = Alg(H), and let B the idempotent algebra constructed
from A as in Theorem 13. If H is bipartite then B is 2-element and has a
majority term operation. Otherwise B admits the unary type [15]. Thus the
classification from [49] matches the Dichotomy Conjecture++.
– The Dichotomy Conjecture++ was confirmed for 3-element algebras in [12,
16], and for 4-element algebras in [61].
– It was shown in [13,17] that the Dichotomy Conjecture++ holds for conser-
vative algebras, that is, algebras in which every subset of the universe is a
subalgebra. These results have also been simplified in [1,19].
– Finally, Zhuk in [70,71] proved the conjecture for 5- and 7-element algebras.
In the rest of this paper we show that Conjecture 16 is true. The hardness
part of the conjecture follows from the mentioned result of [25]; so we focus
on the algorithmic part. The algorithm presented here is based on [23] (a full
version can be found in [22]). Note that the conjecture was also independently
proved by Zhuk [72].
Constraint Satisfaction Problems: Complexity and Algorithms 11

3 CSP Algorithms
It would be natural to expect a wide variety of algorithms solving the CSP in
those cases in which it can be solved in polynomial time. However, surprisingly,
only two types of such algorithms are known, and for each type there is ‘the
most general’ algorithm, which means that basically only two CSP algorithms
exist.

3.1 Local Propagation Algorithms

The first type can be described as local propagation algorithms. We describe one
such algorithm, applicable whenever any other propagation algorithm solves the
problem.
Let R ⊆ An be a relation, a ∈ An , and J = {i1 , . . . , ik } ⊆ [n]. Let prJ a =
(a[i1 ], . . . , a[ik ]) and prJ R = {prJ a : a ∈ R}. Often we will use sets of CSP
variables to index entries of tuples and relations. Projections in such cases are
defined in a similar way. Let I = (V, C) be a CSP instance. For W ⊆ V by IW
we denote the restriction of I onto W , that is, the instance (W, CW ), where for
each C = s, R ∈ C, the set CW includes the constraint CW = s ∩ W, prs∩W R.
The set of solutions of IW will be denoted by SW .
Unary solutions, that is, when |W | = 1 play a special role. As is easily
seen, for v ∈ V the set Sv is just the intersections of unary projections prv R
of constraints whose scope contains v. Instance I is said to be 1-minimal if
for every v ∈ V and every constraint C = s, R ∈ C such that v ∈ s, it holds
prv R = Sv . For a 1-minimal instance one may always assume that allowed values
for a variable v ∈ V is the set Sv . We call this set the domain of v and assume
that CSP instances may have different domains, which nevertheless are always
subalgebras or quotient algebras of the original algebra A. It will be convenient
to denote the domain of v by Av . The domain Av may change as a result of
transformations of the instance.
Instance I is said to be (2,3)-minimal if it satisfies the following condition:
– for every X = {u, v} ⊆ V , any w ∈ V − X, and any (a, b) ∈ SX , there is c ∈ Aw
such that (a, c) ∈ S{u,w} and (b, c) ∈ S{v,w} .
For k ∈ N, (k, k + 1)-minimality is defined in a similar way using k, k + 1.
Instance I is said to be minimal (or globally minimal) if for every C =
s, R ∈ C and every a ∈ R there is a solution ϕ such that ϕ(s) = a. Similarly, I
is said to be globally 1-minimal if for every v ∈ V and a ∈ Av there is a solution
ϕ with ϕ(v) = a.
Any instance can be transformed to a 1-minimal or (2,3)-minimal instance
in polynomial time using the standard constraint propagation algorithms (see,
e.g. [34]). These algorithms work by changing the constraint relations and the
domains of the variables eliminating some tuples and elements from them. We
call such a process tightening the instance. It is important to notice that if the
original instance belongs to CSP(A) for some algebra A, that is, all its constraint
relations are invariant under the basic operations of A, the constraint relations
12 A. A. Bulatov

obtained by propagation algorithms are also invariant under the basic opera-
tions of A, and so the resulting instance also belongs to CSP(A). Establishing
minimality amounts to solving the problem and so not always can be easily done.
If a constraint propagation algorithm solves a CSP, the problem is said to be
of bounded width. More precisely, CSP(Γ ) (or CSP(A)) is said to have bounded
width if for some k every (k, k + 1)-minimal instance from CSP(Γ ) (or CSP(A))
has a solution (we also say that CSP(Γ ) has width k in this case). Problems of
bounded width are well studied, see the older survey [26] and more recent [2].

Theorem 17 ([2,14,21,60]). For an idempotent algebra A the following are


equivalent:

(1) CSP(A) has bounded width;


(2) every (2,3)-minimal instance from CSP(A) has a solution;
(3) A has a weak near-unanimity term of arity k for every k ≥ 3;
(4) every quotient algebra of a subalgebra of A has a nontrivial operation, and
none of them is equivalent to a module (in a certain precise sense).

Example 18. (1) The 2-SAT problem has bounded width, namely, width 2.
(2) The H-Colouring problem has width 2 when graph H is bipartite, and
NP-complete otherwise.
(3) The Horn-SAT is the Satisfiability problem restricted to Horn clauses,
i.e., clauses of the form x1 ∧ · · · ∧ xk → y. Let Γk-Horn be the constraint
language consisting of relations expressible by a Horn clause with at most
k premises. The problem k-Horn-SAT is equivalent to CSP(Γk-Horn ) and
has width k.

3.2 Gaussian Elimination and Few Subpowers

The simplest algorithm of the second type is known from basic linear algebra—
Gaussian elimination. While propagation algorithms cannot solve the Lin prob-
lem, it is solvable by Gaussian elimination. A similar algorithm solving group
constraints, defined in terms of finite groups, was suggested in [37].
Algebraic techniques make it possible to generalize the Gaussian elimination
algorithm. The algorithm from [24] solving CSP(A) for a relational structure A
with a Mal’tsev polymorphism can be viewed as a generalization of Gaussian
elimination in the following sense. Similar to the output of Gaussian elimination
it constructs some sort of a basis or a compact representation of the set of all
solutions of a CSP.
It is thought that the property of relations to have a compact representation,
where compactness is understood as having size polynomial in the arity of the
relation, is the right generalization of linear algebra problems where Gaussian
elimination can be used. Let A = (A, F ) be an algebra. It is said to be an algebra
with few subpowers if every relation over A invariant under F admits a compact
representation [9,51]. The term ‘few subpowers’ comes from the observation that
every relation invariant under F is a subalgebra of a direct power of A, and if
Constraint Satisfaction Problems: Complexity and Algorithms 13

the size of compact representation is bounded by a polynomial p(n) then at


most 2p(n) n-ary relations can be represented, while the total number of such
n
relations can be as large as 2|A| . Algebras with few subpowers are completely
characterized by Idziak et al. [9,51]. A minor generalization of the algorithm
from [32] solves CSP(A), where A has few subpowers.
Here the few subpowers algorithm is used in the context of semilattice edges.
A pair of elements a, b ∈ A is said to be a semilattice edge if there is a binary
term operation f of A such that f (a, a) = a and f (a, b) = f (b, a) = f (b, b) = b,
that is, f is a semilattice operation on {a, b}. For example, the set {0, 2} from
Example 14 is a semilattice edge, and the operation r of AM witnesses that.
Proposition 19 ([21]). If an idempotent algebra A has no semilattice edges, it
has few subpowers, and therefore CSP(A) is solvable in polynomial time.
Semilattice edges have other useful properties including the following one
that we use for reducing a CSP to smaller problems.
Lemma 20 ([20]). For any idempotent algebra A there is a term operation xy
(think multiplication) such that xy is a semilattice operation on any semilattice
edge and for any a, b ∈ A either ab = a or {a, ab} is a semilattice edge.
Note that any semilattice operation satisfies the conditions of Lemma 20. The
operation r of the algebra AM from Example 14 is not a semilattice operation
(it is not commutative), but it satisfies the conditions of Lemma 20.

4 Congruence Separation and Centralizers


We now move on to describe the algorithm resolving the Dichotomy Conjecture.
In this section we introduce two of the key ingredients of our algorithm.

4.1 Separating Congruences


Unlike the vast majority of the literature on the algebraic approach to the CSP
we use not only term operations, but also polynomial operations of an algebra.
It should be noted however that the first to use polynomials for CSP algorithms
was Maroti in [62]. We make use of some ideas from that paper in the next
section. Let f (x1 , . . . , xk , y1 , . . . , y ) be a k + -ary term operation of an algebra
A and b1 , . . . , b ∈ A. The operation g(x1 , . . . , xk ) = f (x1 , . . . , xk , b1 , . . . , b ) is
called a polynomial of A. A polynomial for which k = 1 is said to be a unary
polynomial. If α is a congruence, and f is a unary polynomial, by f (α) we denote
the set of pairs {(f (a), f (b)) | (a, b) ∈ α}.
Let A be an algebra and let Con(A) denote its congruence lattice. For α, β ∈
Con(A) we write α ≺ β if α < β (that is, α ⊂ β as sets of pairs) and α ≤ γ ≤ β
in Con(A) implies γ = α or γ = β. If this is the case we call (α, β) a prime
interval in Con(A). Let α ≺ β and γ ≺ δ be prime intervals in Con(A). We say
that α ≺ β can be separated from γ ≺ δ if there is a unary polynomial f of
A such that f (β) ⊆ α, but f (δ) ⊆ γ. The polynomial f in this case is said to
separate α ≺ β from γ ≺ δ.
14 A. A. Bulatov

Example 21. The unary polynomials of the algebra AM from Example 14 include
the following unary operations (these are the polynomials we will use, there are
more unary polynomials of AM ):
h1 (x) = r(x, 0) = r(x, 1), such that h1 (0) = h1 (2) = 0, h1 (1) = 1;
h2 (x) = r(2, x), such that h2 (0) = h2 (1) = 0, h2 (2) = 2;
h3 (x) = r(0, x) = 0.
The lattice Con(AM ) has two prime intervals 0 ≺ θ and θ ≺ 1 (see Example 14
and Fig. 2(b)). As is easily seen, h3 (1) ⊆ 0, therefore h3 collapses both prime
intervals. Since h1 (θ) ⊆ 0, but h1 (1) ⊆ θ, polynomial h1 separates (0, θ) from
(θ, 1). Similarly, the polynomial h2 separates (θ, 1) from (0, θ), because h2 (1) ⊆ θ,
while h2 (θ) ⊆ 0.

In a similar way separation can be defined for prime intervals in different


coordinate positions of a relation. Let R be a subdirect product of A1 × · · · × An ,
that is, pri R = Ai for i ∈ [n]. Then R can also be viewed as an algebra with
operations acting component-wise, and polynomials of R can be defined in the
same way. Since every basic operation acts on R component-wise, its unary
polynomials also act component-wise. Therefore, for a unary polynomial f of R
it makes sense to consider f (a), where a ∈ Ai , i ∈ [n]. Let i, j ∈ [n] and let
α ≺ β, γ ≺ δ be prime intervals in Con(Ai ) and Con(Aj ), respectively. Interval
α ≺ β can be separated from γ ≺ δ if there is a unary polynomial f of R such
that f (β) ⊆ α but f (δ) ⊆ γ. The binary relation ‘cannot be separated’ on the
set of prime intervals of an algebra or factors of a relation is easily seen to be
reflexive and transitive. We will say that α ≺ β, γ ≺ δ cannot be separated if
α ≺ β and γ ≺ δ cannot be separated from each other.

Example 22. Let R be a ternary relation over AM invariant under r, t, given by


⎛ ⎞
0011001122
R = ⎝0 1 1 0 0 1 1 0 2 2⎠,
0000111102

where triples, the elements of the relation are written vertically. It will be con-
venient to distinguish congruences in the three factors of R, so we denote them
by 0i , θi , 1i for the ith factor. Since pr12 R is the congruence θ, any unary poly-
nomial h of R acts identically modulo θ on the first and the second coordinate
positions. In particular, the prime interval (θ1 , 11 ) cannot be separated from the
prime interval (θ2 , 12 ). Consider the polynomial h(x) of R given by
⎛⎛ ⎞ ⎞ ⎛ ⎞ ⎛ ⎞
2 r(2, x) h2 (x)
h(x) = r ⎝⎝2⎠ , x⎠ = ⎝r(2, x)⎠ = ⎝h2 (x)⎠ ,
0 r(0, x) h3 (x)

it is a polynomial of R because (2, 2, 0) ∈ R. Since h2 (1) ⊆ θ, but h3 (1) ⊆ θ


and h3 (θ) ⊆ 0, the prime interval (θ2 , 12 ) can be separated from (03 , θ3 ) and
(θ3 , 13 ). Similarly, the interval (θ3 , 13 ) can be separated from (01 , θ1 ), (02 , θ2 ).
Constraint Satisfaction Problems: Complexity and Algorithms 15

Through a slightly more involved argument it can be shown that (θ3 , 13 ) cannot
be separated from (θ1 , 11 ), (θ2 , 12 ). In the next section we explain why the prime
intervals (0i , θi ), (0j , θj ) cannot be separated from each other.

4.2 Quasi-Centralizers
The second ingredient we will use here is the notion of quasi-centralizer of a pair
of congruences. It is similar to the centralizer as it is defined in commutator
theory [41], albeit the exact relationship between the two concepts is not quite
clear, and so we name it differently for safety.
For an algebra A, a term operation f (x, y1 , . . . , yk ), and a ∈ Ak , let f a (x) =
f (x, a); it is a unary polynomial of A. Let α, β ∈ Con(A), and let ζ(α, β) ⊆ A2
denote the following binary relation: (a, b) ∈ ζ(α, β) if an only if, for any term
operation f (x, y1 , . . . , yk ), any i ∈ [k], and any a, b ∈ Ak such that a[i] = a,
b[i] = b, and a[j] = b[j] for j = i, it holds f a (β) ⊆ α if and only if f b (β) ⊆ α.
(Polynomials of the form f a , f b are sometimes called twin polynomials.) The
relation ζ(α, β) is always a congruence of A. Next we show how it is related to
the structure of algebra A and the corresponding CSP.

Example 23. In the algebra AM , see Example 14, the quasi-centralizer acts as fol-
lows: ζ(0, θ) = 1 and ζ(θ, 1) = θ. We start with the second centralizer. Since every
polynomial preserves congruences, for any term operation h(x, y1 , . . . , yk ) and
any a, b ∈ AkM such that (a[i], b[i]) ∈ θ for i ∈ [k], we have (ha (x), hb (x)) ∈ θ for
any x. This of course implies ζ(θ, 1) ≥ θ. On the other hand, let f (x, y) = r(y, x).
Then as we saw before, f 0 (x) = f (x, 0) = r(0, x) = h3 (x) and f 2 (x) =
f (x, 2) = r(2, x) = h2 (x), and f 0 (1) ⊆ θ, while f 2 (1) ⊆ θ. This means that
(0, 2) ∈ ζ(θ, 1) and so ζ(θ, 1) ⊂ 1. For the first centralizer it suffices to demon-
strate that the condition in the definition of quasi-centrailizer is satisfied for pairs
of twin polynomials produced by r, t of the form (r(a, x), r(b, x)), (r(x, a), r(x, b)),
(t(x, a1 , a2 ), t(x, b1 , b2 )), (t(a1 , x, a2 ), t(b1 , x, b2 )), (t(a1 , a2 , x), t(b1 , b2 , x)), which
can be verified directly.
Note that the equality ζ(0, θ) = 1 explains why prime intervals (0i , θi ), (0j , θj )
in Example 22 cannot be separated. For that the relation prij R has to contain
tuples (a, b), (c, d) such that (a, c) ∈ ζ(0i , θi ) while (b, d) ∈ ζ(0j , θj ), which is
impossible.

5 The Algorithm
In this section we introduce the reductions used in the algorithm, and then
explain the algorithm itself.

5.1 Decomposition of CSPs


Let R be a binary relation, a subdirect product of A × B, and α ∈ Con(A),
γ ∈ Con(B). Relation R is said to be αγ-aligned if, for any (a, c), (b, d) ∈ R,
16 A. A. Bulatov

(a, b) ∈ α if and only if (c, d) ∈ γ. This means that if A1 , . . . , Ak are the α-blocks
of A, then there are also k γ-blocks of B and they can be labeled B1 , . . . , Bk in
such a way that

R = (R ∩ (A1 × B1 )) ∪ · · · ∪ (R ∩ (Ak × Bk )).

Lemma 24. Let R, A, B be as above and α, β ∈ Con(A), γ, δ ∈ Con(B), with


α ≺ β, γ ≺ δ. If (α, β) and (γ, δ) cannot be separated, then R is ζ(α, β)ζ(γ, δ)-
aligned.

Lemma 24 provides a way to decompose CSP instances. Let I = (V, C) be


a (2,3)-minimal instance from CSP(A). We will always assume that a (2,3)-
minimal instance has a constraint C X = X, RX  for every X ⊆ V , |X| = 2,
where RX = SX . Recall that Av denotes the domain of v ∈ V . Also, let W ⊆ V
and congruences αv , βv ∈ Con(Av ) for v ∈ W be such that αv ≺ βv , and for any
v, w ∈ W the intervals (αv , βv ) and (αw , βw ) cannot be separated in R{v,w} .
Denoting ζv = ζ(αv , βv ) for v ∈ W we see that there is a one-to-one corre-
spondence between ζv - and ζw -blocks of Av and Aw , v, w ∈ W . Moreover, by
(2,3)-minimality these correspondences are consistent, that is, if u, v, w ∈ W and
Bu , Bv , Bw are ζu -, ζv - and ζw -blocks, respectively, such that R{u,v} ∩(Bu ×Bv ) =
∅ and R{v,w} ∩ (Bv × Bw ) = ∅, then R{u,w} ∩ (Bu × Bw ) = ∅. This means
that IW can be split into several instances, whose domains are ζv -blocks.

Lemma 25. Let I, W, αv , βv for each v ∈ W , be as above. Then IW can be


decomposed into a collection of instances I1 , . . . , Ik , k constant, Ii = (W, Ci )
such that every solution of IW is a solution of one of the Ii and for every
v ∈ W its domain in Ii is a ζv -block.

Example 26. Consider the following simple CSP instance from CSP(AM ), where
AM is the algebra introduced in Example 14, and R is the relation introduced in
Example 22: I = (V = {v1 , v2 , v3 , v4 , v5 }, {C 1 = s1 = (v1 , v2 , v3 ), R1 , C 2 =
s2 = (v2 , v4 , v5 ), R2 }, where R1 = R2 = R. To make the instance (2,3)-
minimal we run the appropriate local propagation algorithm on it. First, such
an algorithm adds new binary constraints C {vi ,vj } = (vi , vj ), R{vi ,vj }  for
i, j ∈ [5] starting with R{vi ,vj } = AM × AM . It then iteratively removes pairs
from these relations that do not satisfy the (2,3)-minimality condition. Simi-
larly, it tightens the original constraint relations if they violate the conditions
of (2,3)-minimality. This algorithm does not change constraints C 1 , C 2 , and
the new binary relations are as follows: R{v1 ,v2 } = R{v2 ,v4 } = R{v1 ,v4 } = θ,
R{v1 ,v3 } = R{v2 ,v3 } = R{v2 ,v5 } = R{v4 ,v5 } = R{v1 ,v5 } = R{v3 ,v4 } = Q, and
R{v3 ,v5 } = S, where
   
001122 0011022
Q = pr13 R = , S= .
010102 0101202

For convenience let the domain of vi be denoted by Ai , its elements by 0i , 1i , 2i ,


and the congruences of Ai by 0i , θi , 1i .
Constraint Satisfaction Problems: Complexity and Algorithms 17

Let W = {v1 , v2 , v4 }, αi = θi , βi = 1i for vi ∈ W . We have ζi = ζ(αi , βi ) =


θi = αi . Then, as was observed in Example 23, the prime interval (αi , βi ) cannot
be separated from (αj , βj ) for vi , vj ∈ W . Therefore by Lemma 25 the instance
IW = ({v1 , v2 , v4 }, {CW
1
= (v1 , v2 ), prv1 v2 R1 , CW
2
= (v2 , v4 ), prv2 v4 R2 }) can
be decomposed into a disjoint union of two instances:

I1 = ({v1 , v2 , v4 }, {(v1 , v2 ), Q1 , (v2 , v4 ), Q2 }),


I2 = ({v1 , v2 , v4 }, {(v1 , v2 ), {(21 , 22 )}, (v2 , v4 ), {(22 , 24 )}}),

where Q1 = {01 , 11 } × {02 , 12 }, Q2 = {02 , 12 } × {04 , 14 }.

5.2 Block-Minimality

In order to formulate the algorithm properly we need one more transformation


of algebras. An algebra A is said to be subdirectly irreducible if the intersection
of all its nontrivial (different from the equality relation) congruences is non-
trivial. This smallest nontrivial congruence μA is called the monolith of A. For
instance, the algebra AM from Example 14 is subdirectly irreducible, because it
has the smallest nontrivial congruence, θ. It is a folklore observation that any
CSP instance can be transformed in polynomial time to an instance, in which
the domain of every variable is a subdirectly irreducible algebra. We will assume
this property of all the instances we consider.
Lemma 25 allows us to use a new type of consistency of a CSP instance, block-
minimality, which is key for our algorithm. In a certain sense it is similar to the
standard local consistency, as it is also defined through a family of relations
that have to be consistent in a certain way. However, block-minimality is not
quite local, and is more difficult to establish, as it involves solving smaller CSP
instances recursively. The definitions below are designed to allow for an efficient
procedure to establish block-minimality. This is achieved either by allowing for
decomposing a subinstance into instances over smaller domains as in Lemma 25,
or by replacing large domains with their quotient algebras.
Let I = (V, C) ∈ CSP(A) and αv be a congruence of Av for v ∈ V . By I/α
we denote the instance (V, Cα ) constructed as follows: the domain of v ∈ V is
Av /αv ; for every constraint C = s, R ∈ C, s = (v1 , . . . , vk ), the set Cα includes
the constraint s, R/α, where R/α = {(a[v1 ]αv1 , . . . , a[vk ]αvk ) | a ∈ R}.
We start with several definitions. Let I = (V, C) be a (2,3)-minimal instance
and let {RX | X ⊆ V, |X| = 2} be the relations introduced after Lemma 24. Let
U I denote the set of triples (v, α, β) such that v ∈ V , α, β ∈ Con(Av ), and α ≺ β.
For every (v, α, β) ∈ U I , let Wv,αβ denote the set of all variables w ∈ V such
that (α, β) and (γ, δ) cannot be separated in R{v,w} for some γ, δ ∈ Con(Aw )
with (w, γ, δ) ∈ U I . Sets of the form Wv,αβ are called coherent sets. Let Z I
denote the set of triples (v, α, β) ∈ U I , for which ζ(α, β) is the full relation.
We say that algebra Av is semilattice free if it does not contain semilattice
edges. Let size(I) denote the maximal size of domains of I that are not semilat-
tice free and MAX(I) be the set of variables v ∈ V with |Av | = size(I) and Av
18 A. A. Bulatov

is not semilattice free. For instances I, I  we say that I  is strictly smaller than
I if size(I  ) < size(I). For Y ⊆ V let μYv = μv if v ∈ Y and μYv = 0v otherwise.
Instance I is said to be block-minimal if for every (v, α, β) ∈ U I the following
conditions hold:

(B1) if (v, α, β) ∈ Z I , the problem IWv,αβ is minimal;


(B2) if (v, α, β) ∈ Z I , for every C = s, R ∈ C the problem IWv,αβ /μY , where
Y = MAX(I) − s, is minimal;
(B3) if (v, α, β) ∈ Z I , then for every (w, γ, δ) ∈ U I −Z I the problem IWv,αβ /μY ,
where Y = MAX(I) − (Wv,αβ ∩ Ww,γδ ) is minimal.

Example 27. Let us consider again the instance I from Example 26. There we
found all its binary solutions, and now we use them to find coherent sets and
to verify that this instance is block-minimal. For the instance I we have U I =
{(vi , 0i , θi ), (vi , θi , 1i ) | i ∈ [5]} and Z I = {(vi , 0i , θi ) | i ∈ [5]}. As we noticed
in Example 22, interval (0i , θi ) cannot be separated from (0j , θj ) for any i, j ∈
[5]. Therefore, for each i ∈ [5] we have Wvi ,0i θi = V . Also, it was shown in
Example 22 that (θi , 1i ) cannot be separated from (θj , 1j ) for {i, j} = {1, 2} and
{i, j} = {2, 4}, while {θi , 1i } can be separated from (θj , 1j ) and (0j , θj ) for i ∈
{1, 2, 4} and j ∈ {3, 5}. Therefore, for i ∈ {1, 2, 4} we have Wvi ,θi 1i = {v1 , v2 , v4 }.
Finally, (θ3 , 13 ) can be separated from (05 , θ5 ), (θ5 , 15 ) by considering the relation
S from Example 26, and (0i , θi ), i ∈ {1, 2, 4} can be separated from (θ3 , 13 ) by
considering the relation Q. Therefore, Wvi ,θi 1i = {vi } for i ∈ {3, 5}.
Now we check the conditions (B1)–(B3) for I. Since ζ(θi , 1i ) = θi , i ∈ [5],
for the coherent sets Wvi ,θi 1i we need to check condition (B1). If i = 3, 5 this
condition is trivially true, as the set of solutions of I on every 1-element set
of variables is AM . Consider Wv1 ,θ1 11 = {v1 , v2 , v4 }; as is easily seen, a triple
(a1 , a2 , a4 ) is a solution of I{v1 ,v2 ,v4 } if and only if (a1 , a2 ), (a1 , a4 ), (a2 , a4 ) ∈ θ.
Condition (B1) amounts to saying that for any constraint of I, say, C 1 , and any
tuple a from its constraint relation R1 , the projection prv1 v2 a can be extended
to a solution of I{v1 ,v2 ,v4 } . Since prv1 v2 a ∈ θ, this can always be done. For other
constraints (B1) is verified in a similar way.
Next consider Wv1 ,01 θ1 = V . As ζ(01 , θ1 ) = 11 , we have to verify conditions
(B2),(B3). We consider condition (B2) for constraint C 1 , the remaining cases are
similar. The monolith of AM is θ, therefore in the first case Y = {v4 , v5 } and μYvi
is the equality relation for i ∈ {1, 2, 3} and μYv4 = θ4 , μYv5 = θ5 . The instance I/μY
is as follows: I/μY = (V, {C 1 = s1 , R1 , C 2 = s2 , R2 /μ}). The constraint rela-
tion, of C 1 equals R1 , as μYvi = 0i for i ∈ {1, 2, 3}. The constraint relation of C 2
then equals R2 = R2 /μY = {(0, 0θ , 0θ ), (1, 0θ , 0θ ), (2, 2θ , 0θ ), (2, 2θ , 2θ )}. Now, for
every tuple a ∈ R1 , and for every tuple b ∈ R2 we need to find solutions ϕ, ψ of
I/μY such that ϕ(vi ) = a[vi ] for i ∈ {1, 2, 3} and ψ(vi ) = b[vi ] for i ∈ {2, 4, 5}. If
a[v2 ] ∈ {0, 1} (b[v2 ] ∈ {0, 1}) then extending a by ϕ(v4 ) = ϕ(v5 ) = 0θ (extending
b by ψ(v1 ) = ψ(v3 ) = 0) gives solutions of I/μY . If a[v2 ] = 2 (b[v2 ] = 2), then
tuples a, b can be extended by ϕ(v4 ) = ϕ(v5 ) = 2θ and by ψ(v1 ) = ψ(v3 ) = 2 to
solutions of I/μY .
Constraint Satisfaction Problems: Complexity and Algorithms 19

Next we observe that establishing block-minimality can be efficiently reduced


to solving a polynomial number of strictly smaller instances. First, observe that
Wv,αβ can be large, even equal to V , as we saw in Example 27. However if
(v, α, β) ∈ Z I , by Lemma 25 the problem IWv,αβ splits into a union of disjoint
problems over smaller domains, and so its minimality can be established by
recursing to strictly smaller problems. On the other hand, if (v, α, β) ∈ Z I then
IWv,αβ may not split into such a union. Since we need an efficient procedure
of establishing block-minimality, this explains the complications introduced in
conditions (B2), (B3). In the case of (B2) IWv,αβ /μY (see the definition of block-
minimality) can be solved for each tuple a ∈ R by fixing the values from this
tuple. Taking the quotient algebras of the remaining domains guarantees that we
recurse to a strictly smaller instance. In the case of (B3) IWv,αβ ∩Ww,γδ /μY splits
into disjoint subproblems, and we branch on those strictly smaller subproblems.

Lemma 28. Let I = (V, C) be a (2,3)-minimal instance. Then by solving a


quadratic number of strictly smaller CSPs I can be transformed to an equivalent
block-minimal instance I  .

5.3 The Algorithm


In the algorithm we distinguish three cases depending on the presence of semi-
lattice edges and quasi-centralizers of the domains of variables. In each case we
employ different methods of solving or reducing the instance to a strictly smaller
one. Algorithm 1 gives a more formal description of the solution algorithm.
Let I = (V, C) be a subdirectly irreducible, (2,3)-minimal instance. Let
Center(I) denote the set of variables v ∈ V such that ζ(0v , μv ) = 1v . Let μ∗v = μv
if v ∈ MAX(I) ∩ Center(I) and μ∗v = 0v otherwise.

Semilattice Free Domains. If no domain of I contains a semilattice edge then


by Proposition 19 I can be solved in polynomial time, using the few subalgebras
algorithm, as shown in [21,51].

Small Centralizers. If μ∗v = 0v for all v ∈ V , block-minimality guarantees the


existence of a solution, as Theorem 29 shows, and we can use Lemma 28 to solve
the instance.

Theorem 29. If I is subdirectly irreducible, (2,3)-minimal, block-minimal, and


MAX(I) ∩ Center(I) = ∅, then I has a solution.

Proof of Theorem 29 is the most technically involved part of our result.

Large Centralizers. Suppose that MAX(I) ∩ Center(I) = ∅. In this case the


algorithm proceeds in three steps.
Step 1. Consider the problem I/μ∗ . We establish the global 1-minimality
of this problem. If it is tightened in the process, we start solving the new
problem from scratch. To check global 1-minimality, for each v ∈ V and every
Another random document with
no related content on Scribd:
where he would have been sure of a good reception, made him
adopt an unfortunate course. Unable, in face of his instructions from
home, to stop the expedition altogether, as in our case, he ordered
its leader to go towards the districts occupied by the Mossi, who
were wholly unprepared to receive it.
We left Sego on the morning of the 18th, and arrived the same
day at Sansanding, where my good friend Mademba was waiting for
us.
Every traveller who has been to Mademba’s, and has since
written an account of his journey, has made a point, not without
justice, of bearing grateful testimony to the merits of this noble fellow.
Mademba Seye is a native who was at one time in the employ of
the French post and telegraph office. He especially distinguished
himself during the construction of the line which, keeping alongside
of the Senegal, crosses the Toucouleur districts of the Senegalese
Foota. Just now the Toucouleurs were very much irritated against us,
and full of arrogance because no punishment had been inflicted on
them for their daily misdeeds. They stopped barges coming up from
St. Louis, they molested the traders and pillaged their merchandise,
and the greatest skill, courage, and savoir faire were needed on the
part of Mademba to conquer the difficulties besetting his path.
MADEMBA.

Later he did wonders in the Sudan, and his defence of the village
of Guinina was a glorious feat of arms. He was victorious over the
troops of Fabu, the brother of Samory, though he had no one with
him but the few employés helping him to put down the line. Colonel
Gallieni sent for him to be a kind of chief interpreter, and he held that
position until, the Toucouleurs having been driven from Sego and
Nioro, the country just conquered by the French was properly
organized.
A small kingdom, with Sansanding as capital, was placed under
Mademba; he had in his service a certain number of sofas, or
captive Amadu warriors, who had surrendered to the French and to
the natives. Our postmaster-general soon became the Fama
Mademba, the word fama signifying a chief or king among the
natives of Bambara.
Mademba gathered a court about him, showing a very clear sense
of the right policy to pursue. When with us his manners and tastes
were quite civilized, but he knew that to get an influence over his
new subjects he must adopt the customs of their chiefs. He began by
building himself a palace, which consists of a vast rectangular
enceinte, with a door embellished with rough ornaments in clay. In
the first vestibule, or bolo, are the guards, or dalasiguis, armed with
muskets. This porch gives access to a series of courts and other
bolos, where of an evening bellow the cattle and bleat the sheep
belonging to the chief. A last door, guarded or rather watched over
by some fifteen children, gives access to the favourite apartment of
the Fama. Why should children be employed? Because they are the
only people who can be depended on to tell the truth, and if they
notice anything unusual they are very sure, sooner or later, to tell
what they have seen. For the same reason, perhaps, and also on
æsthetic grounds, the Fama is waited on by women only, most of
whom are the daughters of blacksmiths or griots, specially attached
to the chief, their name, Korosiguis, meaning, “those who sit beside.”
Moreover, Mademba showed great acumen in his choice of servants,
and I never saw so many pretty girls anywhere else in the Sudan.
Behind the royal apartments, and completely surrounding the vast
enclosure, are the huts of Mademba’s wives; but there begins the
private life of the chief, and I can’t introduce you to that, for the
simple reason that I have never seen anything of it myself.
Surrounded by his male and female griots, wearing a grand green
burnous, on which gleamed the Cross of the Legion of Honour, the
reward of his courage in the service of France, Mademba came to
the banks of the river to welcome us. Shouts and acclamations of
delight and sympathy with us greeted us as we landed, and if we had
not known what all the fuss meant, we might have mistaken it for a
declaration of war.
We went home with the Fama, and there, taking off his burnous,
the black chief disappeared, to be replaced by our old friend
Mademba, cultivated, refined, a charming talker, quite up-to-date in
all that was going on in Europe, the man whom all Frenchmen who
have been in the Sudan know and appreciate. He did the honours of
an excellent, almost European meal, and we drank a glass of
champagne together, in spite of his being a good Mussulman, for he
has none of the stupid fanaticism of his fellow believers.
Just before we started I had made the following little speech to my
coolies: “My friends, I know I am asking what will cost you a good
deal of self-denial, but you must oblige me by not being too attentive
to the women you meet until we have reached Timbuktu. You know
that that sort of thing leads to disputes, sometimes even to regular
quarrels, with the natives, and we shall have quite enough hostility to
contend with without creating any ill-feeling ourselves. I warn you,
moreover, that I shall give you no more pay after we leave
Sansanding till we reach our goal. I will, however, give you two
months’ pay in advance at Sansanding, and you will have three days
to spend it in. For a year therefore, and perhaps more, after you
leave Sansanding, remember, you have done with women.”
Truth to tell, I had learnt from experience that the ardent
temperaments of negroes forming the escorts of expeditions really
often jeopardized success, if their amours did not actually bring
about failure. Of course I can’t be sure that my orders, which I
repeated later, were always strictly obeyed, but at all events I did a
good deal to lessen the evil.
YAKARÉ.

I gave my jolly fellows three days to enjoy themselves in, and they
took me at my word. Until half-past one on the 22nd I saw next to
nothing of them on board, and when the time for starting arrived I
had to send to hunt up our little Abdulaye Dem, who had quite
forgotten how the time went in the society of a coal black Circe.
Meanwhile, we Europeans amused ourselves far more usefully in
arranging for our further journey, and in trying the effect on the
natives of our most attractive possessions, viz. the little organ, the
bicycle, and the phonograph.
The organ had already done wonders, and as for our Suzanne, as
we called our bicycle, she caused a perfect delirium of joy.
Mademba had an ancient-looking negress of Amadu, named
Yakaré, in his suite. She was really only about forty years old, but
she was considered one of the cleverest women in all Bambara.
There was a certain ring about her songs of war and love which
would be appreciated even in Europe, and the following specimen, in
which she glorifies Donga or the vulture, Monson, the greatest fama
of Bambara, will serve to give an idea of the rhythm.

Braves! Heroes, who of you dares rail at Donga?


I tell you evil will come upon you if you mock at him.
Raillery of him was fatal to Diakuruna Tutun.
Samaniana Baci thought to play with Donga,
He fancied he could make merry with him;
But that did not please the vulture,
And he took Bamana Dankun
And cut off his head, yes, took his head from his shoulders.
Dankun had only said that the Bambaras
Could not pause in sacrifices already begun.[4]
I sing of Donga Jaribata,[5]
The vulture of four wings,
A mighty bird, whose talons
Can tear up the soil of the earth;
A bird who if he will
Can dig a well with his claws.

You can just imagine the sensation when, after the negress had
finished her chant, the phonograph repeated it without anybody’s
help.
LARGE NIGER CANOES.

But all good things must come to an end, and to the great regret
of my coolies, I gave the signal for departure on the 22nd.
Below Sansanding the Niger increases sensibly in depth. This fact
explains alike the former and the future importance of the village as
a commercial centre. The trade of the country is, in fact, conveyed
up and down by water in big canoes some 60 feet long, capable of
carrying twenty tons, and made of planks tied together. Holes are
pierced in these planks, through which ropes are passed made of
the fibres, which are very strong, of the leaves of a kind of hibiscus.
When Sansanding, Jenné, and Timbuktu were prosperous places,
when the savage hordes of Toucouleurs had not yet spread death
and desolation everywhere in the name of Islam, these heavy craft,
sometimes drawing more than six feet, used to halt at Sansanding.
For the traffic further up stream smaller boats were used, which plied
to and fro nearly all the year round. A central mart was absolutely
indispensable to the Sudan merchants, and Sansanding was fitted
by nature to become that mart. I believe that in its most prosperous
times it numbered from thirty to forty thousand inhabitants, though
now these are reduced to some three or four thousand, in spite of
the fresh impulse given by the more prosperous times of to-day, and
the intelligence of the governor Mademba.
When the railway has been pushed from Kayes to Kolikoro, and
when steamboats ply on the Niger, similar causes will of course
produce similar results. Steamboats will not, however, be able to go
beyond Sansanding all the year round, for no amount of
improvement in their build can reduce their draught below one and a
half or two feet. Above this point, however, the river is navigable for a
longer or shorter time every year in such barges as are now in use.
At the most, the traffic is only interrupted for about four months in the
year. Sansanding will again become a central emporium and
transhipping station; all its old importance will be restored to it.
I may add, that it has fortunately many other advantages,
including good anchorage and landing places, where boats can be
moored in shelter during the violent storms of Central Africa; the soil
too is very dry, so that the place is healthier than many others in the
Sudan, and the people are gentle, intelligent, and industrious.
Beyond Sansanding the course of the Niger changes
considerably. Thus far the river flows between pretty straight uniform
banks, but now the hills are lower, and behind them the country is
perfectly flat, without so much as an undulation, so that they are
completely flooded, often for an immense distance, when the water
is high. Here and there villages rise from slight eminences, the
clumps of hibiscus surrounding them rendering them visible from
afar. Now too appears the sweet grass which the natives call burgu,
a special characteristic of the riverside vegetation as far as Say. It is
a kind of aquatic couch-grass nearly level with the soil when on the
subsiding of the floods the ground becomes dry again. Directly the
soil is once more inundated, however, the burgu sends out shoots
with extraordinary rapidity, and they grow so fast that they soon
reach the top of the water. The natives make a sweet beverage of
the leaves of this grass, of too sickly a taste to be fancied by
Europeans, but negroes are very fond of it. For our hydrographical
surveys the burgu was a most invaluable help, growing as it does, as
I have already remarked, wherever the solid ground reappears after
the floods. If, therefore, we should be overtaken by a tornado on the
open river, we can always take refuge from the waves by anchoring
in the middle of the submerged tracts.
On January 1 we reached Gurao on Lake Debo, where I had
recently resided for two years in charge of the Niger flotilla,
consisting of the two gunboats Niger and Mage, and a few barges
made of the wood of the country. Two of these barges, it will be
remembered, were now part of our exploring expedition.
We paid a visit between whiles to the tomb of Sidi Hamet Beckay,
in the village of Saredina. I shall often have occasion later to refer to
this worthy, so I will content myself with adding but a few words
about him here. It was thanks to him that Barth was able to stop six
months at Timbuktu, pursue his voyage in safety, and go down the
river by Say to Sokoto, whence he had started eighteen months
before. Thanks to him too, Barth was able to send details to Europe
of the hitherto mysterious city of Timbuktu, which had previously
been visited by no white men except René Caillé.
When El Hadj Omar and his fanatical hordes came to devastate
Massina, Hamet Beckay did his utmost to stop the course of the
Toucouleur conqueror, by urging on him his own interpretation of the
Mussulman religion, which he also professed: an interpretation too
noble and elevated to be adopted by any but a few votaries. It was
all in vain; his remonstrances were unheeded by El Hadj. Beckay
had to be content with organizing a stout resistance; he summoned
to arms his faithful friends the Tuaregs and the Fulahs, his former
adversaries. But, alas! he died at Saredina before he could
accomplish anything. The story goes, that when in perfect health he
was seized with a gloomy presentiment of his approaching end. He
called his intimate friends together, telling them that he might
perhaps soon be summoned to make a distant journey, and giving to
them his turban and his sword, the former for his son Abiddin, the
latter for his son-in-law, Beckay Uld Ama Lamine, which signified that
he bequeathed his spiritual power to Abiddin and his temporal
authority to Ama Lamine. Then he begged to be left alone to pray
during the hour of the siesta. When his followers returned they found
the great marabout, his chaplet, clasped in his hands, and his eyes
closed in an attitude of ecstasy. After watching him for a short time
they became alarmed at his immobility, they touched him to try and
awake him. But his lifeless body fell to the ground, the spirit of
Hamet Beckay had left its earthly tabernacle. Beckay Uld Ama
Lamine continued the struggle begun by his father-in-law, and to him
and his faithful adherents is due the honour of having besieged and
killed El Hadj Omar at Hamdallahi. The blood-stained course of the
Toucouleurs was checked for the moment, and the Western Sudan
was saved from falling into the hands of the ferocious warriors of El
Hadj.
Saredina is about two and a half miles from the river, and to reach
it we had to cross a partially inundated plain over-grown with grass,
in which nested quantities of aquatic birds. Arrived at the village we
asked to be directed to the tomb, and found it to consist of little more
than a small earthen case upheld by wooden poles, for the mass of
dried bricks which had originally formed the monument to Hamet
Beckay had all but disappeared. The natives of the neighbourhood
had shown little respect for the great chief’s resting-place, and had
used the materials of his tomb to weight their nets and make their
agricultural implements. In my report to the governor of the French
Sudan I put in a plea for a grave more worthy of Hamet Beckay. I
hope my suggestion will be attended to, for it would be not only
fitting, but good policy to preserve the memory of a man whose
character was the more estimable in that such tolerance as his is
rare indeed amongst his fellow believers. Such an act of pious
respect for a Mussulman on our part would greatly increase our
moral influence amongst the Mahommedans of the neighbourhood,
especially amongst those of the interesting Kunta tribe to which
Hamet Beckay belonged.
THE TOMB OF HAMET BECKAY AT SAREDINA.

SARAFÉRÉ.
At Gurao we had to collect the ammunition for our guns and
cannons, and also to pick up some of our actual weapons, notably a
certain machine gun which had belonged to the Niger flotilla. The
work involved in all this delayed us till the 3rd, but on the afternoon
of that day we resumed our journey.
On the 7th we reached Saraféré, an important market-place near
the junction of the Niger and the Kolikolo, which latter is an arm of
the river, branching off from it a little above Lake Debo. Here old
Abdul Dori, the guide we had engaged at Sego, brought us a young
man named Habilulaye, who was a Kunta, and I seize the
opportunity of his visit to say something about the tribe to which he
belonged, as I shall often have to refer to it.
The Kuntas are of the Arab race, and are descended from the
famous conqueror of North Africa, Sidi Okha, who was a native of
Yemen. After winning over to the religion of Mahomet a considerable
portion of North Africa, his dominion extending nearly to Tangiers,
the victor was assassinated near Biskra, where his tomb is still to be
seen.
His descendants spread in many directions, and the Kuntas took
root at Tuat, where as venerated marabouts they exercised, indeed
they still exercise, a very great influence.
During the first half of the present century, Timbuktu occupied a
very difficult and most precarious position. About 1800 a Fulah
marabout, named Othman dan Fodio, carved out for himself a
regular empire between Lake Tchad and the Niger, and his example
led to the revolt, and the generally successful revolt, of nearly all the
Fulahs distributed throughout the river basin. At Massina, Amadu
Lobbo Cissé, a chief—of Soninké birth, it is true, but who had long
resided amongst the Fulahs—raised the standard of revolt in the
name of Islam, and his attempt, after various vicissitudes,
succeeded. He and his son founded later an empire, the influence of
which, with Hamda-Allahi as its capital, soon extended on both
banks of the Niger as far as Timbuktu. Arrived there, however, the
Fulahs found themselves face to face with the Tuareg tribes, who
were very jealous of the maintenance of their independence. War of
course soon broke out, and it lasted for half-a-century without any
subjugation of the Tuaregs. It was not until later that the invasion of
the Toucouleurs, led by El Hadj Omar, united the combatants against
their common foe.
During this time of struggle and trouble Timbuktu, standing as it
did between the two contending parties, passed first to one and then
to the other, and pillaged by both sides, she rapidly declined in
prosperity, and was in danger of complete ruin.
Under these trying circumstances, the merchants of the city,
eager to obtain some sort of security for their lives, their goods, and
their trade, sent to Tuat an earnest petition that some venerated
Kunta marabout should come and live near Timbuktu, hoping that
the respect felt for his piety might put a stop to the depredations of
which their town was the victim.
Sidi Moktar responded to this appeal. He came, and took up his
abode with his family and a few of his more distant relations near
Timbuktu. Of these relations the most celebrated were his brothers
Sidi Aluatta and Sidi Hamet Beckay with his nephew Amadi.
Barth has told us much about them all, but we have now specially
to deal with Hamet Beckay, the doctor’s chief protector.
Imbued through reading Barth’s travels with a belief that the very
fate of my expedition might depend on finding, as he did, some man
universally loved and respected to take me and my followers under
his protection, I earnestly hoped to find such a man amongst the
Tuaregs, with whom I had become well acquainted during my two
years’ residence in the Sudan.
As will be borne out by my further narrative, these Tuaregs
seemed to me far less black than they were painted in Europe. At
the same time, I recognized that certain peculiarities of their
character might involve me in great difficulties. If they were not
exactly instinctively ferocious, I knew that they were quick to take
offence, defiant, full of dread of innovation, and ready to look on
every stranger as a spy. To them a traveller is but the harbinger of
some warlike expedition, which will wrest from them their greatest
treasure, their independence.
But I had to get some one to go bail for me, some one to take me
under his patronage and protection, and I had resolved, if it could
possibly be done, to find that some one amongst the Kuntas. Surely,
I thought, the traditions of tolerance of which Hamet Beckay had
given such striking proof, must have been handed down to some of
his descendants.
I did not, however, disguise from myself that in the very nature of
things, since other marabouts had, since Beckay’s death, come to
preach a holy war, and to inculcate hatred of the infidel, that the
Kuntas would necessarily be forced—if they did not wish to lose their
prestige—to howl with the rest of the wolves. But I reflected there is
still time to appeal to the example of their grandfather, and
experience proved that I was right.
I put out all my eloquence and powers of persuasion to win over
young Habibulaye, and I succeeded. From him I learned that the
Kuntas were now divided into several groups. He and his brother
Hamadi, the sons of Sidi Aluatti, the brother of Hamet Beckay, had,
however, remained at Timbuktu when the French occupied that town,
and had all espoused our cause.
Aluatti, the son of Amadi, was in authority on the southern side of
the river, and he looked on our expedition with a favourable eye.
Further on, Baye and Baba Hamet, the sons of Hamet Beckay,
would, I expected, be useful auxiliaries to us if only for the sake of
their father’s memory.
Habibulaye did not, it is true, conceal from me the fact that other
Kuntas were bitterly hostile to us, notably a certain Abiddin, who
generally resided at Tuat, and who meant to rouse the Hoggars
against us. He had, in fact, twice gone quite close to Timbuktu to try
and make the people rise against the French.
More confirmed than ever by all that I heard in my resolve, and
having now got all the information I could out of Habibulaye, who
was but a child, I made up my mind, as soon as I got to Timbuktu to
take Hamadi into my confidence, and get him to give me
recommendations to his relations.
A strong east wind, which lashed the river into waves and was
dead against us, delayed us so much that we did not reach Kabara
until the evening of January 11.
As is well known, Timbuktu is not actually on the river, but at low
water is some eight or nine miles off. Djitafe is then the nearest point
of approach for canoes, but when the river rises they go up a lateral
arm, and come first to Koriomé and then to Day. At certain times a
stream, the bed of which is said to have been hollowed out, or at
least deepened by the hand of man, enables very small craft to get
up to Kabara, whilst more rarely, that is to say, when the inundations
are at their height, the various excavations behind the Kabara dune
are successively filled up, and boats can reach the capital itself. As a
general rule, however, merchandise is taken into Timbuktu on the
backs of camels and asses, the route varying according to the state
of the river.
The ancient capital of Nigritia, or the Sudan, as it was still called
not long ago in geographical text-books, has lost all its mystery since
it passed into the hands of the French, and opinions are divided as
to its present and future position. My friend Felix Dubois has
described it, and it would be alike a waste of time and presumption
on my part to attempt to supplement what he has said so well. I shall
content myself with noting the reason of the former great commercial
importance of Timbuktu; relatively considered of course. “Timbuktu,”
says an Arab author, “is the point of meeting of the camel and the
canoe.” That fact alone would not, however, be enough to account
for its prosperity; many other places on the river fulfil this condition,
as well if not better than Timbuktu, for, as we can ourselves testify,
the canoe and the camel only meet there a few days in the year, and
not always even as often as that.
In my opinion we have to seek the explanation elsewhere, and I
think I have found it. Here it is: camels cannot with impunity
approach rivers or other water-courses, for this reason. The banks
are subject to constant inundations, and, especially in the Niger
basin, quantities of succulent grass, containing a great deal of water,
everywhere spring up, which, though the camel eats them
gluttonously, are fatal to the “ship of the desert,” used as it is to dry
food.
Now by a strange freak of nature, the part of the desert, I will not
say exactly the driest part, but certainly the portion containing neither
streams nor permanent pools, that vast expanse improperly called
the Sahara, stretches up to the very gates of Timbuktu, so that
caravans can reach the city without any risk to the animals. In a
word, may we not say that Timbuktu is not a port of the Niger in the
Sahara, but a port of the Sahara near the Niger?
As long as the trade of Timbuktu is carried on chiefly by caravans
coming from the north, it will, in my opinion, retain its importance, but
as soon as the Sudan railway is completed, merchandise will come
by way of it and the river, and the commerce of Timbuktu will be
reduced to a trifling trade in salt, which is dug out in considerable
quantities from the mines of Towdeyni, about twenty days’ march on
the north.
When we arrived, we could only bring our boats up to Kabera.
The port was blocked with big canoes made of planks tied together
in the manner already described, and a brisk trade in salt and grain
was going on on the quays.
A MOSQUE AT TIMBUKTU.

The next day I went to Timbuktu, and was received with open
arms by the commandant, M. Rejou, who was in charge of the whole
district.
I had one thing very much at heart, and I set to work to see about
it at once. It was to persuade Father Hacquart, superior of Pères
blancs mission at Timbuktu, to accompany us on our expedition.
When I said persuade, I did not perhaps use quite the right word,
for I did not for one moment doubt the readiness of the good father
to go with us. The companion of Attanoux in his journey amongst the
Tuaregs of the north, formerly Commandant des Frères armés of
Mgr. Lavigerie, Father Hacquart could not fail to be won over by the
idea of accomplishing a similar journey. But I knew him to be too
devoted to his duty to hesitate an instant between a project, however
attractive to his tastes and desires, and the interests of the mission,
which had been under his direction at Timbuktu for more than a year,
and to which his rare qualities had already given such life and
success.
On the other hand, even from the point of view of the work to
which Father Hacquart and his companions had devoted
themselves, going down the Niger, opening relations with the natives
on its banks, and obtaining all the information necessary for the work
of their future evangelization, was really perhaps to bring about the
good results hoped for years before they could otherwise have been
achieved. The aim of Father Hacquart was really the same as ours,
to see, to study on the spot, and to make friends, leaving to his
superiors the task of deciding how his future campaign should be
carried out.
As for me, nothing could be better for the success of my
undertaking than the co-operation of Father Hacquart. Already
familiar with the manners and customs of the Tuaregs, he would be a
most valuable adviser; a distinguished Arabic scholar, he could in
many cases converse without an interpreter with the natives, a
matter of the greatest importance. He could, moreover, check the
translations and reports of my Arab interpreter, Tierno Abdulaye
Dem. Then his intelligence, the loftiness of his aims and views, the
uprightness and energy of his character, were a sure guarantee that
in him I should find a most valuable controller of my own acts and
schemes, for of course I should ever be ready to listen to what he
might suggest.
FATHER HACQUART.

Father Hacquart turned out indeed to be all that I have just


described. I often changed all my plans in accordance with his
advice, and I never had cause to regret having done so. He must
pardon me for giving expression here to all my gratitude, and for
proclaiming it on every occasion as loud as I can, for it was in a very
great measure to him I owed the remarkable fact, that my Niger
expedition was accomplished in the midst of tribes so diverse and
sometimes badly disposed towards the French—without the firing of
a single shot.
As I hoped, Father Hacquart yielded to my persuasions, and we
now numbered five Europeans.
On the other hand, our native escort was reduced. One of our
coolies, Matar Samba, had been out of sorts ever since we left
Sansanding. During the last few days he had become worse, and
both Dr. Taburet and a medical man at Timbuktu were of opinion that
he was suffering from tubercular disease, and would only hamper,
not help me, in the further journey. I decided therefore to leave him
at Timbuktu, and when I came back from Dakar on our return I had
the pleasure of finding him much better, if not completely cured.
Aided by Father Hacquart, I at once opened relations with
Hamadi, the Kunta of whom I have already spoken, and he promised
to do all he could to persuade his relation Aluatta to go with us. It
was significant that when I begged Hamadi to join us himself, he
replied, “No; I might merely arouse opposition, and you might suffer
through my being with you. I would rather write to Aluatta; he will be
more likely to say yes then, for, like a dutiful relation, I shall only urge
him to come and share the windfall of all your beautiful presents.”
The next thing I did was to try and meet at Timbuktu with some
natives who were on friendly relations with the Awellimiden, the
important Tuareg tribe to which I shall so often have to refer later, but
whether they spoke the truth or were deceiving me, one and all
declared that they knew absolutely nothing about them.
To make up for this, however, a native of Tuat, a certain Bechir
Uld Mbirikat, who had long lived at Timbuktu, and whom I had met
before, gave me some letters for his cousin Mohammed, who was
living amongst the Igwadaren Tuaregs, and for Sheriff Salla Uld
Kara, chief of the village of Tosaye, who had once been the pupil of
Hamet Beckay, and the friend of Barth.
Moreover, Bechir gave me a valuable bit of advice, which I
immediately followed, without, however, fully realizing its importance
at the time. This counsel, perhaps, contributed more than anything
we did to the success of our expedition. “Tell them,” said Bechir, “that
you are the son of Abdul Kerim.” Now Abdul Kerim was the Arab
name assumed by Dr. Barth during his journey. This custom of taking
an Arab name seemed almost comic, and reminded me of a little
play I once saw acted at the Châtelet Theatre in Paris. I forget the

You might also like