English

Streaming for Aibohphobes: Longest Palindrome with Mismatches

Data Structures and Algorithms 2017-05-05 v1

Abstract

A palindrome is a string that reads the same as its reverse, such as "aibohphobia" (fear of palindromes). Given an integer d>0d>0, a dd-near-palindrome is a string of Hamming distance at most dd from its reverse. We study the natural problem of identifying a longest dd-near-palindrome in data streams. The problem is relevant to the analysis of DNA databases, and to the task of repairing recursive structures in documents such as XML and JSON. We present an algorithm that returns a dd-near-palindrome whose length is within a multiplicative (1+ϵ)(1+\epsilon)-factor of the longest dd-near-palindrome. Our algorithm also returns the set of mismatched indices of the dd-near-palindrome, using O(dlog7nϵlog(1+ϵ))\mathcal{O}\left(\frac{d\log^7 n}{\epsilon\log(1+\epsilon)}\right) bits of space, and O(dlog6nϵlog(1+ϵ))\mathcal{O}\left(\frac{d\log^6 n}{\epsilon\log(1+\epsilon)}\right) update time per arriving symbol. We show that Ω(dlogn)\Omega(d\log n) space is necessary for estimating the length of longest dd-near-palindromes with high probability. We further obtain an additive-error approximation algorithm and a comparable lower bound, as well as an exact two-pass algorithm that solves the longest dd-near-palindrome problem using O(d2nlog6n)\mathcal{O}\left(d^2\sqrt{n}\log^6 n\right) bits of space.

Keywords

Cite

@article{arxiv.1705.01887,
  title  = {Streaming for Aibohphobes: Longest Palindrome with Mismatches},
  author = {Elena Grigorescu and Erfan Sadeqi Azer and Samson Zhou},
  journal= {arXiv preprint arXiv:1705.01887},
  year   = {2017}
}