Abstract
Two strings of equal length are called order-isomorphic if their relative orders are identical at every position. The classical order-preserving pattern matching (OPPM) problem finds all substrings in a text T that are order-isomorphic to a pattern P. However, measurement errors can cause data loss or inaccuracies, making exact pattern detection difficult and motivating the active study of approximate OPPM variants, such as 2-partition OPPM. In this paper, we extend the existing partition-based relaxation of order-isomorphism and define the 3-partition OPPM problem. The 3-partition OPPM problem is to find all substrings in a text T that can be divided into three segments such that each partitioned segment is order-isomorphic to the corresponding segment of a pattern P. We propose an efficient algorithm to solve the problem in time, where and . We conduct experiments on various time series datasets, comparing the number of occurrences and the runtime efficiency among the OPPM, 2-partition OPPM, and proposed 3-partition OPPM algorithms. Our experimental evaluation shows that the proposed algorithm becomes increasingly cost-effective for longer patterns.
Keywords:
order-preserving pattern matching; approximate order-preserving pattern matching; order-preserving pattern matching with partition; string algorithms MSC:
68W32
1. Introduction
Order-preserving pattern matching (OPPM for short) compares the relative order of characters in strings. Two strings of equal length are said to be order-isomorphic if their relative order of the characters is identical at every position. For example, the strings and are order-isomorphic because their relative orders are the same as . However, X and are not order-isomorphic since their relative orders differ, vs. . Given a text T of length n and a pattern P of length m, the order-preserving pattern matching problem is to find all substrings of T that are order-isomorphic to P. See Figure 1 for an example. Numerous methods have been studied for time series data analysis [1,2,3], and recently, OPPM has also been applied to this field [4,5,6]. In refs. [4,7], algorithms based on the KMP algorithm [8] were proposed to solve the OPPM problem in time. In ref. [9], a heuristic method based on q-grams and the BMH algorithm [10] was presented. Although it runs in time in the worst case, it performs efficiently on average.
Figure 1.
Order-preserving pattern matching with and . The substring of T is order-isomorphic to P.
Meanwhile, due to mechanical failures of measuring devices, data can be lost or recorded inaccurately at certain time points. As a result, it may not be possible to accurately detect the desired patterns. For this reason, approximate OPPM has also been actively studied. In ref. [11], an OPPM problem allowing k errors was defined, and an algorithm was proposed to solve it in time. In ref. [12], the problem of OPPM with r indeterminate characters at each position in the pattern was defined and solved in time. In ref. [13], a scaled OPPM problem using cusps and runs was proposed and solved in time.
In ref. [14], the 2-partition OPPM problem was introduced, and an algorithm was proposed that solves it in time. Two strings are called 2-partition order-isomorphic if, when divided at the same position, each resulting substring pair is order-isomorphic. The 2-partition OPPM problem is to find all substrings in T that are 2-partition order-isomorphic to P. Despite being similar, as the length of strings increases, the probability that two strings are not order-isomorphic also increases. Therefore, incorporating 2-partition order-isomorphism can help identify more meaningful matches. Further partitioning increases the likelihood that each substring pair will be order-isomorphic. However, excessive partitioning can lead to a loss of semantic meaning in each substring. For example, for two strings of length m, if they are partitioned into m substrings of length one, every pair of substrings is always order-isomorphic trivially. Since strings of length one carry no meaningful information about trends, comparing relative orders becomes meaningless. Thus, it is necessary to extend 2-partition OPPM based on an appropriate number of partitioned substrings.
Our contributions are as follows:
- We define the 3-partition order-preserving pattern matching problem, in which strings are divided into three partitioned substring (called segment) pairs by two partition positions and checked for order-isomorphism. In this setting, the two partition positions can generate up to possible occurrences in the worst case, where n accounts for the total number of distinct starting positions of the substring in the text T. We observe that one of the partition positions can be represented as a range, which reduces the number of possible occurrences to and makes the problem substantially more tractable.
- We propose an efficient algorithm that solves the 3-partition OPPM problem in time and space. For two strings of the same length, the first segment’s left boundary and the last segment’s right boundary are anchored, enabling efficient order-isomorphism checking. However, the middle segment has neither boundary fixed, making it the main source of computational complexity. By analyzing the structural constraints of this middle segment, we develop a method that handles it efficiently and achieves the stated running time. When , the algorithm is optimal with respect to the maximum number of occurrences, since the maximum number of occurrences is .
- We demonstrate the effectiveness of our algorithm through comparative experiments. We compare the number of matches and the performance at runtime among three algorithms: the OPPM algorithm proposed in [4,7], the 2-partition OPPM algorithm from [14], and the 3-partition OPPM algorithm proposed in this paper, all tested on real time series data. Our experimental evaluation across multiple real-world datasets shows that the proposed 3-partition OPPM algorithm becomes increasingly cost-effective for longer patterns. For example, when the pattern length is 14 in the power consumption dataset, it finds approximately 500 and 18 times more occurrences than the original order-preserving and 2-partition algorithms, respectively, while requiring only 3 to 5 times more execution time.
2. Related Work
All strings used in this paper consist of characters whose order can be compared in constant time. For convenience, we assume that all characters in a string are distinct. The length of a string X is denoted by . The character at the i-th position in X is denoted by . The substring consisting of the characters through is written as . If , then is considered the empty string.
Two strings X and Y of the same length m are called order-isomorphic, written as , if the relative order of characters in X is exactly the same as in Y; that is,
We can use the natural representation or the nearest neighbor representation [4] to represent the order in a string. The natural representation of a string X, denoted , is defined such that = . For example, if , then . Two strings are order-isomorphic if and only if their natural representations are identical [4].
The nearest neighbor representation of a string X is defined using location tables and as follows [4,7]:
That is, denotes the position of the largest character less than in , and denotes the position of the smallest character greater than in . If no such character exists, the value is set to . For example, the nearest neighbor representation of the string is shown in Table 1. The location tables can be computed in time and space using an order-statistic tree [4].
Table 1.
Nearest neighbor representation of .
Given the location tables for X, whether two strings X and Y of the same length m are order-isomorphic can be determined in time by checking the following inequality at every position :
where, if or equals , the corresponding inequality is assumed to hold.
For two strings X and Y of length m and a position t with , X and Y are defined to be 2-partition order-isomorphic at t, denoted by , if both and . (In ref. [14], the terms partitioned order-isomorphism and partitioned order-preserving pattern matching were used specifically for 2-partition variants. To clearly distinguish them from the concepts studied in this paper, we slightly modify the terminology.) If we split a string into and , we refer to them as the first segment and the last segment, respectively. As an example, let 37, 40, 70, 54, 35) and . The natural representations of X and Y are and , and hence, they are not order-isomorphic as a whole. However, if we split X and Y at position , both segments become order-isomorphic, and therefore, X and Y are 2-partition order-isomorphic at . Similarly, they are 2-partition order-isomorphic at . A partition position t is called valid if .
The valid partition positions are consecutive, as in the example above, and thus, they can be expressed as a range. The following lemma provides the key to solving the problem by precisely identifying the minimum and maximum valid partition positions.
Lemma 1
([14]). For two strings X and Y of length m, let be the maximum index such that , and let be the minimum index such that . Then
- (i)
- The minimum valid partition position is , and the maximum is , and
- (ii)
- if and only if .
To provide a more accessible explanation of the concept of 2-partition order-isomorphism, ref. [14] introduced the notion of the longest order-isomorphic prefix (loip), which corresponds to the concept of the longest common prefix (lcp) in classical string matching. The loip is defined as the longest prefix of two strings that are order-isomorphic to each other. For example, the loip of and is the prefix of length 5 since , but X and Y are not isomorphic. Note that is the length of the loip of two strings X and Y, and can be obtained from the loip of the reversed strings of X and Y. The loip of two strings X and Y can be determined by incrementally checking the inequality (4) at successive positions until it no longer holds (Algorithm 1).
| Algorithm 1: Computing the length of loip |
![]() |
The 2-partition order-preserving pattern matching problem is defined as follows.
Problem 1.
2-Partition Order-Preserving Pattern Matching (OPPM) Problem
- Input: A text T and a pattern P .
- Output: All pairs such that .
For example, let and . Then the positions satisfying the 2-partition order-isomorphism are , , and .
To solve Problem 1 efficiently, Na et al. [14] proposed an improved algorithm for computing the length of the loip between every () and P. The algorithm exploits intermediate results obtained at the preceding position, allowing each subsequent computation to be updated incrementally rather than recomputed from scratch. To enable this incremental update, the algorithm makes use of the Z-function of P, where is defined as the length of the loip between the suffix and P. The Z-function can be computed in time and space once the location tables of P are available [15]. Using the location tables and the Z-function of P, the algorithm computes all loip values for the text in time and space. This incremental structure is conceptually similar to the Z-algorithm, which also achieves linear-time performance by maintaining a matching boundary [16].
Let and denote and for and P, respectively (see Table 2 for an example). Note that is the length of the loip of and P, so all ’s for can be computed in time. Similarly, we can compute all ’s in time using the reversed strings of T and P. Then, by Lemma 1, using and , we can obtain the valid partition positions t for each in constant time. Therefore, the 2-partition OPPM problem can be solved in time, where time is required for computing the location tables of P and its reversed string. Algorithm 2 outlines the algorithm for the 2-partition OPPM problem in [14].
| Algorithm 2: 2-Partition OPPM |
![]() |
Table 2.
The and tables for and .
3. The 3-Partition Order-Preserving Pattern Matching Problem
In this section, we extend 2-partition order-preserving pattern matching to 3-partition order-preserving pattern matching.
3.1. Problem Definition
For two strings X and Y of length m and a position pair with , we define X and Y to be 3-partition order-isomorphic at , denoted by , if , , and . If we split a string into , , and , we refer to them as the first segment, the middle segment, and the last segment, respectively. As an example, consider and . For , all three corresponding segments of X and Y are order-isomorphic, and thus, . Moreover, X and Y are also 3-partition order-isomorphic at , , and . A position pair is called valid if .
Similarly to the 2-partition order-isomorphism, a partition position in the 3-partition order-isomorphism can be expressed as a range. Consider and , which are 3-partition order-isomorphic at some position pairs. Let be a valid position pair. Then and should be 2-partition order-isomorphic. By Lemma 1, the second partition position can be expressed as a range including u. In the above example, the valid position pairs are , , and . Alternatively, for a fixed u, the first partition position t can be expressed as a range; for instance, and .
Now we formally define the 3-partition order-preserving pattern matching problem.
Problem 2.
3-Partition Order-Preserving Pattern Matching (OPPM) Problem
- Input: A text T and a pattern P
- Output: All tuples such that for every , where and .
For example, let the text and the pattern (see Figure 2).
Figure 2.
3-Partition OPPM with and .
- The substring is 3-partition order-isomorphic with P only at the position pair but not at any other pair. Consequently, the tuple is generated as an output.
- The substring is not 3-partition order-isomorphic with P at any position pair.
- The substring is 3-partition order-isomorphic with P only at the position pairs and . Since the first position of the pairs and are identical, only a single tuple is generated as an output.
- The substring is 3-partition order-isomorphic with P only at the position pairs and . Thus, the tuples and are generated as an output.
Consequently, the overall output consists of , , , and . Although we express the second partition position u as a range in the problem definition, we can express t as a range for a fixed u; for the example above, this yields , , , and .
3.2. -Time Algorithm
A straightforward method to solve the 3-partition OPPM problem is, for each substring and each t, to check and . This involves checking for order-isomorphism and 2-partition order-isomorphism, each of which can be carried out in time. Therefore, for all i and t, the total running time is , where the term is multiplied only by m, not by , because it results from preprocessing the pattern and is therefore independent of i.
We propose an algorithm that asymptotically improves the straightforward method above by exploiting the structural properties of the middle segments to perform order-isomorphism checks more efficiently. For each , the algorithm identifies valid partition positions under the order-isomorphism constraints. The order-isomorphism conditions for the first and last segments can be known from and . Recall that for and P is the maximum index such that , and for and P is the minimum index such that . The first segments and are order-isomorphic if and only if , and the last segments and are order-isomorphic if and only if . Consequently, it suffices to analyze the structures of the middle segments to determine all valid partitions.
We first identify the minimum starting position of the middle segments to find valid position pairs. (See Figure 3).
Figure 3.
Illustration of the notations used to characterize valid position pairs.
Lemma 2.
Let be the minimum index () such that . Then, there is no valid position pair such that .
Proof.
Suppose that there exists a valid pair such that . By the validity of the pair, we have . By the definition of , in order for the last segment to be order-isomorphic, that is, . Therefore, and are contained in and , respectively, and it follows that . However, this contradicts the definition of since . □
Now we identify the ending position u of the middle segments. Since we represent u with a range, we first consider the minimum position of u such that is valid. When , the following lemma holds.
Lemma 3.
For each t (), let be the minimum position of u such that is valid. Then .
Proof.
Due to the order-isomorphism of the last segments, u cannot be less than , and thus . Since for all by the definition of , the ending position of the middle segment can be , and thus, is . When , is t since . □
The remaining part is the maximum position of u such that is valid, which varies according to the value of t.
Lemma 4.
For each t (), let be the maximum position of u such that is valid. Then is equal to the maximum index u () such that . Furthermore, for .
Proof.
The first segments are order-isomorphic for , and the position u is the partition position of the 2-partition order-isomorphism for and . Therefore, by Lemma 1, is the maximum index u () such that , which corresponds to in Lemma 1.
Let denote . By the definition of , , which also means . Therefore, since is guaranteed to be at least , . □
By Lemmas 1–4, we obtain the following lemma on the valid position pairs.
Lemma 5.
A position pair is valid if and only if and , .
Proof.
Based on the isomorphism of the first segments and the definition of , t must satisfy . Additionally, by Lemma 2, t must satisfy . Therefore, a pair can be valid only if . Now, for every t such that , we consider the 2-partition OPPM of and . By Lemma 1, the two strings are 2-partition order-isomorphic at u if and only if . Lemmas 3 and 4 precisely identify and for each such t. Thus, the lemma holds. □
Algorithm 3 outlines our approach for the 3-partition OPPM problem. In the preprocessing step for P (lines 1–3), the algorithm computes the location tables and for every suffix () and for every reversed prefix, i.e., the reversed string of (). In the matching step, it computes () and () for all (line 4) and then determines the valid position pairs for each substring (lines 5–15). To this end, is determined first (lines 7–10) by finding the longest order-isomorphic prefix (loip) of the reversed strings of and , where the location tables for the reversed string of are used. Then, for each valid t from to , and are computed (lines 11–15). By Lemma 3, is simply (line 12).
| Algorithm 3: 3-Partition OPPM |
![]() |
We now describe how to compute for all valid t. Recall that is the maximum index u () such that . For each t from to , the algorithm incrementally checks whether , increasing u by one from the previous boundary (lines 13–14). In the special case where , the initial value of u is set to (line 7) since by the definition of . To determine whether at each iteration of the while loop, it suffices to check the inequality (4) only at the current position u, since is already guaranteed. When the while loop ends, is . The obtained u then serves as the starting position for the next t by Lemma 4. This incremental approach enables efficient computation of for all valid t, without rechecking previously validated substrings.
We illustrate the algorithm on the example and . As a preprocessing step, the values of and are computed for all suffixes of P, as shown in Table 3. For brevity, we omit the analogous construction for all reversed prefixes of P, which follows the same procedure.
Table 3.
Location tables and for all suffixes of .
Next, the and tables are constructed, as illustrated in Table 4.
Table 4.
The and tables for and .
Then, for to , we iteratively determine whether a match occurs. The detailed procedure is as follows.
- For with , we have and . We compute and obtain 4. Since , a match occurs at . Then we have and . Therefore, we record the match .
- For with , we have and . We compute and obtain 4. Since , no match occurs.
- For with , we have and . We compute and obtain 3. Since , a match occurs at . Then we have and . Therefore, we record the match .
- For with , we have and . We compute and obtain 2. Since , a match occurs at .
- -
- When , we have and . Therefore, we record the match .
- -
- When , we have . To efficiently compute the exact value of , we utilize the previously computed from the case of to reduce the number of iterations. Since inequality (4) does not hold when , we obtain . Therefore, we record the match .
Now, we analyze the time and space complexity of Algorithm 3. There are m suffixes and m prefixes of P, and the location tables for each suffix or reversed prefix can be computed in time and space, resulting in a total of time and space (lines 1–3). The tables and can be computed in time and space, as described in [14] (line 4). Now consider each iteration of the outer for loop over substring (lines 5–13). We can compute in time using the location tables for the reversed string of (lines 7–10). During the execution of the inner for loop (including the while loop), the value of u increases from to at most and never decreases. Hence, all valid position pairs for each can be computed in time, yielding an overall time complexity of for all substrings of T. The overall process, driven by the outer and inner loops, requires auxiliary space. Therefore, we obtain the following theorem.
Theorem 1.
Given a text T of length n and a pattern P of length m, the 3-partition order-preserving pattern matching problem can be solved in time and space.
Remark 1.
In 3-partition OPPM, it is necessary to check the order-isomorphism of middle segments. Since a middle segment can start at any position in P, location tables for all suffixes of P are required to efficiently check the middle segment order-isomorphism. Consequently, location tables are needed, incurring an time complexity. However, it is worth noting that if the characters of P can be sorted in linear time, the location table for each suffix of P can be constructed in time [7], allowing the problem to be solved in time.
4. Experimental Comparison
The experimental environment was as follows. The operating system was Windows 10 (64-bit), the CPU was an AMD Ryzen 9 5950X 16-Core, the RAM was 64 GB, and the development language was C++ using GCC 13.1.0. For the experiments, three types of time-series data were employed: Dow Jones Average index from 16 February 1885, to 24 September 2024 (DJA for short) [17], PM2.5 measurements from the U.S. Embassy in Beijing (PM for short) [18], and power consumption data of a household measured at 1-min intervals over four years (Volt for short) [19].
We conducted experiments on the three algorithms: the order-preserving pattern matching algorithm [4] (OPPM for short), the 2-partition order-preserving pattern matching algorithm [14] (OPPM_P2 for short), and the 3-partition order-preserving pattern matching algorithm (OPPM_P3 for short). The texts used in the experiments had lengths of 38,104 (DJA), 41,757 (PM), and 2,049,280 (Volt), and for each pattern length , 100 patterns were randomly extracted from the corresponding text. For each algorithm, we measured the occurrences and the execution time, and then calculated the average and the standard deviation. Occurrences were counted based on the starting position i of each substring that is 3-partition order isomorphic to P, regardless of the specific partition positions. (Note that occurrences can be viewed as candidates for potentially meaningful matches, although whether they are actually meaningful depends on the specific application context.) The execution time included both the preprocessing and matching steps, excluding I/O overhead for loading texts and patterns.
4.1. Overall Trends
Across all datasets (DJA, PM, and Volt), we observed the following consistent trends as the pattern length m increases.
First, the number of occurrences decreases exponentially (see Table 5). This trend is clearly visible in the log-scaled plots in Figure 4: when m grows from 6 to 14, the average counts drop by several orders of magnitude. This behavior is expected, since the probability of a random match decreases rapidly with longer patterns. The large standard deviations often observed in the results appear because the difference in the number of occurrences is extremely large depending on which pattern is randomly extracted from the text. For example, when performing OPPM on DJA with a pattern length of , the maximum number of occurrences for a randomly selected pattern was 52, but the minimum was 1—a significant difference compared to the average of 3.2. This disparity resulted in a considerably large standard deviation of 7.6.
Table 5.
Numbers of occurrences for DJA, PM, and Volt (average for 100 executions).
Figure 4.
Visualization of numbers of occurrences for DJA, PM, and Volt (average for 100 executions).
Second, the execution time generally decreases with increasing m, most noticeably for OPPM_P3 (see Table 6). For example, in DJA, the runtime of OPPM_P3 decreases from approximately 3455 s at to about 1362 s at , a reduction of more than . A similar trend is seen in Volt, where the runtime falls from 171,844 s to 75,970 s. Beyond , however, the execution time becomes largely stable, showing only minor fluctuations despite further increases in m. The execution time of OPPM also decreases, although it appears nearly flat in Figure 5.
Table 6.
Execution times for DJA, PM, and Volt (average for 100 executions, microseconds).
Figure 5.
Visualization of execution times for DJA, PM, and Volt (average for 100 executions, microseconds).
Third, Table 7, which reports execution time per occurrence, shows that the normalized time generally increases as the pattern length m grows. This trend arises because the number of occurrences decreases much faster than the execution time, as seen in Table 5 and Table 6. When the number of occurrences approaches 1, the normalized time stabilizes and remains nearly constant. This stabilizing behavior is more clearly observed in OPPM, as seen in Figure 6, where the number of occurrences decreases rapidly towards 1. However, this stabilization point varies among datasets and algorithms; for instance, OPPM_P3 may not clearly exhibit this stabilizing behavior even up to because the number of occurrences continues to decrease as m increases.
Table 7.
Execution times per occurrences for DJA, PM, and Volt (average for 100 executions, microseconds).
Figure 6.
Visualization of execution times per occurrences for DJA, PM, and Volt (average for 100 executions, microseconds).
Overall, these results suggest that moderately longer patterns, while occurring far less frequently, also reduce the computational overhead of more complex partition-based strategies.
4.2. Algorithm Characteristics
Each algorithm exhibits distinct characteristics with respect to both the number of occurrences and the execution time.
OPPM consistently generates the fewest occurrences across all datasets, approaching 1 when . This conservative behavior results in the fastest execution times, typically only a few hundred microseconds for DJA and PM and around 15 ms for Volt, regardless of m. However, due to the small number of occurrences, the time per occurrence can be relatively high compared to algorithms that find more occurrences. These results show that OPPM provides a natural lower bound in both computational cost and the ability to capture meaningful occurrences.
OPPM_P2 produces far more occurrences than OPPM, often by one to two orders of magnitude at small m (e.g., to 10). However, as m increases, the gap between OPPM_P2 and OPPM narrows quickly, reducing the advantage of the partitioning strategy. Its execution time is roughly times that of OPPM, providing a middle ground between computational cost and the ability to capture meaningful occurrences. When normalized by the number of occurrences, OPPM_P2 often exhibits lower time per occurrence than OPPM, indicating that its higher total cost is efficiently amortized across the substantially larger set of occurrences.
OPPM_P3 always yields the highest number of occurrences, sometimes exceeding OPPM_P2 by more than an order of magnitude. Although it is the slowest algorithm, its execution time decreases sharply for small to moderate pattern lengths (e.g., to 10) and remains relatively stable for larger m. Moreover, when normalized by the number of occurrences, OPPM_P3 remains relatively efficient per occurrence, except for very long patterns where the number of occurrences is close to 1. This makes OPPM_P3 especially effective for moderately long patterns: it captures more meaningful occurrences.
4.3. Experimental Conclusion
The combined evidence from DJA, PM, and Volt shows that increasing m leads to both fewer matches and reduced execution times. OPPM remains the most time efficient algorithm in absolute terms, but its number of occurrences is minimal. OPPM_P2 provides a practical compromise, substantially finding more occurrences while incurring only moderate cost. OPPM_P3, although computationally demanding at small m, becomes significantly more cost-effective for larger m, achieving a greater ability to find meaningful occurrences with reduced relative overhead.
When the goal is to highlight algorithmic performance differences, short patterns (e.g., or 8) clearly demonstrate the efficiency advantage of OPPM and the balanced behavior of OPPM_P2, while longer patterns highlight the strengths of OPPM_P3. In practical applications, the choice of algorithm should depend on priorities: use OPPM when speed is critical for short patterns; OPPM_P2 when both speed and a higher number of occurrences are important; and OPPM_P3 when longer runtime is acceptable in exchange for discovering as many meaningful candidates as possible.
5. Conclusions
In this paper, we defined the 3-partition OPPM problem as an extension of the 2-partition OPPM problem and proposed a cost-effective algorithm to solve it. Although the proposed algorithm exhibits higher theoretical and empirical runtime than the OPPM and 2-partition OPPM algorithms, it also produces substantially more occurrences. Moreover, the algorithm demonstrates a clear advantage in identifying similar patterns, particularly in cases where the probability of exact matches decreases sharply as the pattern length increases. This highlights the practical value of allowing multiple partitions to capture approximate structural similarities in time-series data.
Note that excessive partitioning can lead to an increase in computational complexity, although increasing the number of partitions may improve the likelihood of finding matches. Therefore, further research is needed to determine the appropriate number of partitions based on the characteristics of specific time-series domains.
Author Contributions
Conceptualization, J.C.N., S.K., and J.S.S.; methodology, J.C.N.; software, S.K.; validation, S.K. and J.S.S.; formal analysis, J.C.N. and J.S.S.; writing—original draft preparation, J.C.N. and S.K.; writing—review and editing, J.C.N. and J.S.S.; visualization, S.K. All authors have read and agreed to the published version of the manuscript.
Funding
This work was supported by the Institute of Information and Communications Technology Planning and Evaluation (IITP) grant funded by the Korean Government (MSIT) (No. RS-2022-00155915, Artificial Intelligence Convergence Innovation Human Resources Development (Inha University)) and by the INHA UNIVERSITY Research Grant.
Data Availability Statement
Data are contained within the article.
Conflicts of Interest
The authors declare no conflicts of interest.
Abbreviations
The following abbreviations are used in this manuscript:
| OPPM | order-preserving pattern matching |
| OPPM_P2 | 2-partition order-preserving pattern matching |
| OPPM_P3 | 3-partition order-preserving pattern matching |
| KMP | Knuth–Morris–Pratt |
| BMH | Boyer-Moore-Horspool |
| lcp | longest common prefix |
| loip | longest order-isomorphic prefix |
| DJA | Dow Jones Average index |
| PM | PM2.5 measurements |
| Volt | Power consumption data |
References
- Cryer, J.D. Time Series Analysis; Duxbury Press: Boston, MA, USA, 1986. [Google Scholar]
- Kirchgässner, G.; Wolters, J.; Hassler, U. Introduction to Modern Time Series Analysis; Springer Science & Business Media: Berlin/Heidelberg, Germany, 2012. [Google Scholar]
- Hamilton, J.D. Time Series Analysis; Princeton University Press: Princeton, NJ, USA, 2020. [Google Scholar]
- Kim, J.; Eades, P.; Fleischer, R.; Hong, S.-H.; Iliopoulos, C.S.; Park, K.; Puglisi, S.J.; Tokuyama, T. Order-preserving matching. Theor. Comput. Sci. 2014, 525, 68–79. [Google Scholar] [CrossRef] [Scilit]
- Wu, Y.; Hu, Q.; Li, Y.; Guo, L.; Zhu, X.; Wu, X. OPP-Miner: Order-Preserving Sequential Pattern Mining for Time Series. IEEE Trans. Cybern. 2023, 53, 3288–3300. [Google Scholar] [CrossRef] [Scilit] [PubMed]
- Bach, E.; Szedmak, S.; Brouard, C.; Böcker, S.; Rousu, J. Liquid-Chromatography Retention Order Prediction for Metabolite Identification. Bioinformatics 2018, 34, i875–i883. [Google Scholar] [CrossRef] [Scilit] [PubMed]
- Kubica, M.; Kulczyński, T.; Radoszewski, J.; Rytter, W.; Waleń, T. A linear time algorithm for consecutive permutation pattern matching. Inf. Process. Lett. 2013, 113, 430–433. [Google Scholar] [CrossRef] [Scilit]
- Knuth, D.E.; Morris, J.H.; Pratt, V.R. Fast Pattern Matching in Strings. SIAM J. Comput. 1977, 6, 323–350. [Google Scholar] [CrossRef] [Scilit]
- Cho, S.; Na, J.C.; Park, K.; Sim, J.S. A fast algorithm for order-preserving pattern matching. Inf. Process. Lett. 2015, 115, 397–402. [Google Scholar] [CrossRef] [Scilit]
- Horspool, R.N. Practical fast searching in strings. Softw. Pract. Exp. 1980, 10, 501–506. [Google Scholar] [CrossRef] [Scilit]
- Gawrychowski, P.; Uznanski, P. Order-preserving pattern matching with k mismatches. Theor. Comput. Sci. 2016, 638, 136–144. [Google Scholar] [CrossRef] [Scilit]
- Russo, L.M.S.; Costa, D.; Henriques, R.; Bannai, H.; Francisco, A.P. Order-preserving pattern matching on indeterminate strings. Inf. Comput. 2022, 289, 104996. [Google Scholar] [CrossRef] [Scilit]
- Kim, Y.; Kang, M.; Na, J.C.; Sim, J.S. Order-preserving pattern matching with scaling. Inf. Process. Lett. 2023, 180, 106349. [Google Scholar] [CrossRef] [Scilit]
- Na, J.C.; Kim, Y.; Kang, S.; Sim, J.S. Order-Preserving Pattern Matching with Partition. Mathematics 2024, 12, 3381. [Google Scholar] [CrossRef] [Scilit]
- Hasan, M.M.; Islam, A.S.M.S.; Rahman, M.S.; Rahman, M.S. Order preserving pattern matching revisited. Pattern Recognit. Lett. 2015, 55, 15–21. [Google Scholar] [CrossRef] [Scilit]
- Gusfield, D. Algorithms on Strings, Trees, and Sequences—Computer Science and Computational Biology; Cambridge University Press: Cambridge, UK, 1997. [Google Scholar]
- Williamson, S. Daily Closing Values of the DJA in the United States, 1885 to Present, MeasuringWorth. 2021. Available online: https://www.measuringworth.com/datasets/DJA/index.php (accessed on 26 September 2024).
- Chen, S.X. Beijing PM2.5 Data Set. 2017. Available online: https://archive.ics.uci.edu/dataset/381 (accessed on 26 September 2024).
- Hebrail, G.; Berard, A. Individual Household Electric Power Consumption Data Set. 2012. Available online: https://archive.ics.uci.edu/dataset/235 (accessed on 26 September 2024).
Disclaimer/Publisher’s Note: The statements, opinions and data contained in all publications are solely those of the individual author(s) and contributor(s) and not of MDPI and/or the editor(s). MDPI and/or the editor(s) disclaim responsibility for any injury to people or property resulting from any ideas, methods, instructions or products referred to in the content. |
© 2025 by the authors. Licensee MDPI, Basel, Switzerland. This article is an open access article distributed under the terms and conditions of the Creative Commons Attribution (CC BY) license.








