<p>Given a set of pattern strings <InlineEquation ID="IEq1"> <EquationSource Format="TEX">\(\mathcal {P}=\{P_1, P_2,\ldots P_k\}\)</EquationSource> <EquationSource Format="MATHML"><math> <mrow> <mi mathvariant="script">P</mi> <mo>=</mo> <mo stretchy="false">{</mo> <msub> <mi>P</mi> <mn>1</mn> </msub> <mo>,</mo> <msub> <mi>P</mi> <mn>2</mn> </msub> <mo>,</mo> <mo>…</mo> <msub> <mi>P</mi> <mi>k</mi> </msub> <mo stretchy="false">}</mo> </mrow> </math></EquationSource> </InlineEquation> and a text string <i>S</i>, the classic dictionary matching problem is to report all occurrences of each pattern in <i>S</i>. We study the dictionary problem in the compressed setting, where the pattern strings and the text string are compressed using run-length encoding, and the goal is to solve the problem without decompression and achieve efficient time and space in the size of the compressed strings. Let <i>m</i> and <i>n</i> be the total length of the patterns <InlineEquation ID="IEq2"> <EquationSource Format="TEX">\(\mathcal {P}\)</EquationSource> <EquationSource Format="MATHML"><math> <mi mathvariant="script">P</mi> </math></EquationSource> </InlineEquation> and the length of the text string <i>S</i>, respectively, and let <InlineEquation ID="IEq3"> <EquationSource Format="TEX">\(\overline{m}\)</EquationSource> <EquationSource Format="MATHML"><math> <mover> <mi>m</mi> <mo>¯</mo> </mover> </math></EquationSource> </InlineEquation> and <InlineEquation ID="IEq4"> <EquationSource Format="TEX">\(\overline{n}\)</EquationSource> <EquationSource Format="MATHML"><math> <mover> <mi>n</mi> <mo>¯</mo> </mover> </math></EquationSource> </InlineEquation> be the total number of runs in the run-length encoding of the patterns in <InlineEquation ID="IEq5"> <EquationSource Format="TEX">\(\mathcal {P}\)</EquationSource> <EquationSource Format="MATHML"><math> <mi mathvariant="script">P</mi> </math></EquationSource> </InlineEquation> and <i>S</i>, respectively. Our main result is an algorithm that achieves <InlineEquation ID="IEq6"> <EquationSource Format="TEX">\(O( (\overline{m} + \overline{n})\log \log m + \textrm{occ})\)</EquationSource> <EquationSource Format="MATHML"><math> <mrow> <mi>O</mi> <mo stretchy="false">(</mo> <mrow> <mo stretchy="false">(</mo> <mover> <mi>m</mi> <mo>¯</mo> </mover> <mo>+</mo> <mover> <mi>n</mi> <mo>¯</mo> </mover> <mo stretchy="false">)</mo> </mrow> <mo>log</mo> <mo>log</mo> <mi>m</mi> <mo>+</mo> <mtext>occ</mtext> <mo stretchy="false">)</mo> </mrow> </math></EquationSource> </InlineEquation> expected time, and <InlineEquation ID="IEq7"> <EquationSource Format="TEX">\(O(\overline{m})\)</EquationSource> <EquationSource Format="MATHML"><math> <mrow> <mi>O</mi> <mo stretchy="false">(</mo> <mover> <mi>m</mi> <mo>¯</mo> </mover> <mo stretchy="false">)</mo> </mrow> </math></EquationSource> </InlineEquation> space, where <InlineEquation ID="IEq8"> <EquationSource Format="TEX">\(\textrm{occ}\)</EquationSource> <EquationSource Format="MATHML"><math> <mtext>occ</mtext> </math></EquationSource> </InlineEquation> is the total number of occurrences of patterns in <i>S</i>. This is the first non-trivial solution to the problem. Since any solution must read the input, our time bound is optimal within a <InlineEquation ID="IEq9"> <EquationSource Format="TEX">\(\log \log m\)</EquationSource> <EquationSource Format="MATHML"><math> <mrow> <mo>log</mo> <mo>log</mo> <mi>m</mi> </mrow> </math></EquationSource> </InlineEquation> factor. We introduce several new techniques to achieve our bounds, including a new compressed representation of the classic Aho-Corasick automaton and a new efficient string index that supports fast queries in run-length encoded strings.</p>

错误:搜索内容不能为空,请输入英文关键词
错误:关键词超出字数限制,请精简
高级检索

Compressed Dictionary Matching on Run-Length Encoded Strings

  • Philip Bille,
  • Inge Li Gørtz,
  • Simon J. Puglisi,
  • Simon Rumle Tarnow

摘要

Given a set of pattern strings \(\mathcal {P}=\{P_1, P_2,\ldots P_k\}\) P = { P 1 , P 2 , P k } and a text string S, the classic dictionary matching problem is to report all occurrences of each pattern in S. We study the dictionary problem in the compressed setting, where the pattern strings and the text string are compressed using run-length encoding, and the goal is to solve the problem without decompression and achieve efficient time and space in the size of the compressed strings. Let m and n be the total length of the patterns \(\mathcal {P}\) P and the length of the text string S, respectively, and let \(\overline{m}\) m ¯ and \(\overline{n}\) n ¯ be the total number of runs in the run-length encoding of the patterns in \(\mathcal {P}\) P and S, respectively. Our main result is an algorithm that achieves \(O( (\overline{m} + \overline{n})\log \log m + \textrm{occ})\) O ( ( m ¯ + n ¯ ) log log m + occ ) expected time, and \(O(\overline{m})\) O ( m ¯ ) space, where \(\textrm{occ}\) occ is the total number of occurrences of patterns in S. This is the first non-trivial solution to the problem. Since any solution must read the input, our time bound is optimal within a \(\log \log m\) log log m factor. We introduce several new techniques to achieve our bounds, including a new compressed representation of the classic Aho-Corasick automaton and a new efficient string index that supports fast queries in run-length encoded strings.