Reversing longest previous factor tables is hard

  • Authors:
  • Jing He;Hongyu Liang;Guang Yang

  • Affiliations:
  • IInstitute for Interdisciplinary Information Sciences, Tsinghua University, Beijing, China;IInstitute for Interdisciplinary Information Sciences, Tsinghua University, Beijing, China;IInstitute for Interdisciplinary Information Sciences, Tsinghua University, Beijing, China

  • Venue:
  • WADS'11 Proceedings of the 12th international conference on Algorithms and data structures
  • Year:
  • 2011

Quantified Score

Hi-index 0.00

Visualization

Abstract

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 [4] 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.