Location via proxy:   [ UP ]  
[Report a bug]   [Manage cookies]                
skip to main content
research-article

#NFA Admits an FPRAS: Efficient Enumeration, Counting, and Uniform Generation for Logspace Classes

Published: 28 October 2021 Publication History

Abstract

In this work, we study two simple yet general complexity classes, based on logspace Turing machines, that provide a unifying framework for efficient query evaluation in areas such as information extraction and graph databases, among others. We investigate the complexity of three fundamental algorithmic problems for these classes: enumeration, counting, and uniform generation of solutions, and show that they have several desirable properties in this respect.
Both complexity classes are defined in terms of non-deterministic logspace transducers (NL-transducers). For the first class, we consider the case of unambiguous NL-transducers, and we prove constant delay enumeration and both counting and uniform generation of solutions in polynomial time. For the second class, we consider unrestricted NL-transducers, and we obtain polynomial delay enumeration, approximate counting in polynomial time, and polynomial-time randomized algorithms for uniform generation. More specifically, we show that each problem in this second class admits a fully polynomial-time randomized approximation scheme (FPRAS) and a polynomial-time Las Vegas algorithm (with preprocessing) for uniform generation. Remarkably, the key idea to prove these results is to show that the fundamental problem # NFA admits an FPRAS, where # NFA is the problem of counting the number of strings of length n (given in unary) accepted by a non-deterministic finite automaton (NFA). While this problem is known to be P-complete and, more precisely, SpanL-complete, it was open whether this problem admits an FPRAS. In this work, we solve this open problem and obtain as a welcome corollary that every function in SpanL admits an FPRAS.

References

[1]
Serge Abiteboul, Gerome Miklau, Julia Stoyanovich, and Gerhard Weikum. 2016. Data, responsibly (Dagstuhl seminar 16291). Dagstuhl Rep. 6, 7 (2016), 42–71.
[2]
Alfred V. Aho and John E. Hopcroft. 1974. The Design and Analysis of Computer Algorithms. Pearson Education India.
[3]
Carme Álvarez and Birgit Jenner. 1993. A very hard log-space counting class. Theor. Comput. Sci. 107, 1 (1993), 3–30.
[4]
Antoine Amarilli, Pierre Bourhis, Louis Jachiet, and Stefan Mengel. 2017. A circuit-based approach to efficient enumeration. In Proceedings of ICALP. 111:1–111:15.
[5]
Antoine Amarilli, Florent Capelli, Mikaël Monet, and Pierre Senellart. 2018. Connecting knowledge compilation classes and width parameters. CoRR abs/1811.02944 (2018).
[6]
Renzo Angles, Marcelo Arenas, Pablo Barceló, Aidan Hogan, Juan Reutter, and Domagoj Vrgoč. 2017. Foundations of modern query languages for graph databases. ACM Comput. Surv. 50, 5 (2017), 68.
[7]
Marcelo Arenas, Sebastián Conca, and Jorge Pérez. 2012. Counting beyond a Yottabyte, or how SPARQL 1.1 property paths will prevent adoption of the standard. In Proceedings of WWW. 629–638.
[8]
Marcelo Arenas, Martin Muñoz, and Cristian Riveros. 2017. Descriptive complexity for counting complexity classes. In Proceedings of LICS. 1–12.
[9]
Guillaume Bagan. 2006. MSO queries on tree decomposable structures are computable with linear delay. In Proceedings of CSL. 167–181.
[10]
Guillaume Bagan, Arnaud Durand, and Etienne Grandjean. 2007. On acyclic conjunctive queries and constant delay enumeration. In Proceedings of CSL. 208–222.
[11]
Randal E. Bryant. 1992. Symbolic Boolean manipulation with ordered binary-decision diagrams. ACM Comput. Surv. 24, 3 (1992), 293–318.
[12]
Bruno Courcelle. 2009. Linear delay enumeration and monadic second-order logic. Discr. Appl. Math. 157, 12 (2009), 2675–2700.
[13]
Constantinos Daskalakis, Paul W. Goldberg, and Christos H. Papadimitriou. 2009. The complexity of computing a Nash equilibrium. SIAM J. Comput. 39, 1 (2009), 195–259.
[14]
Ronald Fagin, Benny Kimelfeld, Frederick Reiss, and Stijn Vansummeren. 2015. Document spanners: A formal approach to information extraction. J. ACM 62, 2 (2015), 12.
[15]
Fernando Florenzano, Cristian Riveros, Martin Ugarte, Stijn Vansummeren, and Domagoj Vrgoc. 2018. Constant delay algorithms for regular document spanners. arXiv preprint arXiv:1803.05277 (2018).
[16]
Dominik D. Freydenberger. 2017. A logic for document spanners. In Proceedings of ICDT. 13:1–13:18.
[17]
Dominik D. Freydenberger, Benny Kimelfeld, and Liat Peterfreund. 2018. Joining extractions of regular expressions. In Proceedings of PODS. 137–149.
[18]
Vivek Gore, Mark Jerrum, Sampath Kannan, Z. Sweedyk, and Stephen R. Mahaney. 1997. A quasi-polynomial-time algorithm for sampling words from a context-free language. Inf. Comput. 134, 1 (1997), 59–74.
[19]
Lane A. Hemaspaandra and Heribert Vollmer. 1995. The satanic notations: Counting classes beyond #P and other definitional adventures. SIGACT News 26, 1 (1995), 2–13.
[20]
Wassily Hoeffding. 1963. Probability inequalities for sums of bounded random variables. J. Amer. Statist. Assoc. 58, 301 (1963), 13–30.
[21]
Mark R. Jerrum, Leslie G. Valiant, and Vijay V. Vazirani. 1986. Random generation of combinatorial structures from a uniform distribution. Theor. Comput. Sci. 43 (1986), 169–188.
[22]
David S. Johnson, Mihalis Yannakakis, and Christos H. Papadimitriou. 1988. On generating all maximal independent sets. Inform. Process. Lett. 27, 3 (1988), 119–123.
[23]
Sampath Kannan, Z. Sweedyk, and Stephen R. Mahaney. 1995. Counting and random generation of strings in regular languages. In Proceedings of SODA. 551–557.
[24]
Richard M. Karp and Michael Luby. 1983. Monte Carlo algorithms for enumeration and reliability problems. In Proceedings of FOCS. 56–64.
[25]
Katja Losemann and Wim Martens. 2013. The complexity of regular expressions and property paths in SPARQL. ACM Trans. Datab. Syst. 38, 4 (2013), 24:1–24:39.
[26]
Francisco Maturana, Cristian Riveros, and Domagoj Vrgoc. 2018. Document spanners for extracting incomplete information: Expressiveness and complexity. In Proceedings of PODS. ACM, 125–136.
[27]
J. Scott Provan and Michael O. Ball. 1983. The complexity of counting cuts and of computing the probability that a graph is connected. SIAM J. Comput. 12, 4 (1983), 777–788.
[28]
Klaus Reinhardt and Eric Allender. 2000. Making nondeterminism unambiguous. SIAM J. Comput. 29, 4 (2000), 1118–1131.
[29]
Sanjeev Saluja, K. V. Subrahmanyam, and Madhukar N. Thakur. 1995. Descriptive complexity of# P functions. J. Comput. Syst. Sci. 50, 3 (1995), 493–505.
[30]
Johannes Schmidt. 2009. Enumeration: Algorithms and complexity. Retrieved from https://citeseerx.ist.psu.edu/viewdoc/download?doi=10.1.1.582.8008&rep=rep1&type=pdf.
[31]
Luc Segoufin. 2013. Enumerating with constant delay the answers to a query. In Proceedings of ICDT. 10–20.
[32]
Leslie G. Valiant. 1976. Relative complexity of checking and evaluating. Inf. Process. Lett. 5, 1 (1976), 20–23.
[33]
Moshe Y. Vardi. 1982. The complexity of relational query languages (extended abstract). In Proceedings of the 14th Annual ACM Symposium on Theory of Computing. 137–146.

