skip to main content
10.1145/2463664.2467795acmconferencesArticle/Chapter ViewAbstractPublication PagesmodConference Proceedingsconference-collections
research-article

A trichotomy for regular simple path queries on graphs

Published:22 June 2013Publication History

ABSTRACT

Regular path queries (RPQs) select vertices connected by some path in a graph. The edge labels of such a path have to form a word that matches a given regular expression. We investigate the evaluation of RPQs with an additional constraint that prevents multiple traversals of the same vertices. Those regular simple path queries (RSPQs) quickly become intractable, even for basic languages such as (aa)* or a*ba*.

In this paper, we establish a comprehensive classification of regular languages with respect to the complexity of the corresponding regular simple path query problem. More precisely, we identify for which languages RSPQs can be evaluated in polynomial time, and show that evaluation is NP-complete for languages outside this fragment. We thus fully characterize the frontier between tractability and intractability for RSPQs, and we refine our results to show the following trichotomy: evaluation of RSPQs is either AC0 , NL-complete or NP-complete in data complexity, depending on the language L. The fragment identified also admits a simple characterization in terms of regular expressions.

Finally, we also discuss the complexity of deciding whether a language L belongs to the fragment above. We consider several alternative representations of L: DFAs, NFAs or regular expressions, and prove that this problem is NL-complete for the first representation and PSPACE-complete for the other two. As a conclusion we extend our results from edge-labeled graphs to vertex-labeled graphs.

