# Streaming for Aibohphobes: Longest Palindrome with Mismatches

**Authors:** Elena Grigorescu, Erfan Sadeqi Azer, Samson Zhou

arXiv: 1705.01887 · 2017-05-05

## TL;DR

This paper introduces streaming algorithms for finding long approximate palindromes with mismatches, providing space-efficient solutions with approximation guarantees and lower bounds, applicable to DNA analysis and document repair.

## Contribution

It presents the first streaming algorithms for longest $d$-near-palindromes with approximation guarantees and space complexity analysis, including lower bounds and exact two-pass algorithms.

## Key findings

- Algorithm achieves $(1+psilon)$-approximation with space $\u2113rac{d\u2217	ext{polylog}(n)}{\u2208}$
- Lower bounds show $\u2205 d\u2207	ext{polylog}(n)$ space necessary for estimation
- Exact two-pass algorithm uses $\u2206 d^2	ext{polylog}(n)$ space

## Abstract

A palindrome is a string that reads the same as its reverse, such as "aibohphobia" (fear of palindromes). Given an integer $d>0$, a $d$-near-palindrome is a string of Hamming distance at most $d$ from its reverse. We study the natural problem of identifying a longest $d$-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 $d$-near-palindrome whose length is within a multiplicative $(1+\epsilon)$-factor of the longest $d$-near-palindrome. Our algorithm also returns the set of mismatched indices of the $d$-near-palindrome, using $\mathcal{O}\left(\frac{d\log^7 n}{\epsilon\log(1+\epsilon)}\right)$ bits of space, and $\mathcal{O}\left(\frac{d\log^6 n}{\epsilon\log(1+\epsilon)}\right)$ update time per arriving symbol. We show that $\Omega(d\log n)$ space is necessary for estimating the length of longest $d$-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 $d$-near-palindrome problem using $\mathcal{O}\left(d^2\sqrt{n}\log^6 n\right)$ bits of space.

## Full text

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

## Figures

7 figures with captions in the complete paper: https://tomesphere.com/paper/1705.01887/full.md

## References

24 references — full list in the complete paper: https://tomesphere.com/paper/1705.01887/full.md

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