Next Article in Journal
Prediction of Phytochemical Constituents in Cayenne Pepper Using MIR and NIR Spectroscopy
Next Article in Special Issue
Web Interface of NER and RE with BERT for Biomedical Text Mining
Previous Article in Journal
Response of Guobu Slope Displacement to Rainfall and Reservoir Water Level with Time-Series InSAR and Wavelet Analysis
Previous Article in Special Issue
RNA Sequences-Based Diagnosis of Parkinson’s Disease Using Various Feature Selection Methods and Machine Learning
 
 
Font Type:
Arial Georgia Verdana
Font Size:
Aa Aa Aa
Line Spacing:
Column Width:
Background:
Article

Order-Preserving Multiple Pattern Matching in Parallel

1
Department of Computer Engineering, Inha University, Incheon 22212, Republic of Korea
2
System Team, Mobile Experience, Samsung Electronics Co., Ltd., Suwon 16677, Republic of Korea
*
Author to whom correspondence should be addressed.
Appl. Sci. 2023, 13(8), 5142; https://doi.org/10.3390/app13085142
Submission received: 9 March 2023 / Revised: 30 March 2023 / Accepted: 18 April 2023 / Published: 20 April 2023
(This article belongs to the Special Issue Applications of Artificial Intelligence in Biomedical Data Analysis)

Abstract

:
The order-preserving multiple pattern matching problem is to find all substrings of T whose relative orders are the same for any pattern in a set of patterns. Various sequential algorithms have been studied for the order-preserving multiple pattern matching problems. In this paper, we propose two parallel algorithms, each of which uses Aho–Corasick automata and fingerprint tables, respectively. We also present experimental results of comparing the execution times of each parallel algorithm on various types of time-series data.

1. Introduction

Two strings x , y ( | x | = | y | ) from an integer alphabet are order-isomorphic if the relative orders of characters are the same. For example, given two strings x = ( 17 , 30 , 10 ) and y = ( 4 , 9 , 1 ) , they are order-isomorphic because their relative orders of characters are the same as ( 2 , 3 , 1 ) . Given text T ( | T | = n ) and pattern P ( | P | = m ) , finding all substrings of T, which are order-isomorphic to P, is called the order-preserving pattern matching (OPPM for short) problem [1,2,3,4,5]. Given text T ( | T | = n ) and a set of patterns P = P 1 , , P k , the order-preserving multiple pattern matching (OPMPM for short) problem is to find all substrings of T that are order-isomorphic to any P a ( 1 a k ) in P [1,2,3,4,5]. The order-preserving pattern matching problem and order-preserving multiple pattern matching problem can be used to analyze various time-series data such as stock price indices, music melodies, and biomedical data [1,2,3,4,5].
Most existing OPMPM algorithms are performed in two phases: a preprocessing phase and a search phase. Let m, m ¯ , and M denote the shortest pattern length, the longest pattern length, and the sum of the lengths of all patterns in P , respectively. Kim et al. [1] proposed an algorithm that performs the preprocessing phase in O ( M log m ¯ ) time and the search phase in O ( n log m ¯ ) time using Aho–Corasick automata [6]. Han et al. [7] proposed two algorithms for the order-preserving multiple pattern matching problem. In the first algorithm, the preprocessing and search phases run in O ( k m q + M log m ¯ ) time and O ( ( n / m ) log M ) time, on average, and in the second algorithm, the preprocessing and search phases run in O ( M log m ¯ ) time and O ( n ) time, on average. Park et al. [8] proposed an algorithm that improved the space complexity of the first algorithm proposed in [7] from O ( q ! + k + M ) to O ( k + M ) using fingerprint tables. Park et al. [9] parallelized the second algorithm proposed in [7]. The preprocessing phase runs in O ( m ¯ ) time using O ( M ) threads and the search phase runs in O ( m ) time, on average, using O ( n ) threads in [9].
In this paper, we present two parallel algorithms for the OPMPM problem. First, we parallelize the algorithm proposed in [1]. The preprocessing phase of the first algorithm runs in O ( m ¯ ) time using O ( M ) threads and the search phase runs in O ( m ¯ log m ¯ ) time using O ( n / m ¯ ) threads. Second, we parallelize the algorithm proposed in [8]. The preprocessing phase of the second algorithm runs in O ( m ¯ ) time using O ( M ) threads and the search phase runs in O ( M ) time using O ( n ) threads. Then, we present experimental results that compare the execution times of each parallel algorithm for various types of time-series data. The experimental results showed that for randomly generated strings, when n = 100,000, m = 9 , and k = 100 , the execution time of the first parallel algorithm was approximately 2.12 times faster than the sequential algorithm, and the second parallel algorithm was approximately 1.6 times faster than the sequential algorithm. For all time-series data used in our experiments, the execution time of our second parallel algorithm was comparable to that of a fast parallel algorithm proposed in [9].
This paper is organized as follows. In Section 2, we introduce the definitions of terms and related studies. In Section 3, we explain our parallel algorithms for the OPMPM problem. In Section 4, the execution times of parallel algorithms are compared through experiments. In Section 5, we conclude.

