Lune

FOCS2021Top-tier venue

Small-space and streaming pattern matching with kk edits

Tomasz Kociumaka, Ely Porat, Tatiana Starikovskaya

2021Year
13Citations
10Top-tier citations

Abstract

In this work, we revisit the fundamental and well-studied problem of approximate pattern matching under edit distance. Given an integerkk, a patternPPof lengthmm, and a textTTof lengthn≥mn\geq m, the task is to find substrings ofTTthat are within edit distancekkfromPP. Our main result is a streaming algorithm that solves the problem inO~(k5)\tilde{\mathcal{O}}(k^{5})space11Hereafter,O~(⋅)\tilde{\mathcal{O}}(\cdot)hides apoly(log⁡n)\text{poly} (\log n)factor. andO~(k8)\tilde{\mathcal{O}}(k^{8})amortized time per character of the text, providing answers correct with high probability. This answers a decade-old question: since the discovery of a poly (k log nk\ \text{log}\ n) -space streaming algorithm for pattern matching under Hamming distance by Porat and Porat [FOCS 2009], the existence of an analogous result for edit distance remained open. Up to this work, no poly (k log nk\ \text{log}\ n)-space algorithm was known even in the simpler semi-streaming model, whereTTcomes as a stream butPPis available for read-only access. In this model, we give a deterministic algorithm that achieves slightly better complexity. Our central technical contribution is a new space-efficient deterministic encoding of two strings, called the greedy encoding, which encodes a set of all alignments of cost at mostkkwith a certain property (we call such alignments greedy). On strings of length at mostnn, the encoding occupiesO~(k2)\tilde{\mathcal{O}}(k^{2})space. We use the encoding to compress substrings of the text that are close to the pattern. In order to do so, we compute the encoding for substrings of the text and of the pattern, which requires read-only access to the latter. In order to develop the fully streaming algorithm, we further introduce a new edit distance sketch parameterized by integersn>kn > k. For any string of length at mostnn, the sketch is of sizeO~(k‾2)\tilde{\mathcal{O}}\overline{(k}^{2}), and it can be computed with anO~(k2)\tilde{\mathcal{O}}(k^{2})-space streaming algorithm. Given the sketches of two strings, inO~(k3)\tilde{\mathcal{O}}(k^{3})time we can compute their edit distance or certify that it is larger thankk. This result improves uponO~(k8)\tilde{\mathcal{O}}(k^{8})-size sketches of Belazzougui and Zhang [FOCS 2016] and very recentO~(k3)\tilde{\mathcal{O}}(k^{3})-size sketches of Jin, Nelson, and Wu [STACS 2021].

Ask about this paper

Your agent reads all of it.

Lune indexed this paper to the last equation, along with the top-tier papers that cite it. Ask a question and the answer quotes them.

Questions to start from

Your agent calls

Luneget_paper_fulltext

Ask in Lune

Free to start. No credit card required.

lune papers fulltext 5f600cd9-307e-4684-81a6-103bafd79023

Cited by top-tier papers10

Ask how each one uses it

Builds on3

Related papers

Dusk over the sea between two cliffs drawn in fine vertical lines