Abstract

Given mm documents of total length nn, we consider the problem of finding a longest string common to at least d≥2d \geq 2 of the documents. This problem is known as the \emph{longest common substring (LCS) problem} and has a classic O(n)O(n) space and O(n)O(n) time solution (Weiner [FOCS'73], Hui [CPM'92]). However, the use of linear space is impractical in many applications. In this paper we show that for any trade-off parameter 1≤τ≤n1 \leq τ\leq n, the LCS problem can be solved in O(τ)O(τ) space and O(n2/τ)O(n^2/τ) time, thus providing the first smooth deterministic time-space trade-off from constant to linear space. The result uses a new and very simple algorithm, which computes a ττ-additive approximation to the LCS in O(n2/τ)O(n^2/τ) time and O(1)O(1) space. We also show a time-space trade-off lower bound for deterministic branching programs, which implies that any deterministic RAM algorithm solving the LCS problem on documents from a sufficiently large alphabet in O(τ)O(τ) space must use Ω(nlog⁡(n/(τlog⁡n))/log⁡log⁡(n/(τlog⁡n))Ω(n\sqrt{\log(n/(τ\log n))/\log\log(n/(τ\log n)}) time.

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.