2. Related Works

Given string x, the length of x is denoted by x and the i-th character of x ( 1 i | x | ) is denoted by x [ i ] . The substring from x [ i ] to x [ j ] is denoted by x [ i . . j ]   ( 1 i j | x | ) . x [ 1 . . i ] is called a prefix of x and x [ i . . | x | ] is called a suffix of x for 1 i | x | . For convenience, we assume that all the characters in the string are different. Given two strings x , y ( | x | = | y | ) , if x [ i ] < x [ j ] y [ i ] < y [ j ] ( 1 i , j | x | ) is satisfied, and x and y are order-isomorphic and denoted by x y [1,4,10].
Let x be the string constructed by sorting all the characters of x in ascending order. Then, the position table P O S x of x is defined as follows:
P O S x [ i ] = j ( x [ i ] = x [ j ] , 1 i | x | ) .
That is, P O S x [ i ] is the index of the i-th smallest character in x. Given two strings x , y ( | x | = | y | ) , for all i ( 1 i < n ) , if y [ P O S x [ i ] ] y [ P O S x [ i + 1 ] ] is satisfied, x y [8]. A prefix table μ x of string x is defined as follows:
μ x [ i ] = | { j : x [ j ] < x [ i ] , 1 j < i } | + 1 .
That is, μ x [ i ] represents the number of characters that are smaller than x [ i ] in x [ 1 . . i ] . If the prefix tables of two strings x and y are the same, that is, μ x = μ y , x y [1]. Note that when there exist the same characters in the given string, order-isomorphism can still be determined using the extended prefix representation proposed in [2]. Table 1 presents the prefix table μ x and position table P O S x when x = ( 23 , 29 , 20 , 57 , 59 ) .
In [7], an OPMPM algorithm was proposed using fingerprints of q-grams. The fingerprint converts a q-gram (a string of length q) into an integer within the range of [ 1 , q ! ] using the factorial number system [11,12]. The fingerprints are used to find candidate substrings of text T that may be order-isomorphic to pattern P. Given a q-gram x, fingerprint f ( x ) is defined as follows [3,7]:
f ( x ) = k = 1 q [ ( μ x [ k ] 1 ) × ( k 1 ) ! ] + 1 .
For example, if q-gram x = ( 8 , 10 , 6 ) , f ( x ) = 2 .
In [1], the Aho–Corasick automaton [6] is used to solve the order-preserving multiple pattern matching problem. In the preprocessing phase, the Aho–Corasick automaton is created in O ( M log m ¯ ) time using a set of prefix tables of patterns. In each Step i ( 1 i n ) of the search phase, the state for T [ i ] is computed and P a ( 1 a k ) is searched in the automaton using the transition function, the failure function, and the output function of the automaton. Figure 1 shows the Aho–Corasick automaton when P 1 = ( 17 , 25 , 15 , 30 ) , P 2 = ( 30 , 44 , 25 , 40 ) , and P 3 = ( 40 , 50 , 61 ) .
Let P a ˜ ( 1 a k ) be the prefix of length m for each pattern P a and let P ˜ = P 1 ˜ , P 2 ˜ , , P k ˜ . Park et al. [8] proposed an OPMPM algorithm that generates the position table P O S P a for each P a ( 1 a k ) and the fingerprint table F P a that stores the rightmost q-gram’s fingerprint of P a ˜ ( 1 a k ) in the preprocessing phase, to find candidate patterns that may be order-isomorphic to substrings of T. In the search phase, all substrings of T, which are order-isomorphic to any P a ( 1 a k ) , are searched using F P a and P O S P a .

3. Parallel Algorithms for the OPMPM Problem

