Sublinear Space Algorithms for the Longest Common Substring Problem
arXiv:1407.0522
Abstract
Given documents of total length , we consider the problem of finding a longest string common to at least of the documents. This problem is known as the \emph{longest common substring (LCS) problem} and has a classic space and 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 , the LCS problem can be solved in space and 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 time and 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 space must use time.
Accepted to 22nd European Symposium on Algorithms