Fast Algorithms for the Shortest Unique Palindromic Substring Problem on Run-Length Encoded Strings

preprint2020arXivOpen access

Abstract

For a string SS, a palindromic substring S[i..j]S[i..j] is said to be a \emph{shortest unique palindromic substring} (SUPS\mathit{SUPS}) for an interval [s,t][s, t] in SS, if S[i..j]S[i..j] occurs exactly once in SS, the interval [i,j][i, j] contains [s,t][s, t], and every palindromic substring containing [s,t][s, t] which is shorter than S[i..j]S[i..j] occurs at least twice in SS. In this paper, we study the problem of answering SUPS\mathit{SUPS} queries on run-length encoded strings. We show how to preprocess a given run-length encoded string RLES\mathit{RLE}_{S} of size mm in O(m)O(m) space and O(mlog⁡σRLES+mlog⁡m/log⁡log⁡m)O(m \log σ_{\mathit{RLE}_{S}} + m \sqrt{\log m / \log\log m}) time so that all SUPSs\mathit{SUPSs} for any subsequent query interval can be answered in O(log⁡m/log⁡log⁡m+α)O(\sqrt{\log m / \log\log m} + α) time, where αα is the number of outputs, and σRLESσ_{\mathit{RLE}_{S}} is the number of distinct runs of RLES\mathit{RLE}_{S}. Additionaly, we consider a variant of the SUPS problem where a query interval is also given in a run-length encoded form. For this variant of the problem, we present two alternative algorithms with faster queries. The first one answers queries in O(log⁡log⁡m/log⁡log⁡log⁡m+α)O(\sqrt{\log\log m /\log\log\log m} + α) time and can be built in O(mlog⁡σRLES+mlog⁡m/log⁡log⁡m)O(m \log σ_{\mathit{RLE}_{S}} + m \sqrt{\log m / \log\log m}) time, and the second one answers queries in O(log⁡log⁡m+α)O(\log \log m + α) time and can be built in O(mlog⁡σRLES)O(m \log σ_{\mathit{RLE}_{S}}) time. Both of these data structures require O(m)O(m) space.

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.