Conjunctive-query containment and constraint satisfaction

Conjunctive-query containment is recognized as a fundamental problem in database query evaluation and optimization. At the same time, constraint satisfaction is recognized as a fundamental problem in artificial intelligence. What do conjunctive-query containment and constraint satisfaction have in common? Our main conceptual contribution in this paper is to point out that, despite their very different formulation, conjunctive-query containment and constraint satisfaction are essentially the same problem. The reason is that they can be recast as the following fundamental algebraic problem: given two finite relational structures A and B, is there a homomorphism h:A?B? As formulated above, the homomorphism problem is uniform in the sense that both relational structures A and B are part of the input. By fixing the structure B, one obtains the following nonuniform problem: given a finite relational structure A, is there a homomorphism h:A?B? In general, nonuniform tractability results do not uniformize. Thus, it is natural to ask: which tractable cases of nonuniform tractability results for constraint satisfaction and conjunctive-query containment do uniformize? Our main technical contribution in this paper is to show that several cases of tractable nonuniform constraint-satisfaction problems do indeed uniformize. We exhibit three nonuniform tractability results that uniformize and, thus, give rise to polynomial-time solvable cases of constraint satisfaction and conjunctive-query containment. We begin by examining the tractable cases of Boolean constraint-satisfaction problems and show that they do uniformize. This can be applied to conjunctive-query containment via Booleanization; in particular, it yields one of the known tractable cases of conjunctive-query containment. After this, we show that tractability results for constraint-satisfaction problems that can be expressed using Datalog programs with bounded number of distinct variables also uniformize. Finally, we provide a new proof for the fact that tractability results for queries with bounded treewidth uniformize as well, via a connection with first-order logic with a bounded number of distinct variables.

[1]  Robert E. Tarjan,et al.  Three Partition Refinement Algorithms , 1987, SIAM J. Comput..

[2]  J. C. C. McKinsey,et al.  The decision problem for some classes of sentences without quantifiers , 1943, Journal of Symbolic Logic.

[3]  Divesh Srivastava,et al.  Answering Queries Using Views. , 1999, PODS 1995.

[4]  Phokion G. Kolaitis,et al.  Infinitary Logics and 0-1 Laws , 1992, Inf. Comput..

[5]  Stuart C. Shapiro,et al.  Encyclopedia of artificial intelligence, vols. 1 and 2 (2nd ed.) , 1992 .

[6]  Thomas J. Schaefer,et al.  The complexity of satisfiability problems , 1978, STOC.

[7]  Christophe Lecoutre Constraint Networks , 1992 .

[8]  Marc Gyssens,et al.  A Unifying Framework for Tractable Constraints , 1995, CP.

[9]  Vipin Kumar,et al.  Algorithms for Constraint-Satisfaction Problems: A Survey , 1992, AI Mag..

[10]  Yatin P. Saraiya Subtree-elimination algorithms in deductive databases , 1991 .

[11]  Wolfgang Bibel,et al.  Constraint Satisfaction from a Deductive Viewpoint , 1988, Artif. Intell..

[12]  Yiannis N. Moschovakis,et al.  Elementary induction on abstract structures , 1974 .

[13]  Pedro Meseguer,et al.  Constraint Satisfaction Problems: An Overview , 1989, AI Commun..

[14]  Rina Dechter Decomposing a Relation into a Tree of Binary Relations , 1990, J. Comput. Syst. Sci..

[15]  Jürg Schmid,et al.  Maximal sublattices of finite distributive lattices , 1996 .

[16]  Edward P. K. Tsang,et al.  Foundations of constraint satisfaction , 1993, Computation in cognitive science.

[17]  Tomás Feder,et al.  The Computational Structure of Monotone Monadic SNP and Constraint Satisfaction: A Study through Datalog and Group Theory , 1999, SIAM J. Comput..

[18]  Peter Jeavons,et al.  A Survey of Tractable Constraint Satisfaction Problems , 1997 .

[19]  Georg Gottlob,et al.  The complexity of acyclic conjunctive queries , 1998, Proceedings 39th Annual Symposium on Foundations of Computer Science (Cat. No.98CB36280).

[20]  Peter van Beek,et al.  On the Conversion between Non-Binary and Binary Constraint Satisfaction Problems , 1998, AAAI/IAAI.

[21]  David Harel,et al.  Horn Clauses Queries and Generalizations , 1985, J. Log. Program..

[22]  Phokion G. Kolaitis,et al.  On the expressive power of datalog: tools and a case study , 1990, J. Comput. Syst. Sci..

[23]  Eugene C. Freuder,et al.  The Complexity of Constraint Satisfaction Revisited , 1993, Artif. Intell..