Cited By

View all
  • (2024)Towards Tractability of the Diversity of Query Answers: Ultrametrics to the RescueProceedings of the ACM on Management of Data10.1145/36958332:5(1-26)Online publication date: 7-Nov-2024
  • (2024)A faster FPRAS for #NFAProceedings of the ACM on Management of Data10.1145/36516132:2(1-22)Online publication date: 14-May-2024
  • (2024)Combined Approximations for Uniform Operational Consistent Query AnsweringProceedings of the ACM on Management of Data10.1145/36516002:2(1-16)Online publication date: 14-May-2024
  • Show More Cited By

Recommendations

Comments

Information & Contributors

Information

Published In

cover image Journal of the ACM
Journal of the ACM  Volume 68, Issue 6
December 2021
283 pages
ISSN:0004-5411
EISSN:1557-735X
DOI:10.1145/3484923
Issue’s Table of Contents
Permission to make digital or hard copies of all or part of this work for personal or classroom use is granted without fee provided that copies are not made or distributed for profit or commercial advantage and that copies bear this notice and the full citation on the first page. Copyrights for components of this work owned by others than ACM must be honored. Abstracting with credit is permitted. To copy otherwise, or republish, to post on servers or to redistribute to lists, requires prior specific permission and/or a fee. Request permissions from [email protected].

Publisher

Association for Computing Machinery

New York, NY, United States

Publication History

Published: 28 October 2021
Accepted: 01 July 2021
Revised: 01 April 2021
Received: 01 April 2020
Published in JACM Volume 68, Issue 6

Permissions

Request permissions for this article.

Check for updates

Author Tags

  1. Enumeration
  2. counting
  3. uniform generation

Qualifiers

  • Research-article
  • Refereed

Funding Sources

  • ANID - Millennium Science Initiative Program
  • Fondecyt
  • ANID BECAS/MAGISTER NACIONAL

Contributors

Other Metrics

Bibliometrics & Citations

Bibliometrics

Article Metrics

  • Downloads (Last 12 months)43
  • Downloads (Last 6 weeks)2
Reflects downloads up to 09 Nov 2024

Other Metrics

Citations

Cited By

View all
  • (2024)Towards Tractability of the Diversity of Query Answers: Ultrametrics to the RescueProceedings of the ACM on Management of Data10.1145/36958332:5(1-26)Online publication date: 7-Nov-2024
  • (2024)A faster FPRAS for #NFAProceedings of the ACM on Management of Data10.1145/36516132:2(1-22)Online publication date: 14-May-2024
  • (2024)Combined Approximations for Uniform Operational Consistent Query AnsweringProceedings of the ACM on Management of Data10.1145/36516002:2(1-16)Online publication date: 14-May-2024
  • (2022)Counting the Answers to a QueryACM SIGMOD Record10.1145/3572751.357275351:3(6-17)Online publication date: 21-Nov-2022

View Options

Get Access

Login options

Full Access

View options

PDF

View or Download as a PDF file.

PDF

eReader

View online with eReader.

eReader

HTML Format

View this article in HTML Format.

HTML Format

Media

Figures

Other

Tables

Share

Share

Share this Publication link

Share on social media