Abstract

We consider the problem of preprocessing two strings SS and TT, of lengths mm and nn, respectively, in order to be able to efficiently answer the following queries: Given positions i,ji,j in SS and positions a,ba,b in TT, return the optimal alignment of S[i. .j]S[i \mathinner{.\,.} j] and T[a. .b]T[a \mathinner{.\,.} b]. Let N=mnN=mn. We present an oracle with preprocessing time N1+o(1)N^{1+o(1)} and space N1+o(1)N^{1+o(1)} that answers queries in log⁡2+o(1)N\log^{2+o(1)}N time. In other words, we show that we can query the alignment of every two substrings in almost the same time it takes to compute just the alignment of SS and TT. Our oracle uses ideas from our distance oracle for planar graphs [STOC 2019] and exploits the special structure of the alignment graph. Conditioned on popular hardness conjectures, this result is optimal up to subpolynomial factors. Our results apply to both edit distance and longest common subsequence (LCS). The best previously known oracle with construction time and size O(N)\mathcal{O}(N) has slow Ω(N)Ω(\sqrt{N}) query time [Sakai, TCS 2019], and the one with size N1+o(1)N^{1+o(1)} and query time log⁡2+o(1)N\log^{2+o(1)}N (using a planar graph distance oracle) has slow Ω(N3/2)Ω(N^{3/2}) construction time [Long & Pettie, SODA 2021]. We improve both approaches by roughly a N\sqrt N factor.

Explore this paper’s authors, topics and related work.

Building this map preview

BZPEER is loading the nearby papers, people, topics and institutions for this page.

Reviews 0

Write a reviewWrite

No reviews yet.

Discussion 0

Add a commentWrite

No comments yet.