Query Evaluation via Tree-Decompositions

Extended Abstract
  • Jörg Flum
  • Markus Frick
  • Martin Grohe
Conference paper
Part of the Lecture Notes in Computer Science book series (LNCS, volume 1973)


A number of efficient methods for evaluating first-order and monadic-second order queries on finite relational structures are based on tree-decompositions of structures or queries. We systematically study these methods. In the first-part of the paper we consider tree-like structures. We generalize a theorem of Courcelle [7] by showing that on such structures a monadic second-order formula (with free first-order and second-order variables) can be evaluated in time linear in the structure size plus the size of the output. In the second part we study tree-like formulas. We generalize the notions of acyclicity and bounded tree-width from conjunctive queries to arbitrary first-order formulas in a straightforward way and analyze the complexity of evaluating formulas of these fragments. Moreover, we show that the acyclic and bounded tree-width fragments have the same expressive power as the well-known guarded fragment and the finite-variable fragments of first-order logic, respectively.


Hamiltonian Cycle Atomic Formula Evaluation Problem Query Evaluation Relation Symbol 
These keywords were added by machine and not by the authors. This process is experimental and the keywords may be updated as the learning algorithm improves.


Unable to display preview. Download preview PDF.

Unable to display preview. Download preview PDF.


  1. 1.
    S. Abiteboul, R. Hull, and V. Vianu. Foundations of Databases. Addison-Wesley, 1995.Google Scholar
  2. 2.
    A.V. Aho, J.E. Hopcroft, and J.D. Ullman. The Design and Analysis of Computer Algorithms. Addison-Wesley, 1974.Google Scholar
  3. 3.
    H. Andréka, J. van Benthem, and I. Németi. Modal languages and bounded fragments of first-order logic, 1996. ILLC Research Report ML-96-03, University of Amsterdam.Google Scholar
  4. 4.
    S. Arnborg, J. Lagergren, and D. Seese. Easy problems for tree-decomposable graphs. Journal of Algorithms, 12:308–340, 1991.zbMATHCrossRefMathSciNetGoogle Scholar
  5. 5.
    H.L. Bodlaender. A linear-time algorithm for finding tree-decompositions of small treewidth. SIAM Journal on Computing, 25:1305–1317, 1996.zbMATHCrossRefMathSciNetGoogle Scholar
  6. 6.
    Ch. Chekuri and A. Rajaraman. Conjunctive query containment revisited. In Ph. Kolaitis and F. Afrati, editors, Proceedings of the 5th International Conference on Database Theory, volume 1186 of Lecture Notes in Computer Science, pages 56–70. Springer-Verlag, 1997.Google Scholar
  7. 7.
    B. Courcelle. Graph rewriting: An algebraic and logic approach. In J. van Leeuwen, editor, Handbook of Theoretical Computer Science, volume 2, pages 194–242. Elsevier Science Publishers, 1990.Google Scholar
  8. 8.
    B. Courcelle and M. Mosbah. Monadic second-order evaluations on tree-decomposable graphs. Theoretical Computer Science, 103:49–82, 1993.CrossRefMathSciNetGoogle Scholar
  9. 9.
    T. Feder and M.Y. Vardi. Monotone monadic SNP and constraint satisfaction. In Proceedings of the 25th ACM Symposium on Theory of Computing, pages 612–622, 1993.Google Scholar
  10. 10.
    J. Flum and M. Frick and M. Grohe. Query evaluation via tree-decompositions. Full version of this paper, available at
  11. 11.
    G. Gottlob, E. Grädel, and H. Veith. Datalog lite: Temporal versus deductive reasoning in verification. Technical Report DBAI-TR-98-22, Technische UniversitätWien, 1998.Google Scholar
  12. 12.
    G. Gottlob, N. Leone, and F. Scarcello. The complexity of acyclic conjunctive queries. In Proceedings of the 39th Annual IEEE Symposium on Foundations of Computer Science, pages 706–715, 1998.Google Scholar
  13. 13.
    G. Gottlob, N. Leone, and F. Scarcello. Hypertree decompositions and tractable queries. In Proceedings of the 18th ACM Symposium on Principles of Database Systems, pages 21–32, 1999.Google Scholar
  14. 14.
    G. Gottlob, N. Leone, and F. Scarcello. A Comparison of Structural CSP Decomposition Methods. In Proceedings of the Sixteenth International Joint Conference on Artificial Intelligence, pages 394–399, 1999.Google Scholar
  15. 15.
    Ph.G. Kolaitis and M.Y. Vardi. Conjunctive-query containment and constraint satisfaction. In Proceedings of the 17th ACMSymposium on Principles of Database Systems, pages 205–213, 1998.Google Scholar
  16. 16.
    J. Makowsky. Model theory in computer science:An appetizer. In S. Abramsky, D.M. Gabbay, and T.S.E. Maibaum, editors, Handbook of Logic in Computer Science, volume 1, chapter 6. Oxford University Press, 1992.Google Scholar
  17. 17.
    L.J. Stockmeyer. The Complexity of Decision Problems in Automata Theory. PhD thesis, Department of Electrical Engineering, MIT, 1974.Google Scholar
  18. 18.
    R.E. Tarjan and M. Yannakakis. Simple linear-time algorithms to test chordality of graphs, test acyclicity of hypergraphs, and selectively reduce acyclic hypergraphs. SIAM Journal on Computing, 13:566–579, 1984.zbMATHCrossRefMathSciNetGoogle Scholar
  19. 19.
    J.W. Thatcher and J.B. Wright. Generalized finite automata with an application to a decision problem of second order logic. Math. Syst. Theory, 2:57–82, 1968.CrossRefMathSciNetGoogle Scholar
  20. 20.
    C. Thomassen. Embeddings and minors. In R. Graham, M. Grötschel, and L. Lovász, editors, Handbook of Combinatorics, volume 1, chapter 5, pages 301–349. Elsevier, 1995.Google Scholar
  21. 21.
    P. van Emde Boas. Machine models and simulations. In J. van Leeuwen, editor, Handbook of Theoretical Computer Science, volume 1, pages 1–66. Elsevier Science Publishers, 1990.Google Scholar
  22. 22.
    M.Y. Vardi. The complexity of relational query languages. In Proceedings of the 14th ACM Symposium on Theory of Computing, pages 137–146, 1982.Google Scholar
  23. 23.
    M.Y. Vardi. On the complexity of bounded-variable queries. In Proceedings of the 14th ACM Symposium on Principles of Database Systems, pages 266–276, 1995.Google Scholar
  24. 24.
    M. Yannakakis. Algorithms for acyclic database schemes. In 7th International Conference on Very Large Data Bases, pages 82–94, 1981.Google Scholar

Copyright information

© Springer-Verlag Berlin Heidelberg 2001

Authors and Affiliations

  • Jörg Flum
    • 1
  • Markus Frick
    • 1
  • Martin Grohe
    • 2
  1. 1.Institut für Mathematische LogikAlbert-Ludwigs-Universität FreiburgFreiburgGermany
  2. 2.Department of Mathematics, Statistics, and Computer ScienceChicagoUSA

Personalised recommendations