Papers
Topics
Authors
Recent
Gemini 2.5 Flash
Gemini 2.5 Flash
97 tokens/sec
GPT-4o
53 tokens/sec
Gemini 2.5 Pro Pro
43 tokens/sec
o3 Pro
4 tokens/sec
GPT-4.1 Pro
47 tokens/sec
DeepSeek R1 via Azure Pro
28 tokens/sec
2000 character limit reached

Fast Algorithms for the Shortest Unique Palindromic Substring Problem on Run-Length Encoded Strings (1903.06290v2)

Published 14 Mar 2019 in cs.DS

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.

User Edit Pencil Streamline Icon: https://streamlinehq.com
Authors (5)
  1. Kiichi Watanabe (2 papers)
  2. Yuto Nakashima (48 papers)
  3. Shunsuke Inenaga (104 papers)
  4. Hideo Bannai (79 papers)
  5. Masayuki Takeda (49 papers)
Citations (8)

Summary

We haven't generated a summary for this paper yet.