In this section, we propose two parallel algorithms for the OPMPM problem. The first algorithm uses the Aho–Corasick automaton, while the second algorithm utilizes the position tables and fingerprint tables.

3.1. Parallel OPMPM Algorithm Using the Aho–Corasick Automaton

Our parallel algorithm for the OPMPM problem using the Aho–Corasick automaton consists of the following steps: In the preprocessing phase, we create prefix tables using O ( M ) threads in O ( m ¯ ) time. That is, the prefix table of each pattern is calculated in parallel by assigning | P a | threads for each pattern P a ( 1 a k ) . In the prefix table μ P a of pattern P a , each thread t ( 1 t | P a | ) linearly searches P a [ 1 . . t 1 ] to calculate μ P a [ t ] . See Algorithm 1. Thus, a set of prefix tables for all patterns can be calculated in O ( m ¯ ) time using O ( M ) threads. To create an automaton using μ P a , the existing algorithm [1] method is employed.
Algorithm 1 Preprocessing phase (parallel calculation of prefix tables for a pattern set).
Input: A set of strings P 1 , P 2 , , P k
Output: A set of prefix tables μ P 1 , μ P 2 , , μ P k
1 parallel for a 1 to k do
2        parallel for t 1 to | P a | do
3                μ P a [ t ] 1
4                for i 1 to t 1 do
5                                if P a [ i ] < P a [ t ] then
6                                   μ P a [ t ] μ P a [ t ] + 1
In the search phase, T is divided into b blocks and each block is searched in parallel using b threads (Figure 2). Thread t ( 1 t b ) searches each block of T for the location of the substring that is order-isomorphic to P a using the automaton created in the preprocessing phase. See Algorithm 2. Since the substring of T that is order-isomorphic to P a can occur across two adjacent blocks, all threads except the last one set the block size to n / b + m ¯ 1 (Figure 2). Since the insertion, deletion, and rank calculation operations in the order-statistics tree require O ( log m ¯ ) time during the search phase, they are conducted in O ( ( n / b + m ¯ ) log m ¯ ) time. If we set b = n / m ¯ , the search phase can be conducted in O ( m ¯ log m ¯ ) time. Thus, this parallel algorithm can be solved as an OPMPM problem in O ( M + m ¯ log m ¯ ) time using O ( m a x ( M , n / m ¯ ) ) threads.
Algorithm 2 Search phase.
Input: Aho–Corasick automaton, string T
Output: Positions i of substrings of T which is order-isomorphic to P a
1 q s q 0 , OST τ , int r
2 parallel for t 1 to b do
3        for i 1 to n / b + m ¯ 1 do
4                 if ( t 1 ) n / b + i > n then
5                         break
6                  τ .insert ( T [ ( t 1 ) n / b + i ) ] )
7                  r τ .rank ( T [ ( t 1 ) n / b + i ] )
8                 while g ( q s , r ) = f a i l
9                          τ .delete ( T [ i d ( q s ) . . i d ( π ( q s ) ) 1 ] )
10                          q s π ( q s )
11                          r τ .rank ( T [ ( t 1 ) n / b + i ] )
12                  q s g ( q s , r )
13                 if P a o u t ( q s ) and i | P a | + 1 t n / b then
14                           print ( i | P a | + 1 , a )

3.2. Parallel OPMPM Algorithm Using the Fingerprint Table

