Article ID Journal Published Year Pages File Type
437718 Theoretical Computer Science 2015 13 Pages PDF
Abstract

The dictionary matching with gaps problem is to preprocess a dictionary D   of total size |D||D| containing d   gapped patterns P1,…,PdP1,…,Pd over an alphabet Σ  , where each gapped pattern PiPi is a sequence of subpatterns separated by bounded sequences of don't cares. Then, given a query text T of length n over Σ, the goal is to output all locations in T   in which a pattern Pi∈DPi∈D, 1≤i≤d1≤i≤d, ends. There is a renewed current interest in the gapped matching problem stemming from cyber security. In this paper we solve the problem where all patterns in the dictionary have one gap or a few gaps with at least α and at most β don't cares, where α and β   are given parameters. Specifically, we show that the dictionary matching with a single gap problem can be solved in either O(dlog⁡d+|D|)O(dlog⁡d+|D|) preprocessing time and O(dlogε⁡d+|D|)O(dlogε⁡d+|D|) space, and query time O(n(β−α)log⁡log⁡dlog2⁡|D|+occ)O(n(β−α)log⁡log⁡dlog2⁡|D|+occ), where occ   is the number of patterns found, or preprocessing time and space: O(d2+|D|)O(d2+|D|), and query time O(n(β−α)+occ)O(n(β−α)+occ), where occ is the number of patterns found. We also show that the dictionary matching with k   gaps problem, where k≥1k≥1, can be solved in preprocessing time: O(|D|log⁡|D|)O(|D|log⁡|D|), space: O(|D|+d(c1log⁡d)kk!), and query time: O((β−α)k(n+(c2log⁡d)kk!log⁡log⁡|D|)+occ), where c1,c2>1c1,c2>1 are constants and occ is the number of patterns found. As far as we know, these are the best solutions for this setting of the problem, where many overlaps may exist in the dictionary.

Keywords
Related Topics
Physical Sciences and Engineering Computer Science Computational Theory and Mathematics
Authors
, , , ,