Constraint Satisfaction, Databases, and Logic

Phokion G. KolaitisIJCAI 2003

Abstract

Constraint Satisfaction Problems (CSPs) are a cornerstone of artificial intelligence, yet their inherent complexity often poses significant challenges. In this synthesis of his IJCAI 2003 presentation, Phokion G. Kolaitis explores the deep mathematical connections between CSPs, database theory, and logic. By establishing a "Rosetta Stone" that identifies CSPs with the Homomorphism Problem and Conjunctive Query evaluation, the paper provides a unified framework for identifying "islands of tractability"—specific conditions under which these typically NP-complete problems can be solved in polynomial time.

Introduction

Constraint Satisfaction Problems (CSPs) are ubiquitous in AI, appearing in applications ranging from scheduling and planning to computer vision and natural language processing. Despite their prevalence, CSPs are generally NP-complete, making them computationally intractable for large-scale instances. For decades, researchers identified various "islands of tractability"—specialized classes of CSPs solvable in polynomial time—but these discoveries often appeared as isolated algorithmic tricks.

The central goal of this work is to provide a unified theoretical framework that explains why certain CSPs are easy while others are hard. By viewing CSPs through the lenses of database query evaluation and finite model theory, we can uncover structural reasons for tractability that transcend specific application domains.

The Triple Identity: CSP, Homomorphism, and Databases

One of the most profound insights presented is the mathematical equivalence of three seemingly distinct problems:

  1. Constraint Satisfaction: Finding an assignment of values to variables that satisfies all constraints.
  2. The Homomorphism Problem: Determining if there exists a homomorphism between two relational structures, $A$ (representing variables and constraint scopes) and $B$ (representing the domain and allowed relations).
  3. Conjunctive Query Evaluation: Determining if a conjunctive query (a basic SQL query) has a non-empty result on a database.

This "Triple Identity" means that any breakthrough in database query optimization or the theory of relational homomorphisms is immediately applicable to AI constraint solving.

Characterizing Tractability through Logic and Games

To distinguish between hard and easy CSPs, the paper employs tools from logic and combinatorial game theory.

Datalog and Logical Expressibility

Datalog, a recursive database query language, serves as a powerful tool for characterizing tractability. The paper demonstrates that if the complement of a CSP can be expressed in Datalog, the CSP itself is solvable in polynomial time. This provides a logical benchmark for tractability.

Existential $k$-Pebble Games

To bridge the gap between abstract logic and concrete algorithms, the author introduces existential $k$-pebble games. These games visualize "constraint propagation" (such as arc consistency) as a strategic interaction between two players: "Spoiler" and "Duplicator." A winning strategy for the Duplicator in a $k$-pebble game corresponds to the CSP having "bounded width," meaning it can be solved by local consistency algorithms.

The Complexity Landscape and the Dichotomy Conjecture

A major focus of the paper is the classification of CSP complexity. For general NP problems, Ladner's Theorem states that if $P \neq NP$, there exist problems of "intermediate" complexity (NP-intermediate) that are neither in P nor NP-complete.

However, the Feder-Vardi Dichotomy Conjecture suggests that CSPs are special. It posits that for any fixed template $B$, the problem $CSP(B)$ is either in P or is NP-complete, with no intermediate cases. This suggests a collapse of the complexity hierarchy for this specific class of problems.

The complexity landscape for CSP(B) illustrates the Dichotomy Conjecture, suggesting that the NP-intermediate region (NP-P) is bypassed for these problems.

Structural vs. Valuational Tractability

Tractability in CSPs typically arises from two sources:

  • Valuational Tractability: Restrictions on the values or relations allowed. For example, Schaefer’s Dichotomy Theorem shows that for Boolean domains (0/1), there are exactly six types of relations that lead to tractability; anything else is NP-complete.
  • Structural Tractability: Restrictions on the structure of the constraints. A landmark result cited is Grohe’s Theorem, which identifies treewidth as the fundamental limit of structural tractability. For a class of structures $A$, the problem $CSP(A, \text{All})$ is in P if and only if the structures in $A$ are homomorphically equivalent to structures with bounded treewidth.

Conclusion

The synthesis of CSPs, databases, and logic provides a robust framework for understanding computational complexity. While the Feder-Vardi conjecture was a major open question at the time of this paper (eventually proven in 2017), the tools introduced—Datalog, pebble games, and treewidth—remain central to the field. This unified perspective not only clarifies the nature of tractability but also fosters cross-pollination between AI and database research.

Summary updated

BibTeX
@inproceedings{kolaitis2003constraint,
  author = {Phokion G. Kolaitis},
  title = {{Constraint Satisfaction, Databases, and Logic}},
  booktitle = {International Joint Conference on Artificial Intelligence},
  year = {2003},
}
Figure