The algorithm that solves the OPMPM problem using a fingerprint table in parallel is as follows: In the preprocessing phase, position table P O S P a and fingerprint table F P a are created in parallel for each pattern of P a ( 1 a k ) . The P O S P a calculation is performed in parallel using | P a | threads. Each thread t ( 1 t | P a | ) linearly searches P a to calculate the order r of P a [ t ] . By the definition of P O S P a , it satisfies P O S P a [ r ] = t , and the position tables for all patterns can be calculated in parallel in O ( m ¯ ) time using O ( M ) threads. F P a is created in parallel using q threads (Algorithm 3). Each thread t ( 1 t q ) calculates the fingerprint of P a ˜ [ m q + 1 . . m ] in parallel. Here, atomic operations are used to prevent multiple threads from accessing F P a concurrently (Line 8 in Algorithm 3). Thus, the fingerprint table can be calculated in O ( q ) time using O ( k q ) threads, and the preprocessing phase is conducted in O ( m ¯ ) time using O ( M ) threads.
In the search phase, all substrings of T are checked in parallel using n m + 1 threads (Algorithm 4). Each thread i ( 1 i n m + 1 ) first calculates f ( T [ i + m q . . i + m 1 ] ) . f ( T [ i + m q . . i + m 1 ] ) and each of F P a ( 1 a k ) are sequentially compared, and if they are the same, it is verified whether P a and T [ i . . i + P a 1 ] are order-isomorphic using P O S P a (from Lines 2 to 5 in Algorithm 4) [13]. If P a T [ i . . i + P a 1 ] , then ( i , a ) is printed. In the worst case, it verifies whether all substrings of T are order-isomorphic to all patterns. Thus, the search phase can be performed in O ( M ) time using O ( n ) threads. This parallel algorithm can be solved as an OPMPM problem in O ( m ¯ + M ) time using O ( m a x ( M , n ) ) threads.
Algorithm 3 Parallel calculation of the fingerprint table. F P
Input: A set of strings P 1 , P 2 , , P k , int m, int q
Output: F P 1 , F P 2 , , F P k
1 parallel for a 1 to k do
2        parallel for t 1 to q do
3                 F P a 1
4                 c 0
5                for i 1 to t 1 do
6                        if P a [ m q + i ] < P a [ m q + t ] then
7                                  c c + 1
8                atomicAdd ( F P a F P a + c × ( t 1 ) ! )
Algorithm 4 The search phase of the algorithm using a fingerprint table.
Input: A string T , F P 1 , F P 2 , , F P k , int m
Output: Positions i of substrings of T which is order-isomorphic to P a
1 parallel for i 1 to n m + 1 do
2        for a 1 to k do
3                if f ( T [ i + m q . . i + m 1 ] ) = F P a then
4                         if P a T [ i . . i + P a 1 ] then
5                                  print ( i , a )

4. Experimental Results

The experiment was conducted on the following environment: Windows 10 (64-bit) operating system, AMD Ryzen9 3950X CPU, 64 GB RAM, NVIDIA GeForce RTX 3080 Ti GPU, C++ and CUDA programming language, and Visual Studio 2019 (CUDA SDK 11.0).
The algorithms experimented with in the present paper are denoted as follows: The OPMPM algorithm using the Aho–Corasick automaton proposed in [1] is denoted by A C , and the OPMPM algorithm using the fingerprint table proposed in [8] is denoted by F T . The parallel OPMPM algorithm proposed in [9] is denoted by p K R , the parallel OPMPM algorithm using the Aho–Corasick automaton proposed in this paper is denoted by p A C , and the parallel OPMPM algorithm using the fingerprint table is denoted by p F T , respectively.
The data used in the experiment are randomly generated strings and two types of time-series data: the Dow Jones Index and electrocardiogram data.
  • Randomly generated strings: Texts and patterns consisting of = 1 , 2 , , 2 30 were randomly generated. Text T was generated by increasing length n from 10,000 by 10,000 to 100,000. A set of patterns P was generated by increasing the number of patterns k from 100 by 100 to 1000 and increasing the pattern length m from 5 by 1 to 15.
  • Dow Jones Index: Texts and patterns were extracted at random for each experiment from the daily closing price of the Dow Jones Industrial Average between 2 May 1885 and 12 April 2019 [14]. The text length n was increased from 1000 by 1000 to 10,000. The number of patterns k and their length m were set to the same values used for the randomly generated strings.
  • Electrocardiogram data: The electrocardiogram (ECG) data used in the experiment were obtained from the MIT-BIH ECG biosignal database provided by Physionet [15]. An electrocardiogram records the electrical impulses from the heart. Texts were randomly extracted from the total records, while patterns were extracted evenly from abnormal symptom data and normal data. It should be noted that the texts and patterns were extracted from electrocardiogram data of different individuals. The text length n and the number of patterns k were set equal to those of the randomly generated strings, and the pattern length m increased from 10 by 1 to 15 during the generation process.
