Detecting approximate periodic patterns

  • Authors:
  • Amihood Amir;Alberto Apostolico;Estrella Eisenberg;Gad M. Landau;Avivit Levy;Noa Lewenstein

  • Affiliations:
  • Department of Computer Science, Bar-Ilan University, Ramat-Gan, Israel, Department of Computer Science, Johns Hopkins University, Baltimore, MD, United States;College of Computing, Georgia Institute of Technology, Atlanta, GA, and Dipartimento di Ingegneria dell' Informazione, Università diPadova, Padova, Italy;Department of Computer Science, Bar-Ilan University, Ramat-Gan, Israel;Department of Computer Science, University of Haifa, Haifa, Israel, Department of Computer Science and Engineering, Polytechnic Institute of New York University, Brooklyn, NY, United States;Department of Software Engineering, Shenkar College, Ramat-Gan, Israel, CRI, Haifa University, Haifa, Israel;Netanya College, Netanya, Israel

  • Venue:
  • MedAlg'12 Proceedings of the First Mediterranean conference on Design and Analysis of Algorithms
  • Year:
  • 2012

Quantified Score

Hi-index 0.00

Visualization

Abstract

Given ε∈[0, 1), the ε-Relative Error Periodic Pattern Problem (REPP) is the following: INPUT: An n-long sequence S of numbers si∈ℕ in increasing order. OUTPUT: The longest ε-relative error periodic pattern, i.e., the longest subsequence $s_{i_1}, s_{i_2},\ldots, s_{i_k}$ of S, for which there exists a number p such that the absolute difference between any two consecutive numbers in the subsequence is at least p and at most p(1+ε). The best known algorithm for this problem has O(n3) time complexity. This bound is too high for large inputs in practice. In this paper we give a new algorithm for finding the longest ε-relative error periodic pattern (the REPP problem). Our method is based on a transformation of the input sequence into a different representation: the ε-active maximal intervals listL, defined in this paper. We show that the transformation of S to the list L can be done efficiently (quadratic in n and linear in the size of L) and prove that our algorithm is linear in the size of L. This enables us to prove that our algorithm works in sub-cubic time on inputs for which the best known algorithm works in O(n3) time. Moreover, though it may happen that our algorithm would still be cubic, it is never worse than the known O(n3)-algorithm and in many situations its complexity is O(n2) time.