An Almost Optimal Edit Distance Oracle
Abstract
We consider the problem of preprocessing two strings and , of lengths and , respectively, in order to be able to efficiently answer the following queries: Given positions in and positions in , return the optimal alignment of and . Let . We present an oracle with preprocessing time and space that answers queries in 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 and . 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 has slow query time [Sakai, TCS 2019], and the one with size and query time (using a planar graph distance oracle) has slow construction time [Long & Pettie, SODA 2021]. We improve both approaches by roughly a factor.
Cite
@article{arxiv.2103.03294,
title = {An Almost Optimal Edit Distance Oracle},
author = {Panagiotis Charalampopoulos and Paweł Gawrychowski and Shay Mozes and Oren Weimann},
journal= {arXiv preprint arXiv:2103.03294},
year = {2021}
}