The parameter setup of the algorithm and measurement of execution time were conducted as follows: In F T and p F T , q was set to 5. In each of the parallel algorithms, p A C employed 1000 threads, and p K R and p F T employed n threads. The execution time of each algorithm was the mean of 100 execution times, which was measured in milliseconds (ms) and rounded to three decimal places. The execution time of parallel algorithms includes the execution time of the cudaMemcpy() function that copies data between host memory and device (GPU) memory.
Experiment (1). Comparison of execution times of A C and p A C , and F T and p F T for randomly generated strings: Figure 3 shows the execution times of A C and p A C for randomly generated strings according to n when m = 9 and k = 100 . When n = 10,000, p A C was slower than A C due to the additional execution time required by the cudaMemcpy() function in p A C . Most of the execution time for p A C was spent on the cudaMemcpy() function. However, for n 20,000, p A C performed faster than A C . When n = 100,000, m = 9 , and k = 100 , the execution time of A C was around 41.22 ms and that of p A C was around 19.49 ms, indicating that p A C was approximately 2.12 times faster than A C . The execution time of p A C increased as n increased due to the limitation of the number of available GPU cores. Figure 4 shows the execution times of A C and p A C for randomly generated strings according to k when n = 100,000 and m = 9 . In this case, p A C was faster than A C in all cases.
Figure 5 shows the execution times of F T and p F T for randomly generated strings according to n when m = 9 and k = 100 . p F T was faster than F T in all cases. For instance, when n = 100,000, m = 9 , and k = 100 , the execution time of F T was around 8.6 ms, while that of p F T was around 5.39 ms, indicating that p F T was approximately 1.6 times faster than F T . However, as with p A C , the execution time of p F T also increased as n increased due to the limitation of the number of available GPU cores. Figure 6 shows the execution times of F T and p F T for randomly generated strings according to k when n = 100,000 and m = 9 . In this case, as in the previous case, p F T was faster than F T in all cases.
Experiment (2). Comparison of execution times of p K R , p A C , and p F T for randomly generated strings: Table 2 presents the execution times of p K R , p A C , and p F T for randomly generated strings with varying parameter settings. In all cases, p K R and p F T performed faster than p A C , and p K R and p F T exhibited comparable execution times. When n = 100,000, m = 9 , and k = 1000 , the execution times of p K R and p F T were approximately 1.98 and 2.03 times faster, respectively, than those of pAC.
Table 2a presents the execution times of p K R , p A C , and p F T according to m when n = 100,000 and k = 1000 . As the length of patterns m increased, the creation time of the Aho–Corasick automaton increased, leading to an increase in the total execution time of p A C . The length of patterns m did not significantly affect the execution times of p F T and p K R . Table 2b presents the execution times of p K R , p A C , and p F T according to k when n = 100,000 and m = 9 . The execution times of all algorithms increased as k increased.
Experiment (3). Comparison of execution times of p K R , p A C , and p F T for Dow Jones Index data: Table 3 presents the execution times of p K R , p A C , and p F T according to the parameters for Dow Jones Index data. In all conditions, p K R and p F T performed faster than p A C , and p K R and p F T exhibited comparable execution times. When n = 10,000, m = 9 , and k = 1000 , the execution times of p K R and p F T were around 5.61 times and 5.71 times faster than that of p A C . Overall, it showed a similar trend to that of Experiment 2.
Experiment (4). Comparison of execution times of p K R , p A C , and p F T for ECG data: Table 4 presents the execution times of p K R , p A C , and p F T according to the parameters for electrocardiogram data. In all cases, p K R and p F T performed faster than p A C , and p K R and p F T exhibited comparable execution times. When n = 100,000, m = 10 , and k = 1000 , the execution times of p K R and p F T were around 2.13 times and 2.16 times faster than that of p A C . Overall, it showed a similar result to that of Experiments 2 and 3.

5. Conclusions

In this paper, a parallel OPMPM algorithm using the Aho–Corasick automaton and a parallel OPMPM algorithm using a fingerprint table were proposed. In addition, comparison experiments were conducted for randomly generated strings, Dow Jones Index data, and electrocardiogram data to evaluate the performance of the proposed parallel algorithms. The experimental results showed that the execution times of the algorithms had a similar trend regardless of the data type when data-related parameters such as the length of the text, lengths of the patterns, and the number of patterns, as well as algorithm-related parameters such as the q-gram length, were kept the same. This suggests that the performance of the algorithms is dependent on these parameters rather than the specific characteristics of the data type. The performance of the verification of order-isomorphism may vary depending on the order representation method of strings used [16]. Therefore, further studies are necessary to compare the execution times and number of verifications required for different-order representation methods.

Author Contributions

