Skip to main content
QUICK REVIEW

[Paper Review] Order-Preserving Suffix Trees and Their Algorithmic Applications

Maxime Crochemore, Costas S. Iliopoulos|arXiv (Cornell University)|Mar 27, 2013
Algorithms and Data CompressionComputer Science7 citations
TL;DR

This paper introduces order-preserving suffix trees (opSufTree), a data structure enabling efficient pattern matching and repetition detection in time series under order-isomorphism. It presents a randomized $O(n/log n)/\log\log n$ time algorithm to construct opSufTrees, enabling linear-time order-preserving pattern matching and efficient detection of op-squares (repeating patterns), with applications to stock trends and melody matching.

ABSTRACT

Recently Kubica et al. (Inf. Process. Let., 2013) and Kim et al. (submitted to Theor. Comp. Sci.) introduced order-preserving pattern matching. In this problem we are looking for consecutive substrings of the text that have the same "shape" as a given pattern. These results include a linear-time order-preserving pattern matching algorithm for polynomially-bounded alphabet and an extension of this result to pattern matching with multiple patterns. We make one step forward in the analysis and give an $O(\frac{n\log{n}}{\log\log{n}})$ time randomized algorithm constructing suffix trees in the order-preserving setting. We show a number of applications of order-preserving suffix trees to identify patterns and repetitions in time series.

Motivation & Objective

  • To address the need for efficient algorithms in order-preserving pattern matching, where patterns are defined by relative order rather than exact character matches.
  • To generalize classical suffix tree applications to the order-preserving setting, enabling new tools for analyzing time series data such as stock prices and musical scores.
  • To develop a data structure—order-preserving suffix trees—that supports efficient query operations under order-isomorphism.
  • To provide a randomized construction algorithm for opSufTrees with near-optimal time complexity, improving upon prior linear-time solutions for bounded alphabets.
  • To extend the framework to detect fundamental repetitions such as op-squares, which represent recurring trends in time series.

Proposed method

  • Define order-isomorphism between strings using position-wise relative ordering: two strings are order-isomorphic if their character comparisons are preserved.
  • Introduce the code of a string as a sequence of pairs (prev_<, prev_=), which captures the relative order of each character with respect to earlier positions.
  • Construct the order-preserving suffix tree (opSufTree) by building a suffix tree on the code sequence of the input string, enabling efficient order-isomorphism queries.
  • Use an offline character oracle based on orthogonal range counting to simulate access to the code values without storing them explicitly.
  • Leverage the framework of Cole and Hariharan (or Lee, Na, and Park) to design a randomized construction algorithm with $O(n\log n/\log\log n)$ time complexity.
  • Adapt classical suffix tree algorithms—such as those for finding squares and LCA queries—to the order-preserving setting using the opSufTree structure and code-based comparisons.

Experimental results

Research questions

  • RQ1Can we construct a suffix tree data structure that supports efficient order-preserving pattern matching, where patterns are defined by relative order rather than exact character sequences?
  • RQ2What is the optimal time complexity for constructing such a data structure, and can it be achieved with a randomized algorithm?
  • RQ3How can order-preserving suffix trees be used to detect fundamental repeating patterns, such as op-squares, in time series?
  • RQ4Can classical suffix tree applications—like finding all squares or LCA-based queries—be adapted to the order-preserving setting with minimal overhead?
  • RQ5Is there a way to support efficient online queries for order-isomorphic substrings using a compact and efficiently constructible data structure?

Key findings

  • An $O(n\log n/\log\log n)$ time randomized algorithm is presented for constructing order-preserving suffix trees, improving upon previous linear-time constructions for polynomially bounded alphabets.
  • The opSufTree enables order-preserving pattern matching in $O(m\log n/\log\log n)$ time per query, where $m$ is the pattern length.
  • All occurrences of a given order-isomorphic pattern can be reported efficiently by traversing the subtree of the corresponding locus in the opSufTree.
  • The paper presents a linear-time algorithm to check whether a string contains an op-square of a given length, using the opSufTree and LCA queries.
  • An $O(n\log n + \mathit{Occ})$ time algorithm is developed to report all op-squares in a string, where $\mathit{Occ}$ is the total number of occurrences.
  • The key insight is that a substring $w[i..i+2k-1]$ is an op-square if and only if the LCA of the leaves corresponding to suffixes $\mathit{suf}_i$ and $\mathit{suf}_{i+k}$ has depth at least $k$, enabling efficient detection using LCA data structures.

Read this paper

Open the full text in the Nubint reader and ask about any passage as you read.

Read this paper on Nubint

This review was generated by AI from the original paper. Please check the paper before citing it.