A Note on the Longest Common Compatible Prefix Problem for Partial Words
Abstract
For a partial word the longest common compatible prefix of two positions , denoted , is the largest such that , where is the compatibility relation of partial words (it is not an equivalence relation). The LCCP problem is to preprocess a partial word in such a way that any query about this word can be answered in time. It is a natural generalization of the longest common prefix (LCP) problem for regular words, for which an preprocessing time and query time solution exists. Recently an efficient algorithm for this problem has been given by F. Blanchet-Sadri and J. Lazarow (LATA 2013). The preprocessing time was , where is the number of "holes" in . The algorithm was designed for partial words over a constant alphabet and was quite involved. We present a simple solution to this problem with slightly better runtime that works for any linearly-sortable alphabet. Our preprocessing is in time , where is the number of blocks of holes in . Our algorithm uses ideas from alignment algorithms and dynamic programming.
Keywords
Cite
@article{arxiv.1312.2381,
title = {A Note on the Longest Common Compatible Prefix Problem for Partial Words},
author = {Maxime Crochemore and Costas S. Iliopoulos and Tomasz Kociumaka and Marcin Kubica and Alessio Langiu and Jakub Radoszewski and Wojciech Rytter and Bartosz Szreder and Tomasz Waleń},
journal= {arXiv preprint arXiv:1312.2381},
year = {2013}
}