References

  1. S. Abiteboul and V. Vianu. Regular path queries with constraints. J. Comput. Syst. Sci., 58(3):428--452, 1999. Google ScholarGoogle ScholarDigital LibraryDigital Library
  2. N. Alon, R. Yuster, and U. Zwick. Color-Coding. J. ACM, 42(4):844--856, 1995. Google ScholarGoogle ScholarDigital LibraryDigital Library
  3. M. Arenas, S. Conca, and J. Pérez. Counting beyond a yottabyte, or how sparql 1.1 property paths will prevent adoption of the standard. In WWW, pages 629--638, 2012. Google ScholarGoogle ScholarDigital LibraryDigital Library
  4. E. M. Arkin, C. H. Papadimitriou, and M. Yannakakis. Modularity of Cycles and Paths in Graphs. J. ACM, 38(2):255--274, 1991. Google ScholarGoogle ScholarDigital LibraryDigital Library
  5. G. Bagan, A. Bonifati, and B. Groz. A trichotomy for regular simple path queries on graphs. CoRR, abs/1212.6857, 2012.Google ScholarGoogle Scholar
  6. P. Barceló, L. Libkin, and J. L. Reutter. Querying graph patterns. In PODS, pages 199--210. ACM, 2011. Google ScholarGoogle ScholarDigital LibraryDigital Library
  7. C. L. Barrett, R. Jacob, and M. V. Marathe. Formal-language-constrained path problems. SIAM Journal on Computing, 30(3):809--837, 2000. Google ScholarGoogle ScholarDigital LibraryDigital Library
  8. D. Berwanger, A. Dawar, P. Hunter, S. Kreutzer, and J. Obdrzálek. The dag-width of directed graphs. J. Comb. Theory, Ser. B, 102(4):900--923, 2012. Google ScholarGoogle ScholarDigital LibraryDigital Library
  9. D. Calvanese, G. D. Giacomo, M. Lenzerini, and M. Y. Vardi. Answering regular path queries using views. In ICDE, pages 389--398, 2000. Google ScholarGoogle ScholarDigital LibraryDigital Library
  10. D. Calvanese, G. D. Giacomo, M. Lenzerini, and M. Y. Vardi. Rewriting of regular expressions and regular path queries. J. Comput. Syst. Sci., 64(3):443--465, 2002.Google ScholarGoogle ScholarDigital LibraryDigital Library
  11. D. Calvanese, G. D. Giacomo, M. Lenzerini, and M. Y. Vardi. Reasoning on regular path queries. SIGMOD Record, 32(4):83--92, 2003. Google ScholarGoogle ScholarDigital LibraryDigital Library
  12. D. Calvanese, G. D. Giacomo, M. Lenzerini, and M. Y. Vardi. An automata-theoretic approach to regular xpath. In DBPL, pages 18--35, 2009. Google ScholarGoogle ScholarDigital LibraryDigital Library
  13. B. Courcelle. Graph rewriting: An algebraic and logic approach. In Handbook of Theoretical Computer Science, Volume B: Formal Models and Sematics (B), pages 193--242. 1990. Google ScholarGoogle ScholarDigital LibraryDigital Library
  14. I. F. Cruz, A. O. Mendelzon, and P. T. Wood. A graphical query language supporting recursion. In SIGMOD Conference, pages 323--330, 1987. Google ScholarGoogle ScholarDigital LibraryDigital Library
  15. W. Fan, J. Li, S. Ma, N. Tang, and Y. Wu. Adding regular expressions to graph reachability and pattern queries. In ICDE, pages 39--50. IEEE Computer Society, 2011. Google ScholarGoogle ScholarDigital LibraryDigital Library
  16. J. Flum and M. Grohe. Parameterized Complexity Theory (Texts in Theoretical Computer Science. An EATCS Series). 2006. Google ScholarGoogle ScholarDigital LibraryDigital Library
  17. M. R. Garey and D. S. Johnson. Computers and Intractability: A Guide to the Theory of NP-Completeness. W. H. Freeman, 1979. Google ScholarGoogle ScholarDigital LibraryDigital Library
  18. C. Gutierrez, C. A. Hurtado, A. O. Mendelzon, and J. Pérez. Foundations of semantic web databases. J. Comput. Syst. Sci., 77(3):520--541, 2011. Google ScholarGoogle ScholarDigital LibraryDigital Library
  19. R. H. Gäting. GraphDB: A Data Model and Query Language for Graphs in Databases. In Proc. 20th Int. Conf. on Very Large Data Bases, pages 297--308, 1994. Google ScholarGoogle ScholarDigital LibraryDigital Library
  20. P. Hunter and S. Kreutzer. Digraph measures: Kelly decompositions, games, and orderings. Theor. Comput. Sci., 399(3):206--219, 2008. Google ScholarGoogle ScholarDigital LibraryDigital Library
  21. N. Immerman. Nondeterministic space is closed under complementation. SIAM J. Comput., 17(5):935--938, 1988. Google ScholarGoogle ScholarDigital LibraryDigital Library
  22. N. Immerman. Descriptive complexity. Springer, 1999.Google ScholarGoogle ScholarCross RefCross Ref
  23. R. Jin, H. Hong, H. Wang, N. Ruan, and Y. Xiang. Computing label-constraint reachability in graph databases. In SIGMOD Conference, pages 123--134, 2010. Google ScholarGoogle ScholarDigital LibraryDigital Library
  24. T. Johnson, N. Robertson, P. D. Seymour, and R. Thomas. Directed tree-width. J. Comb. Theory, Ser. B, 82(1):138--154, 2001. Google ScholarGoogle ScholarDigital LibraryDigital Library
  25. A. Koschmieder and U. Leser. Regular path queries on large graphs. In SSDBM, pages 177--194, 2012. Google ScholarGoogle ScholarDigital LibraryDigital Library
  26. A. S. Lapaugh and C. H. Papadimitriou. The even-path problem for graphs and digraphs. Networks}, 14(4):507--513, 1984.Google ScholarGoogle Scholar
  27. U. Leser. A query language for biological networks. In ECCB/JBI, page 39, 2005.Google ScholarGoogle Scholar
  28. L. Libkin and D. Vrgoc. Regular Path Queries on Graphs with Data. In ICDT 2012, pages 74--85, 2012. Google ScholarGoogle ScholarDigital LibraryDigital Library
  29. K. Losemann and W. Martens. The complexity of evaluating path expressions in sparql. In PODS, pages 101--112. ACM, 2012. Google ScholarGoogle ScholarDigital LibraryDigital Library
  30. A. O. Mendelzon and P. T. Wood. Finding Regular Simple Paths in Graph Databases. SIAM J. Comput., 24(6):1235--1258, 1995. Google ScholarGoogle ScholarDigital LibraryDigital Library
  31. Z. P. Nedev. Finding an Even Simple Path in a Directed Planar Graph. SIAM J. Comput., 29:685--695, 1999. Google ScholarGoogle ScholarDigital LibraryDigital Library
  32. Z. P. Nedev and P. T. Wood. A polynomial-time algorithm for finding regular simple paths in outerplanar graphs. J. Algorithms, 35(2):235--259, 2000. Google ScholarGoogle ScholarDigital LibraryDigital Library
  33. F. Olken. Graph data management for molecular biology. OMICS, 7(1):75--78, 2003.Google ScholarGoogle ScholarCross RefCross Ref
  34. C. H. Papadimitriou. Computational complexity. Addison-Wesley, 1994.Google ScholarGoogle Scholar
  35. N. Robertson and P. D. Seymour. Graph Minors .XIII. The Disjoint Paths Problem. J. Comb. Theory, Ser. B, 63(1):65--110, 1995. Google ScholarGoogle ScholarDigital LibraryDigital Library
  36. R. Ronen and O. Shmueli. Soql: A language for querying and creating data in social networks. In ICDE, pages 1595--1602, 2009. Google ScholarGoogle ScholarDigital LibraryDigital Library
  37. W. L. Ruzzo, J. Simon, and M. Tompa. Space-bounded hierarchies and probabilistic computations. J. Comput. Syst. Sci.}, 28(2):216--230, 1984.Google ScholarGoogle Scholar
  38. A. Schrijver. Finding k Disjoint Paths in a Directed Planar Graph. SIAM J. Comput., 23(4):780--788, 1994. Google ScholarGoogle ScholarDigital LibraryDigital Library
  39. M. P. Schützenberger. On finite monoids having only trivial subgroups. Information and Control, 8(2):190--194, 1965.Google ScholarGoogle ScholarCross RefCross Ref
  40. L. J. Stockmeyer and A. R. Meyer. Word problems requiring exponential time: Preliminary report. In STOC, pages 1--9, 1973. Google ScholarGoogle ScholarDigital LibraryDigital Library
  41. C. B. Ward and N. M. Wiegand. Complexity results on labeled shortest path problems from wireless routing metrics. Computer Networks, 54(2):208--217, 2010. Google ScholarGoogle ScholarDigital LibraryDigital Library

Index Terms

  1. A trichotomy for regular simple path queries on graphs

      Recommendations

      Comments

      Login options

      Check if you have access through your login credentials or your institution to get full access on this article.

      Sign in
      • Published in

        cover image ACM Conferences
        PODS '13: Proceedings of the 32nd ACM SIGMOD-SIGACT-SIGAI symposium on Principles of database systems
        June 2013
        334 pages
        ISBN:9781450320665
        DOI:10.1145/2463664
        • General Chair:
        • Richard Hull,
        • Program Chair:
        • Wenfei Fan

        Copyright © 2013 ACM

        Publisher

        Association for Computing Machinery

        New York, NY, United States

        Publication History

        • Published: 22 June 2013

        Permissions

        Request permissions about this article.

        Request Permissions

        Check for updates

        Qualifiers

        • research-article

        Acceptance Rates

        PODS '13 Paper Acceptance Rate24of97submissions,25%Overall Acceptance Rate476of1,835submissions,26%

      PDF Format

      View or Download as a PDF file.

      PDF

      eReader

      View online with eReader.

      eReader
      About Cookies On This Site

      We use cookies to ensure that we give you the best experience on our website.

      Learn more

      Got it!