On the complexity of indeterminate strings matching

Research output: Contribution to journalArticlepeer-review

Abstract

Given two indeterminate equal-length strings p and t with a set of r characters per position in both strings, we obtain a determinate string pw from p and a determinate string tw from t by choosing one character per position. Then, we say that p and t match when pw and tw match for some choice of characters. We systematically study the complexity of string matching for indeterminate equal-length strings, for different notions of matching: parameterized matching, order-preserving matching, and Cartesian tree matching. We use n to denote the length of both strings and r the upper bound on the number of characters per position. First, we provide an algorithm for the Cartesian tree version that runs in O(nlognloglogn) time using O(n) space, for any constant r. Second, we establish NP-hardness of the order-preserving version for r=2, thus solving a question explicitly stated by Henriques et al. [CPM 2018], who showed hardness for r=3. Third, we establish NP-hardness of the parameterized version for r=2. As both parameterized and order-preserving indeterminate matching reduce to the standard determinate matching for r=1, this provides a complete classification for these three variants.

Original languageEnglish
Article number115771
JournalTheoretical Computer Science
Volume1067
DOIs
StatePublished - 2 Apr 2026

Bibliographical note

Publisher Copyright:
© 2026 Elsevier B.V.

Keywords

  • Cartesian tree matching
  • Indeterminate strings
  • Order-preserving matching
  • Parameterized matching

ASJC Scopus subject areas

  • Theoretical Computer Science
  • General Computer Science

Fingerprint

Dive into the research topics of 'On the complexity of indeterminate strings matching'. Together they form a unique fingerprint.

Cite this