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

**Authors:** Kiichi Watanabe, Yuto Nakashima, Shunsuke Inenaga, Hideo Bannai,, Masayuki Takeda

arXiv: 1903.06290 · 2020-03-25

## TL;DR

This paper introduces efficient algorithms for identifying shortest unique palindromic substrings in run-length encoded strings, enabling fast query responses with optimized preprocessing.

## Contribution

It presents novel algorithms for SUPS queries on RLE strings, including variants with faster query times and efficient preprocessing methods.

## Key findings

- Preprocessing time is linear in RLE size.
- Query times are sub-logarithmic for SUPS retrieval.
- Algorithms work on run-length encoded representations, reducing complexity.

## Abstract

For a string $S$, a palindromic substring $S[i..j]$ is said to be a \emph{shortest unique palindromic substring} ($\mathit{SUPS}$) for an interval $[s, t]$ in $S$, if $S[i..j]$ occurs exactly once in $S$, the interval $[i, j]$ contains $[s, t]$, and every palindromic substring containing $[s, t]$ which is shorter than $S[i..j]$ occurs at least twice in $S$. In this paper, we study the problem of answering $\mathit{SUPS}$ queries on run-length encoded strings. We show how to preprocess a given run-length encoded string $\mathit{RLE}_{S}$ of size $m$ in $O(m)$ space and $O(m \log \sigma_{\mathit{RLE}_{S}} + m \sqrt{\log m / \log\log m})$ time so that all $\mathit{SUPSs}$ for any subsequent query interval can be answered in $O(\sqrt{\log m / \log\log m} + \alpha)$ time, where $\alpha$ is the number of outputs, and $\sigma_{\mathit{RLE}_{S}}$ is the number of distinct runs of $\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(\sqrt{\log\log m /\log\log\log m} + \alpha)$ time and can be built in $O(m \log \sigma_{\mathit{RLE}_{S}} + m \sqrt{\log m / \log\log m})$ time, and the second one answers queries in $O(\log \log m + \alpha)$ time and can be built in $O(m \log \sigma_{\mathit{RLE}_{S}})$ time. Both of these data structures require $O(m)$ space.

## Full text

_Full body text omitted from this summary view._ Fetch the complete paper as Markdown: https://tomesphere.com/paper/1903.06290/full.md

## Figures

5 figures with captions in the complete paper: https://tomesphere.com/paper/1903.06290/full.md

## References

16 references — full list in the complete paper: https://tomesphere.com/paper/1903.06290/full.md

---
Source: https://tomesphere.com/paper/1903.06290