S.P. and J.P. designed and analyzed the algorithms. S.P. implemented and experimented with the algorithms, and wrote the draft of the paper. Y.K. and J.S.S. reviewed and revised the paper. J.S.S. analyzed the algorithm, provided algorithmic support, and was the project manager. All authors have read and agreed to the published version of the manuscript.

Funding

This work was supported by Institute of Information & Communications Technology Planning & Evaluation (IITP) grant funded by the Korea government (MSIT) (No. RS-2022-00155915, Artificial Intelligence Convergence Innovation Human Resources Development (Inha University)), and by INHA UNIVERSITY Research Grant.

Institutional Review Board Statement

Not applicable.

Informed Consent Statement

Not applicable.

Data Availability Statement

Data are contained within the article.

Conflicts of Interest

The authors declare they have no conflicts of interest.

References

  1. 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]
  2. Kim, J.; Amir, A.; Na, J.C.; Park, K.; Sim, J.S. On representations of ternary order relations in numeric strings. Math. Comput. Sci. 2017, 11, 127–136. [Google Scholar] [CrossRef]
  3. 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]
  4. Kim, Y.; Kim, Y.; Sim, J.S. An improved order-preserving pattern matching algorithm using fingerprints. Mathematics 2022, 10, 1954. [Google Scholar] [CrossRef]
  5. Na, J.C.; Lee, I. A simple heuristic for order-preserving matching. IEICE Trans. Inf. Syst. 2019, 102, 502–504. [Google Scholar] [CrossRef]
  6. Aho, A.V.; Corasick, M.J. Efficient string matching: An aid to bibliographic search. Commun. ACM 1975, 18, 333–340. [Google Scholar] [CrossRef]
  7. Han, M.; Kang, M.; Cho, S.; Gu, G.; Sim, J.S.; Park, K. Fast multiple order-preserving matching algorithms. In Proceedings of the International Workshop on Combinatorial Algorithms, Verona, Italy, 5–7 October 2015; pp. 248–259. [Google Scholar]
  8. Park, J.; Kim, Y.; Sim, J.S. A space-efficient hashing-based algorithm for order-preserving multiple pattern matching problem. KIISE Trans. Comput. Pract. 2018, 24, 399–404. [Google Scholar] [CrossRef]
  9. Park, K.B.; Kim, Y.; Sim, J.S. Parallel implementation of the order-preserving multiple pattern matching algorithm using the Karp-Rabin algorithm. J. KIISE 2021, 48, 249–256. [Google Scholar] [CrossRef]
  10. 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]
  11. Knuth, D. The Art of Computer Programming, Seminumerical Algorithms; Addison-Wesley: Boston, MA, USA, 1997; Volume 2. [Google Scholar]
  12. Mareš, M.; Straka, M. Linear-time ranking of permutations. In Proceedings of the Algorithms–ESA 2007: 15th Annual European Symposium, Eilat, Israel, 8–10 October 2007; pp. 187–193. [Google Scholar]
  13. Chhabra, T.; Tarhio, J. A filtration method for order-preserving matching. Inf. Process. Lett. 2016, 116, 71–74. [Google Scholar] [CrossRef]
  14. Williamson, S. Daily Closing Values of the DJA in the United States, 1885 to Present, Measuring Worth. Available online: https://www.measuringworth.com/datasets/DJA/index.php (accessed on 17 December 2021).
  15. Goldberger, A.L.; Amaral, L.A.N.; Glass, L.; Hausdorff, J.M.; Ivanov, P.C.; Mark, R.G.; Mietus, J.E.; Moody, G.B.; Peng, C.K.; Stanley, H.E. Physiobank, physiotoolkit, and physionet: Components of a new research resource for complex physiologic signals. Circulation 2000, 101, e215–e220. Available online: http://circ.ahajournals.org/content/101/23/e215 (accessed on 20 September 2022). [CrossRef] [PubMed]
  16. Park, S.; Kim, Y.; Sim, J.S. Comparison of order-isomophism verification times of two strings according to their representations. In Proceedings of the Korean Institute of Next Generation Computing Spring Conference, Gwangju, Republic of Korea, 1–13 May 2021; Korean Institute of Next Generation Computing: Seoul, Republic of Korea, 2021; pp. 350–353. [Google Scholar]