[24]  David S. Johnson,et al.  Computers and Intractability: A Guide to the Theory of NP-Completeness , 1978 .

[25]  Phokion G. Kolaitis,et al.  On the expressive power of variable-confined logics , 1996, Proceedings 11th Annual IEEE Symposium on Logic in Computer Science.

[26]  Serge Abiteboul,et al.  Foundations of Databases , 1994 .

[27]  Peter Jeavons,et al.  An Algebraic Characterization of Tractable Constraints , 1995, COCOON.

[28]  Xiaolei Qian,et al.  Query folding , 1996, Proceedings of the Twelfth International Conference on Data Engineering.

[29]  Moshe Y. Vardi On the complexity of bounded-variable queries (extended abstract) , 1995, PODS '95.

[30]  Georg Gottlob,et al.  Hypertree decompositions and tractable queries , 1998, J. Comput. Syst. Sci..

[31]  Peter Jeavons,et al.  On the Algebraic Structure of Combinatorial Problems , 1998, Theor. Comput. Sci..

[32]  Anand Rajaraman,et al.  Answering queries using templates with binding patterns (extended abstract) , 1995, PODS.

[33]  Jan van Leeuwen,et al.  Handbook of Theoretical Computer Science, Vol. A: Algorithms and Complexity , 1994 .

[34]  Hans L. Bodlaender A linear time algorithm for finding tree-decompositions of small treewidth , 1993, STOC '93.

[35]  B. Courcelle,et al.  Linear Time Solvable Optimization Problems on Certain Structured Graph Families , 1997 .

[36]  Moshe Y. Vardi On the Complexity of Bounded-Variable Queries. , 1995, PODS 1995.

[37]  Anand Rajaraman,et al.  Conjunctive query containment revisited , 1997, Theor. Comput. Sci..

[38]  Jaroslav Nesetril,et al.  On the complexity of H-coloring , 1990, J. Comb. Theory, Ser. B.

[39]  Jeffrey D. Ullman,et al.  Information integration using logical views , 1997, Theor. Comput. Sci..

[40]  Marc Gyssens,et al.  Decomposing Constraint Satisfaction Problems Using Database Techniques , 1994, Artif. Intell..

[41]  Jan van Leeuwen,et al.  Graph Algorithms , 1991, Handbook of Theoretical Computer Science, Volume A: Algorithms and Complexity.

[42]  Rina Dechter,et al.  Structure Identification in Relational Data , 1992, Artif. Intell..

[43]  Jeffrey D. Ullman,et al.  Principles of database and knowledge-base systems, Vol. I , 1988 .

[44]  Rina Dechter,et al.  Tree Clustering for Constraint Networks , 1989, Artif. Intell..

[45]  Jean H. Gallier,et al.  Linear-Time Algorithms for Testing the Satisfiability of Propositional Horn Formulae , 1984, J. Log. Program..

[46]  Tomás Feder,et al.  Monotone monadic SNP and constraint satisfaction , 1993, STOC.

[47]  A BernsteinPhilip,et al.  Computational problems related to the design of normal form relational schemas , 1979 .

[48]  Dan Suciu,et al.  Adding Structure to Unstructured Data , 1997, ICDT.

[49]  Bruno Courcelle,et al.  Upper bounds to the clique width of graphs , 2000, Discret. Appl. Math..

[50]  Marc Gyssens,et al.  A test for Tractability , 1996, CP.

[51]  Mihalis Yannakakis,et al.  Node-Deletion Problems on Bipartite Graphs , 1981, SIAM J. Comput..

[52]  Divesh Srivastava,et al.  Answering Queries Using Views. , 1999, PODS 1995.

[53]  Ugo Montanari,et al.  Networks of constraints: Fundamental properties and applications to picture processing , 1974, Inf. Sci..

[54]  M E Adams,et al.  Maximal Sublattices of Nite Distributive Lattices , 1996 .

[55]  KumarVipin Algorithms for constraint-satisfaction problems , 1992 .

[56]  Anand Rajaraman,et al.  Conjunctive query containment revisited , 2000, Theor. Comput. Sci..

[57]  Christos H. Papadimitriou,et al.  Elements of the Theory of Computation , 1997, SIGA.

[58]  Ashok K. Chandra,et al.  Optimal implementation of conjunctive queries in relational data bases , 1977, STOC '77.

[59]  Eugene C. Freuder Complexity of K-Tree Structured Constraint Satisfaction Problems , 1990, AAAI.

[60]  Jeffrey D. Ullman,et al.  Answering queries using templates with binding patterns (extended abstract) , 1995, PODS '95.