Mind the Gap! Online Dictionary Matching with One Gap

Amihood Amir, Tsvi Kopelowitz, Avivit Levy, Seth Pettie, Ely Porat, B. Riva Shalom

Research output: Contribution to journalArticlepeer-review

16 Scopus citations

Abstract

We examine the complexity of the online Dictionary Matching with One Gap Problem (DMOG) which is the following. Preprocess a dictionary D of d patterns, where each pattern contains a special gap symbol that can match any string, so that given a text that arrives online, a character at a time, we can report all of the patterns from D that are suffixes of the text that has arrived so far, before the next character arrives. In more general versions the gap symbols are associated with bounds determining the possible lengths of matching strings. Online DMOG captures the difficulty in a bottleneck procedure for cyber-security, as many digital signatures of viruses manifest themselves as patterns with a single gap. In this paper, we demonstrate that the difficulty in obtaining efficient solutions for the DMOG problem, even in the offline setting, can be traced back to the infamous 3SUM conjecture. We show a conditional lower bound of Ω(δ(G D ) + op) time per text character, where G D is a bipartite graph that captures the structure of D, δ(G D ) is the degeneracy of this graph, and op is the output size. Moreover, we show a conditional lower bound in terms of the magnitude of gaps for the bounded case, thereby showing that some known offline upper bounds are essentially optimal. We also provide upper-bounds in terms of the degeneracy for the online DMOG problem. In particular, we introduce algorithms whose time cost depends linearly on δ(G D ). Our algorithms make use of graph orientations, together with some additional techniques. These algorithms are of interest for practical cases in which δ(G D ) is a small constant. Since δ(G D ) can in general be as large as d, and even larger if G D is a multi-graph, we also obtain other solutions adequate for such dense cases.

Original languageEnglish
Pages (from-to)2123-2157
Number of pages35
JournalAlgorithmica
Volume81
Issue number6
DOIs
StatePublished - 1 Jun 2019

Bibliographical note

Publisher Copyright:
© 2018, Springer Science+Business Media, LLC, part of Springer Nature.

Funding

Partially supported by ISF Grant 571/14, BSF Grant 2014028, and NSF Grants CCF-1217338, CNS-1318294, and CCF-1514383. This work is supported in part by ISF Grant 1278/16. This project has received funding from the European Research Council (ERC) under the European Union Horizon 2020 research and innovation programme (Grant Agreement No. 683064). A partial version of this paper appeared in ISAAC 2016.

FundersFunder number
National Science Foundation1637546, CCF-1217338, 1278/16, CNS-1318294, CCF-1514383
Horizon 2020 Framework Programme
European Commission683064
United States-Israel Binational Science Foundation2014028
Israel Science Foundation571/14

    Keywords

    • 3SUM
    • Dictionary matching
    • Pattern matching
    • Triangle reporting

    Fingerprint

    Dive into the research topics of 'Mind the Gap! Online Dictionary Matching with One Gap'. Together they form a unique fingerprint.

    Cite this