arXiv:2610.05330cs.DSOct 2026

Manuscript Offprint

arXiv:2610.05330

CT-Miner: Fast and Coarse-Grained Time-Series Pattern Mining via Cartesian Trees

Hyundong Jin, Hyunki Hong, Yo-Sub Han

ABSTRACT

Time series often contain recurring structural patterns, and efficiently mining such patterns into compact representations is essential for scalable analysis of long sequences. Cartesian tree (CT) equivalence provides a well-established structural abstraction that preserves hierarchical order structure while discarding exact values and fine-grained ordinal variations. By grouping multiple ordinal patterns into a shared structural form, CT equivalence offers a principled way to compress recurring temporal structure. However, mining frequent CT-equivalent patterns at scale remains computationally expensive. A naive pairwise approach repeatedly constructs and counts CT representations over subsequences, requiring O(n4)O(n^{4}) time for a sequence of length n, which severely limits its applicability to long sequences. We propose a new Cartesian pattern mining algorithm based on a Cartesian suffix tree that compactly organizes CT-equivalent subsequences and reuses shared structural information. Our method reduces exhaustive CT-pattern occurrence collection from O(n4)O(n^{4}) to O(n2)O(n^{2}) time, and we formally prove the correctness and complexity bounds. We further show that this computational gain translates into effective compact representations. Across diverse time-series datasets, a small set of mined CT patterns preserves meaningful clustering structure, and comparisons with finer-grained order-preserving representations show that CT equivalence reduces redundant ordinal distinctions under limited feature budgets. Our implementation is available at https://github.com/hyundong98/CT-Miner.

1 INTRODUCTION

Time-series data arise across a wide range of real-world systems, making effective representation important for downstream analysis (Yue et al., 2022; Wu et al., 2023a; Goswami et al., 2024; Wang et al., 2025; Trirat et al., 2026). Computational efficiency and scalability are also important considerations in modern time-series learning, particularly as sequence lengths and model scales increase (Franceschi et al., 2019; Dempster et al., 2021; Nie et al., 2023; Shi et al., 2025). One approach is to summarize long sequences through recurring patterns rather than relying directly on exact numerical values (Chiu et al., 2003; Zhou et al., 2026). However, the usefulness of such pattern-based representations critically depends on the level of abstraction (Lin et al., 2007). Treating small numerical or ordinal variations as distinct patterns can lead to highly fragmented and redundant representations.

Order-preserving (OP) patterns address numerical variability by representing subsequences through their relative order rather than their exact values (Wu et al., 2023b; Li et al., 2024a; Wu et al., 2023c; Li et al., 2024b; Zhang et al., 2026). However, OP equivalence preserves the complete pairwise ordering among elements, which can be unnecessarily fine-grained when the goal is to obtain a compact representation of recurring temporal structure. Closely related ordinal variations may therefore be assigned to different patterns even when they share the same higher-level structure. This motivates a coarser equivalence relation that discards less essential ordering information while retaining meaningful structural relationships.

Cartesian tree (CT) equivalence, which has been well studied in theoretical string matching, provides such a coarser structural abstraction (Vuillemin, 1980; Park et al., 2019; 2020; Kim & Han, 2025). Rather than preserving all pairwise order relationships, CT equivalence captures the hierarchical ordering structure induced by range minima. Consequently, multiple distinct OP patterns can be represented by the same CT pattern, allowing recurring structures to be consolidated into a more compact pattern space. Despite this appealing property, efficiently extracting frequent CT patterns from long time series remains challenging. For a pattern length LL, direct pairwise counting requires O(n2L)O(n^2L) time, reaching O(n3)O(n^3) when L=Θ(n)L = \Theta(n). Repeating this computation across all possible lengths leads to O(n4)O(n^4) time. Hash-based aggregation reduces the expected cumulative cost to O(nL2)O(nL^2), or O(n3)O(n^3) when L=Θ(n)L = \Theta(n), but hash collisions can recover the O(n4)O(n^4) worst-case bound. This computational bottleneck limits the practical use of CT-based representations at scale.

In this work, we bridge this gap with an efficient Cartesian pattern mining algorithm based on a Cartesian Suffix Tree. Our method exploits shared Cartesian structures across subsequences by constructing a Cartesian suffix tree in O(nlog⁡n)O(n \log n) time. Once constructed, occurrence information for a fixed pattern length can be collected in O(n)O(n) time, while collecting occurrence information across all possible pattern lengths takes O(n2)O(n^2) time. We formally prove the correctness of the proposed mining procedure and these complexity bounds. We further evaluate both the computational efficiency and representation utility of the proposed method. Compared with a straightforward hash-based CT mining implementation, our method achieves end-to-end speedups of up to approximately 7.0×7.0 \times as the maximum pattern length increases. Clustering experiments further show that small CT pattern dictionaries retain meaningful structural information under limited feature budgets.

References (63)