Reversing Longest Previous Factor Tables is Hard
- Cite this paper as:
- He J., Liang H., Yang G. (2011) Reversing Longest Previous Factor Tables is Hard. In: Dehne F., Iacono J., Sack JR. (eds) Algorithms and Data Structures. WADS 2011. Lecture Notes in Computer Science, vol 6844. Springer, Berlin, Heidelberg
The Longest Previous Factor (LPF) table of a string s of length n is a table of size n whose ith element indicates the length of the longest substring of s starting from position i that has appeared previously in s. LPF tables facilitate the computing of the Lempel-Ziv factorization of strings [21,22] which plays an important role in text compression. An open question from Clément, Crochemore and Rindone  asked whether the following problem (which we call the reverse LPF problem) can be solved efficiently: Given a table W, decide whether it is the LPF table of some string, and find such a string if so.
In this paper, we address this open question by proving that the reverse LPF problem is NP-hard. Thus, there is no polynomial time algorithm for solving it unless P = NP. Complementing with this general hardness result, we also design a linear-time online algorithm for the reverse LPF problem over input tables whose elements are all 0 or 1.
Unable to display preview. Download preview PDF.