Figure 1. Example of the Aho–Corasick automaton for OPMPM.
Figure 1. Example of the Aho–Corasick automaton for OPMPM.
Applsci 13 05142 g001
Figure 2. Search phase of the parallel OPMPM algorithm using the Aho–Corasick automaton.
Figure 2. Search phase of the parallel OPMPM algorithm using the Aho–Corasick automaton.
Applsci 13 05142 g002
Figure 3. Comparison of execution times of A C and p A C varying n for randomly generated strings when m = 9 and k = 100 .
Figure 3. Comparison of execution times of A C and p A C varying n for randomly generated strings when m = 9 and k = 100 .
Applsci 13 05142 g003
Figure 4. Comparison of execution times of A C and p A C varying k for randomly generated strings when n = 100,000 and m = 9 .
Figure 4. Comparison of execution times of A C and p A C varying k for randomly generated strings when n = 100,000 and m = 9 .
Applsci 13 05142 g004
Figure 5. Comparison of execution times of F T and p F T according to n for randomly generated strings when m = 9 and k = 100 .
Figure 5. Comparison of execution times of F T and p F T according to n for randomly generated strings when m = 9 and k = 100 .
Applsci 13 05142 g005
Figure 6. Comparison of execution times of F T and p F T according to k for randomly generated strings when n = 100,000 and m = 9 .
Figure 6. Comparison of execution times of F T and p F T according to k for randomly generated strings when n = 100,000 and m = 9 .
Applsci 13 05142 g006
Table 1. Prefix table and position table of x = ( 23 , 29 , 20 , 57 , 59 ) .
Table 1. Prefix table and position table of x = ( 23 , 29 , 20 , 57 , 59 ) .
x2329205759
μ x [ i ] 12145
P O S x [ i ] 31245
Table 2. Comparison of execution times of p A C , p K R , and p F T for random strings.
Table 2. Comparison of execution times of p A C , p K R , and p F T for random strings.
(a) Comparison of execution times varying m when n = 100,000, k = 1000
Execution times of the algorithms (unit: ms)
m p A C p K R p F T
641.3121.5822.62
944.8322.6421.98
1249.0722.1822.51
1552.4922.1622.52
(b) Comparison of execution times varying k when n = 100,000, m = 9
Execution times of the algorithms (unit: ms)
k p A C p K R p F T
10019.352.222.24
50031.0711.2511.47
100044.8322.6421.98
Table 3. Comparison of execution times of p A C , p K R , and p F T for Dow Jones Index data.
Table 3. Comparison of execution times of p A C , p K R , and p F T for Dow Jones Index data.
(a) Comparison of execution times varying m when n = 10,000, k = 1000
Execution times of the algorithms (unit: ms)
m p A C p K R p F T
69.582.292.55
912.842.292.25
1216.352.222.25
1520.332.342.45
(b) Comparison of execution times varying k when n = 10,000, m = 9
Execution times of the algorithms (unit: ms)
k p A C p K R p F T
1005.030.490.47
5008.521.351.38
100012.842.292.25
Table 4. Comparison of execution times of p A C , p K R , and p F T for ECG data.
Table 4. Comparison of execution times of p A C , p K R , and p F T for ECG data.
(a) Comparison of execution times varying m when n = 100,000, k = 1000
Execution times of the algorithms (unit: ms)
m p A C p K R p F T
1041.1819.3219.08
1242.618.6819.03
1544.8318.8218.31
(b) Comparison of execution times varying k when n = 100,000, m = 10
Execution times of the algorithms (unit: ms)
k p A C p K R p F T
10018.572.322.29
50028.239.899.46
100041.1819.3219.08
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.

Share and Cite

MDPI and ACS Style

Park, S.; Park, J.; Kim, Y.; Sim, J.S. Order-Preserving Multiple Pattern Matching in Parallel. Appl. Sci. 2023, 13, 5142. https://doi.org/10.3390/app13085142

AMA Style

Park S, Park J, Kim Y, Sim JS. Order-Preserving Multiple Pattern Matching in Parallel. Applied Sciences. 2023; 13(8):5142. https://doi.org/10.3390/app13085142

Chicago/Turabian Style

Park, Somin, Jinhyeok Park, Youngho Kim, and Jeong Seop Sim. 2023. "Order-Preserving Multiple Pattern Matching in Parallel" Applied Sciences 13, no. 8: 5142. https://doi.org/10.3390/app13085142

Note that from the first issue of 2016, this journal uses article numbers instead of page numbers. See further details here.

Article Metrics

Back to TopTop