Inicio  /  Algorithms  /  Vol: 14 Par: 5 (2021)  /  Artículo
ARTÍCULO
TITULO

Text Indexing for Regular Expression Matching

Daniel Gibney and Sharma V. Thankachan    

Resumen

Finding substrings of a text T that match a regular expression p is a fundamental problem. Despite being the subject of extensive research, no solution with a time complexity significantly better than ??(|??||??|) O ( | T | | p | ) has been found. Backurs and Indyk in FOCS 2016 established conditional lower bounds for the algorithmic problem based on the Strong Exponential Time Hypothesis that helps explain this difficulty. A natural question is whether we can improve the time complexity for matching the regular expression by preprocessing the text T? We show that conditioned on the Online Matrix?Vector Multiplication (OMv) conjecture, even with arbitrary polynomial preprocessing time, a regular expression query on a text cannot be answered in strongly sublinear time, i.e., ??(|??|1-??) O ( | T | 1 - e ) for any ??>0 e > 0 . Furthermore, if we extend the OMv conjecture to a plausible conjecture regarding Boolean matrix multiplication with polynomial preprocessing time, which we call Online Matrix?Matrix Multiplication (OMM), we can strengthen this hardness result to there being no solution with a query time that is ??(|??|3/2-??) O ( | T | 3 / 2 - e ) . These results hold for alphabet sizes three or greater. We then provide data structures that answer queries in ??(|??||??|??) O ( | T | | p | t ) time where ???[1,|??|] t ? [ 1 , | T | ] is fixed at construction. These include a solution that works for all regular expressions with Exp(??·|??|) Exp t · | T | preprocessing time and space. For patterns containing only ?concatenation? and ?or? operators (the same type used in the hardness result), we provide (1) a deterministic solution which requires Exp(??·|??|log2|??|) Exp t · | T | log 2 | T | preprocessing time and space, and (2) when |??|=|??|?? | p | = | T | z for ??=2??(log|??|v) z = 2 o ( log | T | ) , a randomized solution with amortized query time which answers queries correctly with high probability, requiring Exp(??·|??|2Olog|??|v) Exp t · | T | 2 O log | T | preprocessing time and space.

 Artículos similares