Next Article in Journal
Optimization of Gabor Filters Based on Quaternions for Image Preprocessing in the Automated Detection of Bemisia tabaci in Yellow Traps
Previous Article in Journal
Eigenvalue Bounds for Symmetric, Multiple Saddle-Point Matrices with SPD Preconditioners
Previous Article in Special Issue
Recent Advances in Multi-Camera Computer Vision for Industry 4.0 and Smart Cities: A Systematic Review
 
 
Font Type:
Arial Georgia Verdana
Font Size:
Aa Aa Aa
Line Spacing:
Column Width:
Background:
Article

Multiple String Pattern Matching Algorithm Using Multi-Character Inverted Lists

by
Chouvalit Khancome
Department of Computer Science, Faculty of Science, Ramkhamhaeng University, 282 Ramkhamhaeng Road, Hua Mak Subdistrict, Bang Kapi District, Bangkok 10240, Thailand
Algorithms 2026, 19(5), 362; https://doi.org/10.3390/a19050362
Submission received: 24 March 2026 / Revised: 29 April 2026 / Accepted: 30 April 2026 / Published: 4 May 2026

Abstract

Multiple string matching is a fundamental operation in real-time analytics, cybersecurity, bioinformatics, and large-scale information retrieval. Nevertheless, existing approaches continue to face inherent trade-offs among preprocessing efficiency, verification overhead, and support for dynamic pattern updates, particularly in large and continuously evolving environments. This paper presents MMIVL, a high-performance algorithm founded on the multi-character inverted list (m-CIVL), a unified and inherently dynamic indexing framework for pattern management. By integrating positional information, termination semantics, and pattern associations within a single structure, m-CIVL enables direct matching without requiring a separate verification stage. MMIVL achieves a preprocessing complexity of O(|P|/s), a search complexity of O(|T| + nocc), and an update complexity of O(|p|/s), where s denotes the segment length. Extensive experiments on synthetic and real-world datasets demonstrate that MMIVL consistently outperforms representative baselines, with especially strong gains in large-scale scenarios, while maintaining stable performance and favorable memory efficiency. Overall, these results establish m-CIVL as an effective, scalable, and practically viable solution that unifies efficient preprocessing, high-throughput searching, and dynamic update capability for modern multiple string-matching applications.

1. Introduction

Multiple string matching is a fundamental problem in computer science that identifies all occurrences of patterns P = {p1, p2,…,pr} in an input text T. Beyond its theoretical importance, it is a core primitive in large-scale systems, with applications in operating system command processing, DPI, IDS/IPS, malware scanning, content filtering, genomic analysis, log analytics, and information retrieval. Accordingly, classical automaton-based methods such as the Aho–Corasick algorithm are widely deployed in practice, including platforms such as Snort [1,2]. Multiple string-matching techniques are also embedded in widely used Unix command-line utilities such as fgrep and agrep, demonstrating their enduring value in large-scale text processing and interactive search tasks [3,4,5,6]. Recent high-performance studies further confirm that string matching remains a central challenge even in modern SIMD-accelerated and production-scale infrastructures [2,7]. Outside security and command-line systems, pattern matching is central to everyday software. Document editors, word processors, and IDEs use substring searches for find/replace, navigation, indexing, and highlighting [3,8]. It is equally fundamental to search engines and information retrieval through inverted indexes and large-scale text lookup [9,10,11,12], databases and log analytics for filtering, auditing, monitoring, and event detection [6,7], and bioinformatics for DNA/protein search, motif discovery, and genomic analysis [13,14].
Considering performance, computational complexity, and underlying data structures, classical methods have established the foundations of multiple string matching. The Aho–Corasick algorithm achieves optimal worst-case search complexity O(|T| + nocc) through a trie-based automaton with failure transitions for simultaneous multi-pattern matching [1]. Related methods, including Commentz–Walter and other shift-based variants, improve practical efficiency via backward scanning and heuristic skipping [3,15,16]. Alternative paradigms include hashing-based methods [17,18], inverted-index frameworks [9,10,19,20,21,22], and substring filtering such as q-gram indexing [22,23,24]. Despite these advances, most approaches remain paradigm-specific. Automaton-based methods enable direct matching but are often memory-intensive and costly to update. Filtering methods reduce the search space but still require verification overhead. Hashing- and index-based methods support efficient lookup and scalability, yet typically store partial structural information and thus require additional alignment or validation to confirm complete matches [9,17,18,19,20].
These applications show that practical requirements extend far beyond raw search speed, as modern systems demand high throughput, scalable memory consumption, predictable runtime behavior, and efficient support for evolving pattern sets. Consequently, unified and update-friendly frameworks remain an important objective, since existing methods often trade off search efficiency, compactness, direct matching capability, and dynamic updatability [6,7,9]. Recent studies (2020–2026) have continued to improve specific aspects of string matching without altering its fundamental paradigms. Substring-based methods enhance candidate filtering through positional and distance constraints [25,26]; factor- and hash-based techniques improve practical runtime via heuristic strategies [27]; and suffix-oriented frameworks provide better support for dynamic pattern updates [28,29]. Large-scale retrieval systems further demonstrate scalability to billion- and trillion-scale collections, while recent advances in compact text indexing strengthen space-efficient searches under richer matching models [11,12,30].
Nevertheless, these efforts primarily refine existing frameworks rather than introducing a unified representation for complete multi-pattern matching. A key limitation, therefore, remains: no single approach simultaneously preserves positional information, termination semantics, pattern-level associations, and efficient dynamic updatability. Automaton-based methods such as AC-trie and RT-trie enable direct matching through precomputed transitions, but often incur globally coupled structures, high memory overhead, and costly maintenance under pattern updates. By contrast, substring indexing methods such as q-gram and SIVL [31] provide greater flexibility and efficient retrieval, yet typically retain only partial matching evidence and still require additional verification or alignment; notably, the single-character design of SIVL is more susceptible to collisions and larger candidate sets than multi-character segmentation schemes.
To address this gap, this paper proposes MMIVL (multi-pattern matching with inverted lists), a new algorithm based on the multi-character inverted list (m-CIVL), which stores each indexed segment together with its positional role, termination status, and associated pattern identifiers in a unified entry. This design enables complete matches to be resolved directly through structural consistency among aligned segments without a separate verification stage, while updates affect only local entries rather than requiring global reconstruction, making the framework well-suited to evolving pattern sets. Theoretically, MMIVL achieves preprocessing complexity O(|P|/s), search complexity O(|T| + nocc) under standard assumptions, and update complexity O(|p|/s) for pattern insertion and deletion, where s denotes the segment length and |p| denotes the length of the updated pattern. By unifying indexing, matching, and update operations within a single framework, m-CIVL removes the need for disjoint processing stages. Extensive experiments on synthetic and real-world datasets further show that MMIVL consistently outperforms representative baselines across diverse settings, delivering substantial speedups in large-scale workloads, stable performance under varying parameters, and lower memory usage than conventional automaton-based approaches.
The main contributions are fivefold: (1) a unified multi-character inverted list that integrates positional information, termination semantics, and pattern-level associations in one structure; (2) verification-free matching through structurally complete direct multi-pattern matching; (3) efficient dynamic updates supporting insertion and deletion in O(|p|/s) time without global reconstruction; (4) formal theoretical guarantees for correctness and complexity; and (5) comprehensive empirical validation demonstrating strong scalability, efficiency, and robustness across synthetic and real-world datasets.
The remainder of this paper is organized as follows. Section 2 reviews the related literature and formalizes the research gap. Section 3 presents the proposed m-CIVL structure and its theoretical foundation. Section 4 describes the preprocessing and search algorithms. Section 5 outlines the experimental methodology. Section 6 reports the empirical results. Section 7 discusses the findings and their implications. Finally, Section 8 concludes the paper and highlights directions for future research.

2. Related Work and Problem Formulation

2.1. Automaton-Based Methods

Automaton-based approaches form the classical foundation of multiple string matching. The Aho–Corasick (AC) algorithm constructs a trie augmented with failure links, enabling simultaneous matching of multiple patterns in linear search time O(|T| + nocc) after preprocessing [1]. Subsequent developments, including Commentz–Walter and related backward-scanning variants, improve practical performance through heuristic shifting and right-to-left window traversal [3,15,16]. Hybrid methods such as MultiBDM and SBOM further enhance efficiency by combining automaton-style matching structures with skip-based strategies and practical shift heuristics [32,33,34].
Despite their strong theoretical guarantees, automaton-based methods exhibit several structural limitations. First, they typically rely on a globally coupled state machine in which all patterns are embedded within a single structure. As a result, inserting or deleting patterns often requires partial or complete reconstruction, leading to substantial update overhead in dynamic settings [19,20]. Second, these methods may incur considerable memory consumption due to the storage of states, transitions, and auxiliary links, which can limit scalability for large pattern collections or resource-constrained environments.
Recent advances have sought to improve the practical efficiency of automaton-based matching through parallelization and hardware-aware implementations, including SIMD acceleration and multi-core processing architectures [2]. Although such techniques substantially reduce runtime in practice, they preserve the underlying automaton model and therefore do not resolve the fundamental issues of structural rigidity, reconstruction cost, and update inefficiency. Consequently, automaton-based approaches remain less suitable for applications involving dynamic or frequently evolving pattern sets.

2.2. Filtering and Substring-Based Methods

Filtering-based approaches aim to reduce the search space by identifying candidate occurrences prior to full validation. Representative techniques include q-gram indexing, partition-based filtering, and block-oriented hashing methods such as Wu–Manber [18,23,24]. These methods decompose patterns into shorter substrings and use indexing or hashing mechanisms to efficiently locate promising text positions. More recent large-scale retrieval systems further demonstrate the practical scalability of substring-driven candidate generation under modern workloads, particularly when combined with advanced indexing and pruning strategies [11,12].
Despite their practical effectiveness, these approaches fundamentally operate under a filtering–verification paradigm. Substrings are processed largely in isolation, without explicitly preserving structural relationships among patterns or across segments. Consequently, candidate matches must be validated through additional comparisons, introducing extra computational overhead [18,35]. This limitation becomes especially pronounced in large-scale or high-density pattern settings, where excessive candidate expansion may dominate the total search cost.
Recent studies continue to refine substring-based filtering strategies. For example, Kobayashi et al. improved q-gram matching by incorporating positional distance constraints to reduce candidate sets [25]. Palmer et al. introduced factor-based chaining strategies that improve practical efficiency under heuristic matching scenarios [27]. However, such methods still remain within the filtering framework and continue to require a subsequent validation stage. Recent surveys likewise indicate that substring-based approaches remain strongly dependent on candidate generation followed by verification, particularly when scaling to large datasets or operating over small alphabets [26].
Moreover, substring-oriented representations generally lack explicit termination semantics, making it difficult to determine complete pattern matches directly from local substring evidence alone. Dynamic updates also remain inefficient in many indexing frameworks, as modifications to the pattern set often require partial or full re-indexing [22,24]. Recent dynamic matching methods improve update capability through suffix-based or adaptive structures [28,29], yet they do not fundamentally resolve the representational limitations inherent in filtering-based substring paradigms.

2.3. Hashing- and Index-Based Methods

Hashing-based and index-oriented approaches provide an alternative framework for pattern matching by enabling fast lookup through hash tables, dictionaries, or posting-list structures. The Rabin–Karp algorithm introduced hash-based comparison for string matching, although direct extensions to multiple patterns may encounter unfavorable worst-case behavior due to collisions or repeated verification [17]. Subsequent methods, including Wu–Manber and related variants, improve practical efficiency through block-based hashing combined with shift heuristics and skip mechanisms [18].
By inverting index structures, widely used in information retrieval, or mapping terms or substrings to their occurrence positions, efficient retrieval is enabled over large collections [9,10,21,22,36]. Perfect and minimal perfect hashing techniques further support expected constant-time lookup with compact space usage, making them attractive for structured access tasks [37,38]. Related applications of hashing and indexed lookup in multi-pattern matching have also been explored in inverted-list frameworks [19,20]. More recent large-scale retrieval systems extend these ideas to billion- and trillion-scale collections, confirming the practical scalability of index-based searches under modern workloads [11,12].
Despite their efficiency, existing hashing-based and indexing approaches generally store only partial information, such as hash signatures, posting lists, or occurrence locations, which do not explicitly encode the structural dependencies required to reconstruct complete pattern matches. Consequently, they often require additional verification steps, auxiliary alignment logic, or external matching procedures. Recent studies continue to improve this area through heuristic and factor-based methods, such as the hash-chain technique of Palmer et al., which enhances practical performance via weak factor matching [27], as well as theoretical advances in space-efficient text indexes for richer matching models [30]. Nevertheless, these approaches still depend on partial representations and remain insufficient for direct verification-free matching.
Recent work on dynamic pattern matching has also investigated suffix-based structures and adaptive frameworks to support updates more efficiently. For instance, Monteiro et al. proposed a dynamic matching method based on suffix arrays that supports pattern updates while preserving query efficiency [28], while newer formulations further examine matching under dynamic pattern settings [29]. Similarly, large-scale systems such as SoftMatcha and its successors demonstrate the ability to handle massive datasets using advanced indexing and pruning techniques [11,12]. However, these approaches continue to operate within conventional indexing paradigms and do not fundamentally redefine how structural relationships among patterns are represented.

2.4. Problem Formulation and Research Gap

2.4.1. Nature of Methods Used in Multiple String Pattern Matching

Let Occ(w) denote the set of occurrences of a substring w in the pattern collection, where each occurrence is represented as a pair (id, pos) consisting of a pattern identifier and its starting position. Existing substring-oriented representations can be abstracted as follows:
  • Q-gram indexing: Iq(w) = Occ(w) [22,23,24].
  • Hashing-based lookup: H(w) = hash(w) [17,18].
  • Inverted-list retrieval: L(w) = {(id,pos)} [9,10,19,20,22,23,24].
Although efficient for candidate retrieval, these representations capture only partial information and are generally insufficient to determine complete pattern matches without additional verification or auxiliary matching logic. Structurally, an effective representation for multiple string matching should therefore integrate several key properties: pattern awareness, termination semantics, positional consistency, direct matching capability without a separate verification stage, and efficient dynamic updatability for pattern insertion and deletion.
However, no existing mainstream approach simultaneously satisfies all of these requirements. Automaton-based methods provide pattern awareness, positional structure, and direct matching capability, but often incur high structural overheads and limited update flexibility [1,3,16]. Filtering-based methods improve search efficiency through candidate reduction, yet still depend on verification after candidate generation [18,23,24,25,26]. Hashing- and index-based methods support efficient lookup and scalable retrieval, but typically do not encode sufficient structural dependencies for direct matching without auxiliary procedures [9,10,17,19,20,21,22,37,38]. Recent dynamic frameworks improve update support, but remain built upon suffix-based or conventional indexing models rather than providing a unified structural representation [28,29].
To summarize these differences, Table 1 compares representative paradigms across key structural properties, including pattern awareness, termination semantics, direct matching capability, dynamic update support, and reconstruction requirements.
Table 1 compares representative paradigms across key structural properties, including pattern awareness, positional and termination semantics, direct matching, dynamic updates, and reconstruction requirements. Although both q-gram indexing and m-CIVL use substrings as indexing units, their roles differ fundamentally. In q-gram methods, substrings serve as retrieval keys for candidate generation, with full validity resolved in a separate verification stage. In contrast, m-CIVL embeds structural metadata within each segment, transforming substrings from simple filters into components of a complete matching model, as illustrated in Example 1.
Example 1. 
Conceptual differences between filtering-based matching and the proposed m-CIVL.
Consider the pattern set P = {p1 = “abcd”, p2 = “abef”} and the text T = “xxabcdyy”, with segment length s = 2.
In a conventional q-gram style framework, each pattern is decomposed into substrings, yielding p1 → {“ab”, “cd”} and p2 → {“ab”, “ef”}. When the substring “ab” is found in the text, it matches both patterns and therefore produces only a candidate set {p1, p2}. An additional verification step is then required to determine whether the following text characters complete “abcd” or “abef”. Thus, substring evidence is used only for filtering, while correctness is established afterward through explicit verification.
In the proposed m-CIVL representation, each indexed segment is enriched with structural metadata, giving I(“ab”) = {(pos = 1, t = 0, SET = {1,2})}, I(“cd”) = {(pos = 3, t = 1, SET = {1})}, and I(“ef”) = {(pos = 3, t = 1, SET = {2})}. When “ab” is matched, the candidate start position is computed from its stored offset. When the aligned segment “cd” is subsequently matched, the candidate set is refined through set intersection and immediately reduced to {p1}. Because the segment is terminal (t = 1), pattern p1 is reported directly without a separate verification phase.
This example illustrates that, although both approaches use substrings, their roles are fundamentally different. In filtering-based methods, substrings provide partial evidence for later validation. In contrast, m-CIVL uses structurally enriched segments as components of a complete matching model.

2.4.2. Research Gap and Motivation for the Proposed Method

The comparison highlights a persistent gap in existing methods: improvements in efficiency have largely been achieved within separate paradigms, but not through a structurally unified representation that simultaneously supports direct matching, compact indexing, and efficient updates. This suggests that the central challenge of multiple string matching lies not only in algorithm design, but also in how pattern relationships are represented.
To address this gap, this paper introduces the multi-character inverted list (m-CIVL), defined as follows:
Im(w) = (pos, t, SET)
where pos denotes the starting position of substring w within a pattern, t ∈ {0,1} indicates whether the segment is terminal, and SET is the set of pattern identifiers containing w.
This representation integrates positional information, termination semantics, and pattern-level associations within a single structure. Unlike existing approaches, it enables direct multi-pattern matching without a separate verification phase while naturally supporting efficient localized updates. Figure 1 highlights these differences: conventional methods use separate processing models, whereas the proposed framework unifies indexing, matching, and updating in one structurally complete representation.
Building on this unified representation, the next section presents the formal definition and construction of the m-CIVL structure.

3. Proposed Method and Theoretical Framework

3.1. Preliminaries and Notation

Let Σ be a finite alphabet. Let T ∈ Σ* denote the input text of length ∣T∣, and let P = {p1,p2,…,pr} be a finite set of patterns. Each pattern pi ∈ Σ* has a length ∣pi∣, and the total size of the pattern set is defined as follows:
| P | = i = 1 r | p i |
Let s ≥ 1 denote a fixed segment length. Each pattern pi is partitioned into a sequence of substrings (segments) of length s, except possibly the last segment:
pi = w1w2wk,
where each wj ∈ Σ* and ∣wj∣ = s for 1 ≤ j < k.
For any substring w ∈ Σ*, the occurrence set of w in the pattern collection is defined as follows:
Occ(w) = {(i,pos)∣w occurs in pi at position pos}.
It is assumed that substring lookups are supported by a hash-based index with expected O(1) access time under standard assumptions. The total number of matches identified in the text is denoted by nocc.

3.2. m-CIVL Representation

A novel data structure, termed the multi-character inverted list (m-CIVL), is introduced as a unified representation for multi-pattern matching.
Definition 1 (m-CIVL Entry).
Let w ∈ Σ* be a substring of length s. The multi-character inverted list representation of w is defined as follows:
Im(w) = {(pos,t,SET)}
where
  • pos denotes the starting position of w within a pattern;
  • t ∈ {0,1} indicates whether w is a terminal segment (t = 1) or an intermediate segment (t = 0);
  • SET⊆{1,…,r} is the set of pattern identifiers containing w.
Definition 2. (m-CIVL Structure).
The m-CIVL structure maps substrings of length s to their corresponding inverted lists:
Im = {wIm(w)∣w ∈ Σs}.
Key Observations
The proposed representation integrates multiple structural components into a single unified framework:
  • Positional encoding: Each entry preserves the alignment of substrings within patterns through the pos field.
  • Termination semantics: The flag t explicitly indicates whether a substring corresponds to the final segment of a pattern.
  • Pattern association: The set SET maintains the relationship between substrings and their originating patterns.
Unlike conventional substring indexing methods, which typically store only occurrence positions or hash values, the m-CIVL representation encodes sufficient structural information to reconstruct complete pattern matches without additional verification.
Specifically:
  • Filtering-based approaches rely on partial substring matches followed by verification;
  • Hashing-based approaches store incomplete representations requiring validation;
  • Automaton-based approaches encode full matching logic but require complex and static structures.
In contrast, m-CIVL provides a structurally complete representation that unifies these aspects, enabling direct matching while maintaining flexibility for dynamic updates.
Example 2. 
Illustration of m-CIVL Representation.
Consider the pattern set P = {p1 = “abcd”, p2 = “bcde”} with segment length s = 2.
The patterns are decomposed into substrings of length s as follows:
p1:{“ab”,”cd”}, p2:{“bc”,”de”}.
For the substring w = “cd”, the corresponding m-CIVL entry is given by the following:
Im(“cd”) = {(pos = 3, t = 1, SET = {1})},
indicating that the substring appears at position 3 of pattern p1 and corresponds to a terminal segment.
Similarly, for w = “bc”, the representation is as follows:
Im(“bc”) = {(pos = 1, t = 0, SET = {2})},
indicating that the substring appears at position 1 of pattern p2 and corresponds to an intermediate segment.
This example illustrates how positional information, termination semantics, and pattern associations are jointly encoded in the m-CIVL representation.
Boundary Conditions.
The proposed framework naturally accommodates special cases involving short patterns or short texts. If a pattern p satisfies |p| < s, it is treated as a single terminal segment of length |p| and indexed directly with pos = 1 and t = 1. No further partitioning is required. If the text satisfies |T| < s, no full-length segment of size s can be extracted from the standard sliding-window procedure. In this case, only indexed patterns with lengths that do not exceed |T| are checked through direct short-pattern lookup. Therefore, the representation and matching framework remains well-defined for all positive patterns and text lengths.

3.3. Memory Model of m-CIVL

To analyze the memory efficiency of the proposed m-CIVL structure, an analytical model is developed to reflect its practical implementation. Unlike conventional inverted indexes that store only simple posting lists, each entry in m-CIVL consists of a multi-character key and an associated metadata tuple (i, t, SET), where SET is implemented using a hash-based set.
Entry Structure
Each entry in m-CIVL can be represented as follows:
entry = (key, i, t, SET)
where:
  • key is a substring of length m;
  • i denotes the position;
  • t is a type or auxiliary flag;
  • SET is a collection of pattern identifiers stored using a hash-based structure.
Memory Decomposition
The total memory consumption can be decomposed into two components:
Mtotal = Mkey + Mmeta
(1) 
Key Storage
Let |p| denote the length of a pattern. Since the segmentation partitions the pattern into non-overlapping substrings of length m, the total number of characters stored across all keys remains constant:
M key   =   | p |   ·   M char
where Mchar is the memory required per character.
(2) 
Metadata Storage
The number of entries is given by the following:
# e n t r i e s = | p | m
Each entry stores metadata (i, t, SET), resulting in the following:
M m e t a = | p | m · M e n t r y
where
M e n t r y = M i + M t + M s e t .
Hash-Based Set Overhead
The dominant memory cost arises from the SET structure.
Assuming a hash-based implementation, its memory usage can be approximated as follows:
M s e t = B · M p t r + k · M p i d + M p t r ,
where:
  • B is the number of buckets;
  • k is the number of elements in the set;
  • Mptr is the pointer size;
  • Mpid is the memory required per pattern identifier.
Final Model
Combining the above components, the total memory consumption is given by the following:
M t o t a l m = p + · M c h a r + p m M i + M t + B · M p t r + k · M p i d + M p t r .
Key Observations
  • Constant Key Storage
The total key memory remains constant regardless of m, since segmentation only changes grouping, not the total number of characters.
2.
Reducible Metadata Overhead
The metadata term is inversely proportional to m, implying that larger segment sizes reduce the number of entries and thus the associated overhead.
3.
Dominance of Hash-Based Structures
The SET component introduces significant overhead due to bucket allocation and pointer storage, especially when the number of elements k is small.
4.
Amortization Effect
Increasing m reduces the number of SET instances, effectively amortizing the hash-based overhead.
5.
Lower Bound Behavior
As m increases, the total memory converges to the following:
lim m | p | M t o t a l = p + M c h a r ,
indicating a lower bound determined by key storage.
Implication
This model explains the empirical results presented in Section 6.5, where memory usage decreases with increasing segment size but eventually stabilizes due to the constant key storage component.

3.4. Matching Mechanism

The matching process in m-CIVL is governed by the structural properties of the representation, enabling direct determination of pattern occurrences without requiring an explicit verification phase.
Given a text T, substrings of length s are extracted and mapped to their corresponding entries Im(w) in the m-CIVL structure. Matching is performed by aggregating information across segments that are aligned according to their positions within patterns.
Definition 3 (Direct Matching Condition).
A pattern pi ∈ P is said to match at position x in the text T if there exists a sequence of substrings w1, w2,…, wk such that:
  • Each substring wj occurs in T at position x + posj, consistent with its recorded position posj;
  • The pattern identifier satisfies the following:
    i j = 1 k S E T ( w j ) ,
  • The final segment satisfies the termination condition (t = 1).
Matching Principle
The matching process relies on three fundamental conditions:
  • Positional alignment: This ensures that substrings correspond to the correct relative positions within a pattern;
  • Set intersection: This ensures that only patterns containing all required segments are retained;
  • Termination detection: This guarantees that a complete pattern occurrence has been identified.
Together, these conditions enable direct matching based solely on structural consistency.
Discussion
Unlike filtering-based methods, which require candidate generation and verification, the proposed mechanism achieves matches through structural consistency alone. Positional encoding and set intersection remove extra validation, while matching is derived directly from the representation rather than a global automaton, enabling efficient search and flexible updates. This guarantees soundness and completeness: a pattern is reported if all aligned segments are consistent and the termination condition holds.
Informal Procedure
At a high level, the matching process proceeds as follows:
  • Scan the text T using a sliding window of length s;
  • For each substring w, retrieve Im(w);
  • Aggregate entries across aligned positions using set intersection;
  • Report matches when the termination condition (t = 1) is satisfied and
    i S E T w j ,

3.5. Dynamic Update

The m-CIVL structure is designed to support efficient dynamic updates, allowing patterns to be inserted or deleted without requiring global reconstruction.
Definition 4 (Update Operation).
Let p ∈ Σ* be a pattern. The update operation (insertion or deletion) is performed by decomposing p into segments of length s, and modifying only the corresponding entries Im(w) associated with these segments.
Insertion
To insert a pattern p:
  • Decompose p into segments w1, w2, …, wk.
  • For each segment wj:
  • Insert or update the entry Im(wj);
  • Add the pattern identifier to SET;
  • Update the position pos;
  • Set t = 1 for the final segment and t = 0 otherwise.
Deletion
To delete a pattern p:
  • Decompose p into segments w1,w2,…,wk.
  • For each segment wj:
  • Remove the pattern identifier from SET;
  • Remove the entry if SET becomes empty.
Key Property
The update process affects only the segments derived from the modified pattern. No global restructuring of the data structure is required.
Discussion
Unlike automaton-based approaches, where inserting or deleting a pattern may require the entire structure to be rebuilt, the proposed method performs localized updates. This significantly reduces update overhead and makes the structure suitable for dynamic environments. In contrast to filtering-based methods, which may require re-indexing or rebuilding auxiliary data structures, m-CIVL maintains consistency through direct modification of affected entries.
Informal Complexity Insight
Let p be a pattern of length ∣p∣. The number of segments is O(∣p∣/s), and each segment update requires constant-time modification under standard assumptions. Therefore, the update operation is proportional to the number of affected segments.

3.6. Theoretical Analysis

This section presents the theoretical properties of the proposed m-CIVL structure, including correctness and complexity analysis.
Theorem 1 (Correctness).
The representation of m-CIVL is sufficient to determine all occurrences of patterns P within text T without requiring an additional verification phase.
Proof (Sketch).
The proof follows by establishing completeness and soundness.
(Completeness) Let pi P occur at position x in T. Then each segment wj of pi appears at position x + posj, consistent with its stored offset. Since each segment is associated with a fixed positional offset, positional consistency ensures that all retrieved segments correspond to the same occurrence of the pattern. Consequently, each segment is retrieved from Im(wj), and since ISET(wj) for all j, it follows that
i j = 1 k S E T ( w j )
The final segment satisfies t = 1, ensuring that the complete pattern is identified.
(Soundness) Suppose i   j = 1 k S E T ( w j ) for a sequence of aligned segments satisfying positional constraints, and the termination condition holds. Then all segments of pi must occur at positions consistent with their offsets. Since positional consistency enforces alignment across segments, these segments correspond to the same occurrence, implying that the entire pattern pi occurs in T. Hence, no false positives are produced.
Therefore, all and only valid pattern occurrences are reported. □
Theorem 2 (Preprocessing Complexity).
The preprocessing time required to construct the m-CIVL structure is O(∣P∣/s).
Proof. 
Each pattern pi is divided into O(∣pi∣/s) segments. Each segment is processed once and inserted into the structure at a constant time under standard assumptions. Summing over all patterns yields the following:
i = 1 r p i s = O P s
Theorem 3 (Searching Complexity).
The search complexity of the proposed method is O(T + nocc).
Proof (Sketch).
The text T is scanned once using a sliding window of length s, resulting in O(∣T∣) operations. For each substring, a lookup in the m-CIVL structure is performed in expected constant time under standard hashing assumptions. Matching is determined through set intersection over aligned segments, assuming bounded set sizes or efficient set representations. Each valid occurrence contributes to nocc. Therefore, the total complexity is O(∣T∣ + nocc). □
Theorem 4 (Update Complexity).
Pattern insertion and deletion can be performed in O(∣p∣/s), where ∣p∣ is the length of the updated pattern.
Proof. 
Each update operation affects only the segments derived from the pattern. The number of such segments is O(∣p∣/s), and each modification requires constant time. Therefore, the total update complexity is O(∣p∣/s). □
Discussion
The above results demonstrate that the proposed method achieves a balanced combination of efficiency and flexibility. Unlike automaton-based approaches, which incur high preprocessing and update costs, and filtering-based methods, which require additional verification, the m-CIVL structure enables direct matching with reduced preprocessing and efficient updates.

4. Algorithms

This section presents the main algorithms of the proposed framework. The preprocessing phase, which constructs the m-CIVL structure as defined in Section 3.2, is shown in Algorithm 1. Subsequently, the searching procedure based on the proposed m-CIVL structure and the matching mechanism described in Section 3.4 is presented in Algorithm 2.
Algorithm 1: Build_mCIVL
Input: Pattern set P = {p1, p2,…, pr}, segment length s
Output: m-CIVL structure Im
1:  initialize empty hash table Im//Create empty index.
2:  for each pattern pi with identifier id do//Process each pattern.
3:      for j ← 1 to |pi| step s do//Split pattern into segments of length s.
4:          wpi[j: min(j + s − 1, |pi|)]//Extract current segment.
5:          posj//Record segment position.
6:          t ← 1 if j + s − 1 ≥ |pi| else 0//Mark last segment or not.
7:          if wIm then//New segment.
8:            Im[w] ← {(pos, t, {id})}//Create first entry.
9:          else if (pos, t, SET) ∈ Im[w] then//Same metadata exists.
10:            SET ← SET ∪ {id}//Add pattern ID.
11:          else//Different metadata case.
12:            add (pos, t, {id}) to Im[w]//Append new tuple.
13:          end if
14:     end for//Next segment.
15: end for//Next pattern.
16: return Im//Return completed m-CIVL.
Correctness of Algorithm 1.
The correctness of the proposed preprocessing algorithm follows from the complete segmentation and accurate insertion mechanism. Each pattern is scanned from left to right in steps of length s, ensuring that every character belongs to exactly one generated segment, with the final segment truncated when necessary.
For each extracted segment w, the algorithm stores its starting position as pos = j and correctly assigns the terminal flag t = 1 if and only if the segment reaches the end of the pattern; otherwise, t = 0. Therefore, every segment is associated with correct positional and termination metadata.
The insertion process guarantees complete pattern membership. If a segment does not yet exist in the index, a new entry is created. If the same metadata already exists, the current pattern identifier is added to the corresponding set. Otherwise, a new tuple is appended. Hence, all valid occurrences of each segment are preserved without loss or duplication.
Therefore, after termination, the returned structure Im is exactly the intended m-CIVL representation of the pattern set.
Algorithm 2 presents the main search procedure for the standard case ∣T∣ ≥ s, while special boundary cases are discussed afterward. The algorithm scans the text, retrieves the corresponding entries from the m-CIVL structure, and combines position-aligned segments to identify valid pattern occurrences. The procedure follows directly from the matching condition defined in Section 3.4.
Algorithm 2: MMIVL_Search
Input: Text Tm-CIVL structure Im
Output: All occurrences of patterns in T
1:  initialize an empty mapping M: position → set of pattern IDs//Candidate sets for each possible start position
2:  for i ← 1 to |T| − s + 1 do      //Scan text using an s-length sliding window
3:      w ← T[ii + s − 1]    //Current text segment
4:      if w ∉ Im then     //Segment not indexed
5:          continue        //Skip unmatched segment
6:      end if
7:      for each entry (postSET) ∈ Im(wdo//Process all pattern entries linked to w
8:          x ← i − pos + 1       //Compute candidate starting position
9:          if x < 1 then        //Invalid alignment
10:             continue
11:         end if
12:         if x ∉ M then       //First evidence for x
13:             M[x] ← SET
14:         else
15:             M[x] ← M[x] ∩ SET   //Keep only consistent patterns
16:         end if
17:         if t = 1 and M[x] ≠ ∅ then //Final segment matched and candidates remain
18:             report all patterns in M[x] at position x //Output matches
19:         end if
20:     end for
21: end for
The algorithm performs multi-pattern matching using the m-CIVL structure through position-aligned set intersection. For each substring w of length s extracted from the text, the algorithm retrieves its corresponding inverted list Im(w). Each entry (pos, t, SET) encodes the position of the segment within a pattern, a termination flag, and the associated set of pattern identifiers.
For each match, a candidate’s starting position is computed as follows:
x = ipos + 1,
which aligns the current segment in the text with its corresponding position in the pattern. This alignment enables aggregation of matching segments belonging to the same pattern occurrence.
The mapping M[x] maintains a set of candidate patterns that remain consistent across multiple segments. This set is progressively refined using set intersection as follows:
M[x] ← M[x] ∩ SET,
ensuring that only patterns matching all aligned segments are retained.
When a terminal segment (t = 1) is encountered, and the candidate set is non-empty, a valid pattern occurrence is reported at position x. The condition wIm serves as an early pruning mechanism, skipping substrings that do not appear in any pattern and thereby improving efficiency.
The algorithm transforms sequential pattern matching into a position-aligned intersection problem, eliminating the need for explicit state transformations and enabling efficient matching through inverted indexing.
Boundary Case Handling.
The standard search procedure assumes that segments of length s can be extracted from the text. When |T| < s, the main sliding-window loop is skipped because no such segment exists. In this situation, only short patterns previously indexed as terminal segments are checked directly against the text. Likewise, patterns satisfying |p| < s do not participate in the regular segmentation process; instead, they are represented as single terminal entries and matched through direct lookup. These boundary cases require only constant additional control logic and do not alter the main structure of the algorithm.
Correctness of the Algorithm 2.
The correctness of the proposed algorithm follows from the position-aligned intersection mechanism. For each substring match, the candidate starting position is computed as x = ipos + 1, ensuring consistent alignment between text segments and their corresponding positions in the pattern.
The mapping M[x] maintains a set of candidate patterns that match all processed segments aligned at position x. This set is progressively refined through intersection operations, guaranteeing that only patterns consistent across all segments are retained.
Soundness is ensured because a pattern is reported only when a terminal segment (t = 1) is encountered and the corresponding candidate set is non-empty, implying that all preceding segments have matched consistently.
Completeness is guaranteed because every segment extracted from the text is checked against the m-CIVL structure, and all valid alignments are considered through the computation of x. Therefore, the occurrence of no valid pattern is missed.

5. Experimental Evaluation

5.1. Experimental Design and Evaluation Factors

To rigorously assess the effectiveness of MMIVL, comparative experiments were conducted against three structurally distinct multiple string-matching algorithms spanning major search paradigms. Aho–Corasick (AC) [1] was chosen as the canonical automaton-based baseline with left-to-right linear text traversal. HP [3] was included as a representative heuristic method employing right-to-left window scanning. SIVL [31], corresponding to the special case of MMIVL with m = 1, served as the single-character inverted-list baseline under the same left-to-right scanning framework as MMIVL. Together, these baselines cover fundamentally different matching mechanisms, enabling a rigorous and balanced evaluation of the proposed method.
The evaluation considers key performance factors, including alphabet size Σ, pattern length L, number of patterns ∣P∣, and text size ∣T∣, which are systematically varied to assess scalability and robustness. In addition, the proposed method is evaluated under multiple values of the segmentation parameter s to analyze its effect.
The experimental ranges are defined as follows:
  • Text size |T|: 100 Bytes to 10 MB;
  • Pattern length L: 2 to 64 characters;
  • Number of patterns |P|: 10 to 100,000;
  • Alphabet size Σ: 2 to 64.
For each experiment, one parameter is varied while the others are fixed, ensuring controlled and interpretable comparisons.

5.2. Experimental Environment and Datasets

All experiments were conducted on a system with an Intel Core i7 processor, 16 GB RAM, and Windows 10. All algorithms were implemented in Java using JDK 23. To ensure fairness, AC [1], HP [3], and SIVL [31] were executed under identical hardware and software conditions, with baseline configurations following standard settings reported in the literature. Runtime was measured using “System.nanoTime()”.
The evaluation used both synthetic and real-world datasets. Synthetic datasets were randomly generated under controlled settings, with multiple instances per configuration to ensure statistical reliability. Real-world datasets included DNA sequences from GenBank [14] and large-scale text corpora such as the British National Corpus [39] and American National Corpus [40]. All datasets were preprocessed to a minimum size of 1 MB for consistent evaluation.
Fairness of Comparison.
The compared algorithms are based on different native representations and therefore do not share an identical tuning space. AC-trie and reverse-trie operate as character-transition automata, while SIVL is inherently a single-character inverted-list method. In contrast, MMIVL introduces the segment length s as an intrinsic component of its representation. Accordingly, fairness was established by evaluating each baseline under its standard configuration, following the original publications or commonly accepted implementations, while MMIVL was evaluated across multiple admissible values of s rather than only a single optimized setting. This comparison protocol assesses each method within its intended design space, rather than imposing structural modifications that would effectively define new variants of the baseline algorithms.

5.3. Parameter Settings

The parameters used in the experiments are summarized in Table 2. All parameters were explicitly defined and fixed prior to execution to ensure reproducibility and fair comparison.

5.4. Implementation and Evaluation Protocol

The proposed MMIVL algorithm is implemented using a hash-based inverted index structure, referred to as the m-CIVL (HTm), which is constructed during the preprocessing phase. The structure is organized as a two-level hash table, where substrings of length s are mapped to buckets, and each entry stores positional information, termination flags, and associated pattern identifiers.
During preprocessing, each pattern is partitioned into fixed-length substrings and inserted into HTm. During the searching phase, the text is scanned sequentially using a sliding window of length s, while candidate matches are progressively refined through set intersection across aligned segments.
Each experiment is executed multiple times (with at least ten runs), and the reported runtime corresponds to the average execution time. The variance across repeated runs remains consistently low, indicating stable and reproducible performance.
Memory usage is evaluated during the preprocessing phase. For each experiment, the process memory consumption is recorded immediately before structure construction and again after preprocessing is completed using the Windows Task Manager process monitor. The difference between these two measurements is reported as the observed memory requirement. All methods are evaluated under the same hardware and software environment to ensure fair comparison.
Although the theoretical model assumes constant-time set operations, the implementation employs HashSet, resulting in linear-time intersection in the worst case. In practice, however, effective pruning keeps candidate sets small, empirically preserving near-constant behavior.
Measurement Protocol and Statistical Validation.
To ensure a fair and reliable evaluation, all experiments were conducted under identical hardware and software conditions using the same timing procedure, dataset instances, and runtime environment for every compared algorithm. Preprocessing and runtime results were obtained from repeated executions and summarized by averaged values under the same settings, minimizing transient system noise and preserving comparability across measurements. Statistical reliability was assessed using descriptive measures, including mean, standard deviation, variance, coefficient of variation, and 95% confidence intervals. Comparative performance was further evaluated through speedup ratios and percentage improvements over baseline methods, while significance was validated using appropriate hypothesis tests (e.g., paired t-tests or Wilcoxon’s signed-rank test) together with effect size measures. Across all experiments, measurement variability remained small relative to the observed performance gaps, indicating stable and statistically meaningful results.
Overall, the performance trends observed are consistent with the theoretical analysis presented in Section 3.6, particularly the linear dependence on text size and the elimination of an explicit verification phase.

5.5. Validity and Reproducibility

Several factors may influence the validity of the experimental results.
From an implementation perspective, the use of Java data structures (Hashtable and HashSet) introduces practical overhead relative to the theoretical model. In addition, observed performance may be affected by hash collisions, resizing behavior, memory allocation, and other runtime overheads inherent to dynamic hash-based containers. However, all compared algorithms were implemented and executed under the same software and hardware environment, which helped reduce systematic bias.
From a dataset perspective, although both synthetic and real-world datasets were employed, they may not cover all possible real-world distributions. Nevertheless, the selected datasets provide a balanced and widely used benchmark for evaluating scalability and robustness across diverse settings.
The evaluation focuses primarily on runtime performance, number of matches, and observed memory consumption during preprocessing. Memory usage was measured at the process level, whereas lower-level factors such as cache behavior, garbage collection effects, and allocator overhead were not isolated separately and could have influenced the performance under specific workloads.
To ensure reproducibility, all parameter settings, datasets, and implementation details are explicitly specified. The proposed algorithm is deterministic, and all experiments were conducted under identical conditions with no hidden parameters.

6. Experimental Results and Analysis

6.1. Preprocessing Performance

The preprocessing efficiency of the proposed MMIVL algorithm is evaluated under varying segment sizes and input configurations. The results are summarized in Figure 2.
Figure 2 demonstrates that MMIVL consistently achieved the best preprocessing performance across all alphabet sizes (|Σ| = 2, 4, 16, and 64). In Figure 2a, MMIVL recorded the lowest mean runtime in every setting, ranging from 1.32 × 108 ns to 2.74 × 109 ns, while SIVL required 6.45 × 108–6.44 × 109 ns, and both HP and Aho–Corasick remained several orders of magnitude higher. The largest absolute advantage was observed at |Σ| = 64, where MMIVL required only 2.74 × 109 ns, compared with 1.04 × 1014 ns for HP and 9.61 × 1013 ns for Aho–Corasick. These results confirm that the proposed multi-character indexing structure substantially reduces preprocessing overhead.
Figure 2b further shows that MMIVL consistently outperformed all baseline methods under every experimental condition. Its advantage over SIVL was clear, while the improvements over HP and Aho–Corasick were substantially greater. Moreover, the performance gap widened as the alphabet size increased, indicating that MMIVL maintains strong scalability and becomes increasingly effective in larger and more complex search spaces. The gains became more pronounced as the alphabet size increased, indicating strong scalability. This trend is reinforced by Figure 2c, where MMIVL occupied the lowest-value region in all heatmap columns and achieved a perfect average rank of 1.00, followed by SIVL (2.00), while HP and Aho–Corasick tied at 3.50.
Figure 2d shows that MMIVL also maintained tighter distributions and lower medians across repeated trials, indicating more stable runtime behavior in addition to faster average performance. Statistical tests further confirmed that the observed improvements were significant, with p < 0.001 compared against Aho–Corasick and HP, and p < 0.01 compared against SIVL, accompanied by large to very large effect sizes. Overall, the results demonstrate that MMIVL combines low preprocessing costs, high scalability, and robust consistency, making it the most effective method among all compared approaches.

6.2. Search Performance on Synthetic Datasets

Before presenting the comparative runtime results, the experimental setup is summarized. All algorithms were evaluated under controlled conditions with text sizes ∣T∣ = 100 Bytes to 10 MB, pattern lengths ∣L∣ = 2–64 (avg. 37.33), and pattern counts ∣P∣ = 2–100,000 (avg. 28,414.67), enabling scalability and workload analysis. Descriptive statistics included the median (primary measure), minimum, maximum, standard deviation, and geometric mean. Statistical significance was assessed using the Wilcoxon signed-rank test with Holm correction. All runtimes are reported in nanoseconds (ns) on a logarithmic scale due to multi-order magnitude variation.
Figure 3 compares the proposed method under four segment-length settings (1 m, 2 m, 4 m, and 8 m) with Aho–Corasick, HP, and SIVL. Lower values indicate better performance, and runtimes are reported as the median and geometric mean on a logarithmic scale. A clear improvement trend is observed as m increases. In Figure 3a, 1 m already outperforms SIVL but remains slower than Aho–Corasick and HP.
In Figure 3b, 2 m substantially reduces runtime, surpassing HP and SIVL while still trailing Aho–Corasick. A notable transition appears in Figure 3c, where 4 m becomes faster than all baselines, including Aho–Corasick, marking the point at which the proposed method begins to dominate conventional approaches. The strongest result is shown in Figure 3d, where 8 m achieves the lowest runtime across all comparisons with large effect sizes and highly significant p-values. Overall, the results reveal a monotonic relationship between segment length and efficiency: increasing m from one to eight consistently reduces runtime and strengthens statistical superiority, confirming segment length as a key parameter of the proposed framework.
Figure 4 compares the proposed method under larger segment-length settings (8 m, 16 m, 32 m, and 64 m) using Aho–Corasick, HP, and SIVL. Lower values indicate better performance, with median and geometric mean runtimes reported on a logarithmic scale. A consistently dominant trend is observed once m ≥ 8. In Figure 4a, 8 m already achieves the lowest runtime among all methods, significantly outperforming every baseline. Figure 4b,c show that increasing the segment length from 16 m to 32 m yields further runtime reductions, with stronger effect sizes and highly significant pairwise comparisons.
The best overall performance appears in Figure 4d, where 64 m records the lowest median and geometric mean runtime in most text sizes. This confirms that larger segments substantially improve filtering selectivity and reduce verification overhead. Although the gain from 32 m to 64 m remains positive, it is smaller than earlier transitions, indicating diminishing returns at larger segment lengths. Overall, increasing m beyond eight consistently strengthens performance, with 32 m and 64 m representing the most effective practical configurations.

6.3. Scalability

The scalability of the proposed method is analyzed with respect to text size |T|, pattern set size |P|, and pattern length |L|.
A comprehensive evaluation was conducted on four dataset sizes (∣T∣ = 1 KB, 100 KB, 1 MB, and 10 MB) with 21 trials per condition. The mean runtime trends across algorithms are shown in Figure 5a, while the runtime distribution for the 32 m configuration is illustrated using boxplots in Figure 5b. These results indicate consistent performance differences and variability across methods.
Scalability results further showed that medium-to-large segments scaled better than shorter ones. In particular, 32 m maintained strong performance from 1 KB to 10 MB, while 1 m, 2 m, and SIVL degraded more rapidly. Lower variance for 16 m, 32 m, and 64 m also indicated greater robustness (Figure 5a,b).
A global Friedman test across 84 benchmark blocks confirmed significant runtime differences among algorithms (χ2 = 616.95, p < 0.001), demonstrating that the choice of algorithm strongly affects performance (Figure 5c). The 16 m and 32 m variants formed the top-performing group, with mean-rank analysis identifying 16 m as the best overall (rank = 1.93), while 32 m achieved the lowest geometric mean runtime, indicating the strongest practical efficiency. Pairwise Wilcoxon tests further showed that 32 m significantly outperformed Aho–Corasick, HP, and SIVL (p < 0.001), with no significant difference from 16 m (Figure 5d). Overall, 32 m provided the best balance of competitiveness, scalability, and real-world efficiency.
A key result was the perfect scale-matching pattern: the best configurations were 2 m, 4 m, 8 m, 16 m, 32 m, and 64 m for L = 2, 4, 8, 16, 32, and 64, respectively, establishing the empirical relation m* = L. This one-to-one correspondence suggests a reproducible scaling law rather than isolated benchmark outcomes. The runtime trends across configurations are illustrated in Figure 6a, while the distribution of the best-performing methods is shown in Figure 6b.The optimal methods also showed strong robustness, with median runtimes in the low 106–107 range and compact interquartile ranges (Figure 6b). The heatmap further confirmed this diagonal trend, indicating that matching the segment size to problem scale consistently yields the best performance and offers practical guidance for scalable high-performance filtering design (Figure 6c). The observed differences were validated using Friedman repeated-measures tests for each L, where all cases were highly significant (p < 0.001), rejecting equal performance. Increasing Friedman statistics with larger L further indicated stronger separation among methods (Figure 6d).
As shown in Figure 7a, clear runtime differences were observed across methods. The best performers were 64 m at ∣Σ∣ = 2, 16 m at ∣Σ∣ = 4 and 16, and 8 m at ∣Σ∣ = 64, while HP and SIVL were substantially slower, particularly for larger alphabets.
Stability analysis in Figure 7b further supported these results: 16 m achieved the lowest average CV%, followed by 32 m and 64 m, whereas several baselines showed much higher variability. Friedman tests confirmed significant differences for every alphabet size (all p < 0.001).
The aggregated ranking in Figure 7d identified 16 m as the best overall method (rank = 1.60), followed by 32 m, 8 m, and 64 m. Overall, 16 m provided the best balance of runtime efficiency, stability, and statistical superiority across diverse alphabet sizes.

6.4. Search Performance on Real-World Datasets

This section presents the search performance on real-world datasets. The evaluated datasets included the American National Corpus [40], the British National Corpus [39], and DNA sequences from GenBank [14]. The corresponding results are presented in Figure 8, Figure 9 and Figure 10, respectively.
Descriptive statistics identify the intermediate parameterized methods as the strongest practical performers. Across pattern sizes, 4 m, 8 m, and 16 m consistently achieved the lowest medians, small means, and lower variability, whereas HP and SIVL were slower and less stable. Growth-rate analysis further showed superior scalability. From patterns 10 to 106, these methods exhibited smaller growth factors and lower log–log slopes than HP and SIVL, indicating slower overhead expansion under large workloads.
Ranking and inferential analyses confirmed the same trend. Win counts and average ranks favored intermediate settings, while Friedman tests rejected equal performance in all cases (p < 0.001). Post hoc and effect-size analyses further showed statistically and practically meaningful advantages. Overall, 4 m, 8 m, and 16 m provide the best balance of speed, robustness, and scalability as pattern counts grow.
The experimental results show clear and consistent differences among methods. As shown in Figure 9a, intermediate parameterized methods achieved the lowest runtimes across most pattern sizes, with 4 m emerging as the strongest overall configuration. For the ∣L∣ = 64 benchmark, 4 m obtained the best average rank (1.14) and won six out of seven pattern-number conditions, while 8 m and 16 m also remained competitive. In contrast, HP and SIVL were substantially slower. Descriptive statistics further confirmed these findings: leading methods showed lower means, medians, and variabilities, indicating strong and stable performance. Scalability analysis likewise showed that top m-based methods grew more slowly from patterns 10 to 106, with favorable log–log slopes indicating better resistance to workload growth.
Figure 9b,c highlight clear practical gains over baselines. Several variants maintained speedups above one against Aho, whereas HP and SIVL were often slower than 4 m. Friedman testing confirmed significant differences (χ2 = 61.09, p = 8.27 × 10−10). Overall, 4 m provided the best balance of speed, scalability, robustness, and statistical superiority for the BNC benchmark at L = 64.
Significant differences were observed among all algorithms. The Friedman test (χ2 = 61.42, p = 7.12 × 10−10) decisively rejected equal performance, confirming that variations in runtime were statistically meaningful. Among all methods, 4 m was the best overall configuration at L = 64, achieving the lowest average rank (1.29) and the highest win count (6 of 7 tested pattern sizes). Intermediate variants such as 8 m and 16 m also remained efficient but did not surpass 4 m.
Scalability analysis further favored the intermediate methods: as pattern counts increased from 10 to 106, they showed lower growth rates and more favorable log–log slopes than baselines. Speedup and heatmap analyses likewise concentrated the best runtimes in 4 m, 8 m, and 16 m, while HP remained the slowest method. Overall, 4 m provided the best balance of speed, scalability, and robustness for the DNA benchmark at ∣L∣ = 64.

6.5. Memory Usage Analysis

Memory consumption was evaluated to assess the structural efficiency of m-CIVL under the protocol in Section 5.4, using observed process memory during preprocessing. As excessive memory can limit scalability and increase deployment costs, all methods were compared under identical conditions. Figure 11 summarizes the results through average memory usage, relative savings, statistical ranking, and heatmap analysis, providing a comprehensive comparison between the proposed multi-level configurations and baseline methods.
Figure 11 presents the statistical evaluation of memory consumption for all ten methods. The proposed multi-level configurations consistently required far less memory than the baselines (AC-Trie, RT-Trie, and SIVL), with 64 m emerging as the most efficient method. As shown in Figure 11a, 64 m achieved the lowest average memory usage (0.91 ± 0.03 KB), followed by 32 m (0.98 ± 0.04 KB) and 16 m (1.17 ± 0.05 KB). In contrast, RT-Trie, AC-Trie, and SIVL required substantially larger footprints (4.88–5.08 KB). All methods showed low variability (CV = 3.3–4.8%), indicating stable memory behavior.
Ranking and significance analyses confirmed the same result. Friedman ranks placed 64 m first, followed by 32 m and 16 m, while RT-Trie ranked last. The Friedman test showed highly significant differences (χ2 = 81.00, p < 0.000001), and the Wilcoxon tests confirmed that all proposed variants significantly outperformed RT-Trie. Overall, 64 m was the most memory-efficient and statistically dominant configuration, while the multi-level family consistently surpassed conventional trie-based baselines.

7. Discussion

This section interprets the experimental results from both theoretical and practical perspectives, emphasizing implications beyond the direct observations reported in Section 6. Overall, the findings show that the proposed framework improves not only runtime performance but also filtering quality, scalability, and resource efficiency across diverse workloads. The experiments indicate that the segment size s is the principal factor governing filtering effectiveness. Increasing s improves substring specificity, reduces collision probability, and decreases the number of candidate patterns requiring further processing. Thus, the observed speedups are mainly explained by stronger selectivity rather than implementation-level optimizations, confirming that the gains arise from the structural design of the indexing strategy itself.
The influence of alphabet size |Σ| becomes more pronounced as s increases, revealing an interaction between symbol diversity and segment granularity. In practice, datasets with richer alphabets benefit more strongly because larger symbol spaces further reduce accidental matches. The scalability trends are consistent with this interpretation, where larger segment sizes yield higher speedup while maintaining bounded degradation as workloads grow. Moreover, the empirical results closely follow the analytical expectation that candidate generation is inversely proportional to |Σ|s, indicating that the dominant search cost is well captured by the collision-based model introduced earlier. This agreement implies that performance can be predicted and tuned analytically. In particular, selecting s such that |Σ|s ≫ |P| leads to increasingly selective filtering and lower search costs, providing a practical guideline for parameter selection across datasets with different alphabet sizes and pattern volumes.
The observed scalability also indicates that the proposed method is well-suited for large pattern collections and long input texts. Because matching relies on hash-based lookup and compact structural representations rather than explicit automaton traversal, structural overhead remains controlled as the dataset expands. This explains the strong performance maintained under large-scale benchmarks. In addition, the absence of a separate verification phase simplifies deployment in systems where low latency and predictable memory usage are critical. Combined with its filtering effectiveness and analytical predictability, the proposed framework offers a practical and scalable alternative to conventional automaton-based approaches for modern large-scale string processing tasks.

8. Conclusions and Future Works

This paper presented MMIVL, a multiple string-matching algorithm based on the multi-character inverted list (m-CIVL), a unified and inherently dynamic structure for efficient pattern management. By extending the matching unit from single characters to multi-character segments, MMIVL improves filtering selectivity, reduces redundant candidate generation, and enables direct matching without a separate verification stage through integrated positional, termination, and pattern-association information. Both theoretical analysis and experimental results confirm that performance is mainly determined by the interaction between segment length and alphabet diversity: larger segments and richer alphabets reduce collisions, strengthen filtering effectiveness, shorten runtime, and improve scalability. Across synthetic and real-world datasets, MMIVL demonstrated stable behavior, strong search efficiency, and lower memory usage than conventional automaton-based methods. Overall, the proposed framework offers an effective balance of preprocessing efficiency, filtering power, and scalable search performance for large-scale multi-pattern matching under high pattern volumes and heterogeneous data distributions. Directions for future work include adaptive segment selection, multi-character shifting strategies, elimination of redundant inverted-list evaluations, and extensions to parallel and distributed environments.

Funding

This research received no external funding.

Institutional Review Board Statement

Not applicable.

Informed Consent Statement

Not applicable.

Data Availability Statement

The datasets presented in this article are not readily available because the data are part of an ongoing study and are still under further development and organization. There are also technical and time-related constraints in preparing the data and scripts for full public release.

Acknowledgments

During the preparation of this manuscript the authors used AI tools (e.g., ChatGPT) to assist in language editing and improving clarity. All scientific content, the methodology, and results were developed and verified by the authors. The authors have reviewed and edited the output and take full responsibility for the content of this publication.

Conflicts of Interest

The author declares no conflicts of interest.

References

  1. Aho, A.V.; Corasick, M.J. Efficient string matching: An aid to bibliographic search. Commun. ACM 1975, 18, 333–340. [Google Scholar] [CrossRef]
  2. Xu, H.; Chang, H.; Zhu, W.; Hong, Y.; Langdale, G.; Qiu, K.; Zhao, J. Harry: A scalable SIMD-based multi-literal pattern matching engine for deep packet inspection. In Proceedings of the IEEE INFOCOM 2023—IEEE Conference on Computer Communications, New York, NY, USA, 17–20 May 2023; pp. 1–10. [Google Scholar]
  3. Navarro, G.; Raffinot, M. Flexible Pattern Matching in Strings; Cambridge University Press: Cambridge, UK, 2002. [Google Scholar]
  4. Wu, S.; Manber, U. AGREP—A Fast Approximate Pattern-Matching Tool. In Proceedings of the USENIX Winter 1992 Technical Conference, San Francisco, CA, USA, 20–24 January 1992; pp. 153–162. [Google Scholar]
  5. Aho, A.V. Fgrep: String Matching Utilities in the UNIX Environment; Bell Laboratories Technical Report: Murray Hill, NJ, USA, 1980. [Google Scholar]
  6. Splunk Inc. Splunk Documentation: Search Processing Language (SPL) and Distributed Search for Large-Scale Log Analytics. Available online: https://help.splunk.com/ (accessed on 11 October 2025).
  7. Wang, X.; Yang, Y.; Meiners, C.; Heath, J.; Rogers, R.; Brown, M.; Smith, J.; Patel, A.; Chen, L.; Zhang, Q.; et al. Hyperscan: A Fast Multi-Pattern Regex Matcher for Modern CPUs. In Proceedings of the 16th USENIX Symposium on Networked Systems Design and Implementation (NSDI 2019), Boston, MA, USA, 26–28 February 2019; Available online: https://www.usenix.org/system/files/nsdi19-wang-xiang.pdf (accessed on 11 October 2025).
  8. Knuth, D.E.; Morris, J.H.; Pratt, V.R. Fast pattern matching in strings. SIAM J. Comput. 1977, 6, 323–350. [Google Scholar] [CrossRef]
  9. Baeza-Yates, R.; Ribeiro-Neto, B. Modern Information Retrieval; ACM Press: New York, NY, USA, 1999. [Google Scholar]
  10. Zobel, J.; Moffat, A. Inverted files for text search engines. ACM Comput. Surv. 2006, 38, 6. [Google Scholar] [CrossRef]
  11. Deguchi, H.; Kamoda, G.; Matsushita, Y.; Taguchi, C.; Suenaga, K.; Waga, M.; Yokoi, S. SoftMatcha: A Soft and Fast Pattern Matcher for Billion-Scale Corpus Searches. arXiv 2025, arXiv:2503.03703. [Google Scholar]
  12. Zhang, Y.; Liu, Q.; Chen, X. SoftMatcha 2: Scaling Multi-Pattern Matching to Trillion-Scale Corpora. arXiv 2026, arXiv:2602.10908. [Google Scholar]
  13. Navarro, G. Improved approximate pattern matching on hypertext. Theor. Comput. Sci. 2000, 237, 455–463. [Google Scholar] [CrossRef]
  14. National Center for Biotechnology Information (NCBI). GenBank. Available online: https://www.ncbi.nlm.nih.gov/genbank/ (accessed on 11 October 2025).
  15. Boyer, R.S.; Moore, J.S. A fast string searching algorithm. Commun. ACM 1977, 20, 762–772. [Google Scholar] [CrossRef]
  16. Commentz-Walter, B. A String Matching Algorithm Fast on the Average. In Proceedings of the Sixth International Colloquium on Automata, Languages and Programming; Springer: Berlin/Heidelberg, Germany, 1979; pp. 118–132. [Google Scholar]
  17. Karp, R.M.; Rabin, M.O. Efficient randomized pattern-matching algorithms. IBM J. Res. Dev. 1987, 31, 249–260. [Google Scholar] [CrossRef]
  18. Wu, S.; Manber, U. A Fast Algorithm for Multi-Pattern Searching; Technical Report TR-94-17; Department of Computer Science, University of Arizona: Tucson, AZ, USA, 1994. [Google Scholar]
  19. Khancome, C.; Boonjing, V. Inverted lists string matching algorithms. Int. J. Comput. Theory Eng. 2010, 2, 352–357. [Google Scholar] [CrossRef]
  20. Khancome, C.; Boonjing, V.; Chanvarasuth, P. A two-hashing table multiple string pattern matching algorithm. In Proceedings of the 10th International Conference on Information Technology: New Generations, Las Vegas, NV, USA, 15–17 April 2013; pp. 696–701. [Google Scholar]
  21. Zaïane, O.R. Database Management Systems: Inverted Indexes and Information Retrieval. Available online: https://webdocs.cs.ualberta.ca/~zaiane/courses/cmput391-03/slides/L7-391-03.pdf (accessed on 11 October 2025).
  22. Zobel, J.; Moffat, A. Inverted files versus signature files for text indexing. ACM Trans. Database Syst. 1998, 23, 453–490. [Google Scholar] [CrossRef]
  23. Ping, L.; Jian-Long, T.; Yan-Bing, L. A partition-Based Efficient Algorithm for Large-Scale Multiple-String Matching. In Proceedings of the 12th Symposium on String Processing and Information Retrieval; Springer: Berlin/Heidelberg, Germany, 2005; Volume 3772, pp. 53–64. [Google Scholar]
  24. Salemela, L.; Tarhio, J.; Kytöjoki, J. Multipattern string matching with q-grams. ACM J. Exp. Algorithmics 2006, 11, 1–19. [Google Scholar] [CrossRef]
  25. Kobayashi, Y.; Nakashima, Y.; Inenaga, S.; Bannai, H.; Takeda, M. Fast String Matching with q-Grams Considering Character Distances. arXiv 2020, arXiv:2002.08004. [Google Scholar]
  26. Kumar, S.; Singh, A.; Sharma, R. A Survey of String Matching Algorithms and Applications. Turk. J. Comput. Math. Educ. 2021, 12, 7649–7657. [Google Scholar]
  27. Palmer, M.N.; Faro, S.; Scafiti, S. Efficient Online String Matching through Linked Weak Factors. arXiv 2023, arXiv:2310.15711. Available online: https://arxiv.org/abs/2310.15711 (accessed on 11 October 2025).
  28. Monteiro, M.; Oliveira, A.L.; Pissis, S.P. Dynamic String Matching via Suffix Arrays. arXiv 2025, arXiv:2506.11318. [Google Scholar]
  29. Monteiro, B.; dos Santos, V. String Matching with a Dynamic Pattern. arXiv 2025, arXiv:2506.11318. [Google Scholar] [CrossRef]
  30. Kociumaka, T.; Radoszewski, J. Space-Efficient k-Mismatch Text Indexes. In Proceedings of the Annual Acm-Siam Symposium on Discrete Algorithms (SODA 2026), Arlington, VA, USA, 11–14 January 2026. [Google Scholar]
  31. Khancome, C.; Boonjing, V. Optimal linear-time multi-string pattern matching algorithm. Int. J. Comput. Sci. 2009, 3, 629–641. [Google Scholar]
  32. Crochemore, M.; Czumaj, A.; Gąsieniec, L.; Jarominek, S.; Lecroq, T.; Plandowski, W.; Rytter, W. Fast Practical Multi-Pattern Matching; Technical Report 93-3; Institute Gaspard Monge, Université de Marne-la-Vallée: Marne-la-Vallée, France, 1993. [Google Scholar]
  33. Crochemore, M.; Czumaj, A.; Gąsieniec, L.; Lecroq, T.; Plandowski, W.; Rytter, W. Fast practical multi-pattern matching. Inf. Process. Lett. 1999, 71, 107–113. [Google Scholar] [CrossRef]
  34. Raffinot, M. On the Multi Backward DAWG Matching Algorithm (MultiBDM). In Proceedings of the 4th South American Workshop on String Processing; Baeza-Yates, R., Ed.; Carleton University Press: Ottawa, ON, Canada, 1997; pp. 149–165. [Google Scholar]
  35. Hong, Y.; Ke, D.X.; Yong, C. An improved Wu-Manber multiple patterns matching algorithm. In Proceedings of the IEEE International Performance Computing and Communications Conference (IPCCC), Phoenix, AZ, USA, 10 April 2006; pp. 675–680. [Google Scholar]
  36. Monz, C.; de Rijke, M. Inverted Index Construction. Available online: http://staff.science.uva.nl/~christof/courses/ir/transparencies/clean-w-05.pdf (accessed on 29 October 2025).
  37. Botelho, F.C. Near-Optimal Space Perfect Hashing Algorithms. Ph.D. Thesis, Federal University of Minas Gerais, Belo Horizonte, Brazil, 2008. [Google Scholar]
  38. Pagh, R. Hash and Displace: Efficient Evaluation of Minimal Perfect Hash Functions. Available online: http://www.it-c.dk/people/pagh/papers/hash.pdf (accessed on 29 October 2025).
  39. BNC Consortium. British National Corpus (XML Edition). Oxford Text Archive, University of Oxford. Available online: https://ota.bodleian.ox.ac.uk/repository/xmlui/handle/20.500.12024/2554 (accessed on 11 October 2025).
  40. American National Corpus. MASC Data Download (Manually Annotated Sub-Corpus). Available online: https://anc.org/data/masc/downloads/data-download/ (accessed on 11 October 2025).
Figure 1. Comparison of multi-pattern matching paradigms. q-gram methods use filtering and verification, hashing-based methods store partial information requiring validation, and automaton-based methods (e.g., AC) enable direct matching with higher structural costs. In contrast, the proposed m-CIVL provides a unified representation of positional, termination, and pattern-level information, enabling direct matching without verification and efficient dynamic updates.
Figure 1. Comparison of multi-pattern matching paradigms. q-gram methods use filtering and verification, hashing-based methods store partial information requiring validation, and automaton-based methods (e.g., AC) enable direct matching with higher structural costs. In contrast, the proposed m-CIVL provides a unified representation of positional, termination, and pattern-level information, enabling direct matching without verification and efficient dynamic updates.
Algorithms 19 00362 g001
Figure 2. Comparative preprocessing performance of MMIVL, SIVL, HP, and Aho–Corasick across alphabet sizes (|Σ| = 2, 4, 16, and 64): (a) mean preprocessing runtime; (b) improvement in relative performance; (c) heatmap of average ranks; and (d) runtime distribution across repeated trials. MMIVL consistently achieved the lowest preprocessing cost, highest scalability, and most stable performance under all experimental conditions.
Figure 2. Comparative preprocessing performance of MMIVL, SIVL, HP, and Aho–Corasick across alphabet sizes (|Σ| = 2, 4, 16, and 64): (a) mean preprocessing runtime; (b) improvement in relative performance; (c) heatmap of average ranks; and (d) runtime distribution across repeated trials. MMIVL consistently achieved the lowest preprocessing cost, highest scalability, and most stable performance under all experimental conditions.
Algorithms 19 00362 g002
Figure 3. Runtime comparison of the proposed method with segment lengths m = 1, 2, 4, and 8 against Aho–Corasick, HP, and SIVL. Panels show: (a) 1 m, (b) 2 m, (c) 4 m, and (d) 8 m. Blue bars indicate median runtime and orange bars indicate geometric mean runtime (ns, log scale). Annotations report adjusted Wilcoxon tests, confidence intervals, and effect sizes. Performance improves as m increases: 4 m surpasses classical baselines, while 8 m achieves the best runtime.
Figure 3. Runtime comparison of the proposed method with segment lengths m = 1, 2, 4, and 8 against Aho–Corasick, HP, and SIVL. Panels show: (a) 1 m, (b) 2 m, (c) 4 m, and (d) 8 m. Blue bars indicate median runtime and orange bars indicate geometric mean runtime (ns, log scale). Annotations report adjusted Wilcoxon tests, confidence intervals, and effect sizes. Performance improves as m increases: 4 m surpasses classical baselines, while 8 m achieves the best runtime.
Algorithms 19 00362 g003
Figure 4. Runtime comparison of the proposed method with large segment lengths (m = 8, 16, 32, and 64) against Aho–Corasick, HP, and SIVL. Panels show: (a) 8 m, (b) 16 m, (c) 32 m, and (d) 64 m. Blue bars indicate median runtime and orange bars indicate geometric mean runtime (ns, log scale). The insets represent Wilcoxon tests, confidence intervals, and effect sizes. The proposed method outperforms all baselines for m ≥ 8, with the best results at 32 m and 64 m, although gains diminish at larger segment lengths.
Figure 4. Runtime comparison of the proposed method with large segment lengths (m = 8, 16, 32, and 64) against Aho–Corasick, HP, and SIVL. Panels show: (a) 8 m, (b) 16 m, (c) 32 m, and (d) 64 m. Blue bars indicate median runtime and orange bars indicate geometric mean runtime (ns, log scale). The insets represent Wilcoxon tests, confidence intervals, and effect sizes. The proposed method outperforms all baselines for m ≥ 8, with the best results at 32 m and 64 m, although gains diminish at larger segment lengths.
Algorithms 19 00362 g004
Figure 5. Statistical comparison of algorithm performance across text sizes |T|. (a) Mean runtime with 95% confidence intervals (log scale). (b) Runtime distribution of the 32 m configuration by boxplots. (c) Critical difference diagram from Friedman mean ranks (where lower is better). (d) Adjusted pairwise significance heatmap based on Wilcoxon tests with multiple-comparison correction. Color intensity and symbols indicate significance levels (* p < 0.05, ** p < 0.01, *** p < 0.001).
Figure 5. Statistical comparison of algorithm performance across text sizes |T|. (a) Mean runtime with 95% confidence intervals (log scale). (b) Runtime distribution of the 32 m configuration by boxplots. (c) Critical difference diagram from Friedman mean ranks (where lower is better). (d) Adjusted pairwise significance heatmap based on Wilcoxon tests with multiple-comparison correction. Color intensity and symbols indicate significance levels (* p < 0.05, ** p < 0.01, *** p < 0.001).
Algorithms 19 00362 g005
Figure 6. Runtime and statistical comparison across all values of L. (a) Geometric mean runtime for all methods over |L| = {2, 4, 8, 16, 32, 64} (log scale). (b) Boxplots of the best method for each L. (c) Heatmap of log10 (geometric mean runtime), where darker cells indicate lower runtime. (d) Friedman chi-square statistics for each L, all of which are highly significant (p < 0.001). Results show scale-dependent optimality, with the best performance achieved when the segment size matched the corresponding scale.
Figure 6. Runtime and statistical comparison across all values of L. (a) Geometric mean runtime for all methods over |L| = {2, 4, 8, 16, 32, 64} (log scale). (b) Boxplots of the best method for each L. (c) Heatmap of log10 (geometric mean runtime), where darker cells indicate lower runtime. (d) Friedman chi-square statistics for each L, all of which are highly significant (p < 0.001). Results show scale-dependent optimality, with the best performance achieved when the segment size matched the corresponding scale.
Algorithms 19 00362 g006
Figure 7. Statistical comparison of algorithm performance across alphabet sizes (|Σ| = 2, 4, 16, and 64). (a) Median runtime (ns). (b) Stability analysis using coefficient of variation (CV%). (c) Friedman significance test results for each alphabet size. (d) Overall ranking based on average Friedman ranks (where lower is better). All values were obtained from repeated trials under identical conditions.
Figure 7. Statistical comparison of algorithm performance across alphabet sizes (|Σ| = 2, 4, 16, and 64). (a) Median runtime (ns). (b) Stability analysis using coefficient of variation (CV%). (c) Friedman significance test results for each alphabet size. (d) Overall ranking based on average Friedman ranks (where lower is better). All values were obtained from repeated trials under identical conditions.
Algorithms 19 00362 g007
Figure 8. Performance analysis of the American National Corpus (ANC) [40] across increasing pattern numbers under L = 64. (a) Median runtime (ns) versus number of patterns (10–106, log scale). (b) Rank trajectory for each pattern size (1 = best). (c) Speedup relative to Aho, computed as TAho/Tmethod. (d) Heatmap of log10(runtime). Overall, intermediate parameterized methods provide the best balance of efficiency, scalability, and ranking stability as pattern numbers increase.
Figure 8. Performance analysis of the American National Corpus (ANC) [40] across increasing pattern numbers under L = 64. (a) Median runtime (ns) versus number of patterns (10–106, log scale). (b) Rank trajectory for each pattern size (1 = best). (c) Speedup relative to Aho, computed as TAho/Tmethod. (d) Heatmap of log10(runtime). Overall, intermediate parameterized methods provide the best balance of efficiency, scalability, and ranking stability as pattern numbers increase.
Algorithms 19 00362 g008
Figure 9. Performance analysis of the British National Corpus (BNC) [39] across increasing pattern numbers under L = 64. (a) Median runtime (ns) versus number of patterns (10–106, log scale). (b) Rank trajectory of each pattern size (1 = best). (c) Speedup relative to Aho, computed as TAho/Tmethod. (d) Heatmap of log 10 (runtime). Overall, intermediate parameterized methods provide the best balance of efficiency, scalability, and ranking stability as pattern numbers increase.
Figure 9. Performance analysis of the British National Corpus (BNC) [39] across increasing pattern numbers under L = 64. (a) Median runtime (ns) versus number of patterns (10–106, log scale). (b) Rank trajectory of each pattern size (1 = best). (c) Speedup relative to Aho, computed as TAho/Tmethod. (d) Heatmap of log 10 (runtime). Overall, intermediate parameterized methods provide the best balance of efficiency, scalability, and ranking stability as pattern numbers increase.
Algorithms 19 00362 g009
Figure 10. Evaluation of the statistical performance of the DNA benchmark from GenBank [14] under |L| = 64. (a) Median runtime (ns) versus pattern number (10–106, log–log scale). (b) Speedup relative to Aho, computed as TAho/Tmethod. (c) Heatmap of log10(runtime), where darker cells indicate lower cost. (d) Statistical summary including best method, average rank, win count, Friedman statistic, and p-value.
Figure 10. Evaluation of the statistical performance of the DNA benchmark from GenBank [14] under |L| = 64. (a) Median runtime (ns) versus pattern number (10–106, log–log scale). (b) Speedup relative to Aho, computed as TAho/Tmethod. (c) Heatmap of log10(runtime), where darker cells indicate lower cost. (d) Statistical summary including best method, average rank, win count, Friedman statistic, and p-value.
Algorithms 19 00362 g010
Figure 11. Statistical comparison of memory consumption across all methods. (a) Mean memory usage ± SD, ordered from lowest to highest. (b) Relative memory saving (%) using RT-Trie as baseline. (c) Mean Friedman rank (where lower is better). (d) Heatmap of average memory usage (KB). Across all views, multi-level configurations, especially 64 m, 32 m, and 16 m, achieved superior memory efficiency over conventional trie-based baselines.
Figure 11. Statistical comparison of memory consumption across all methods. (a) Mean memory usage ± SD, ordered from lowest to highest. (b) Relative memory saving (%) using RT-Trie as baseline. (c) Mean Friedman rank (where lower is better). (d) Heatmap of average memory usage (KB). Across all views, multi-level configurations, especially 64 m, 32 m, and 16 m, achieved superior memory efficiency over conventional trie-based baselines.
Algorithms 19 00362 g011
Table 1. Comparative analysis of representative multiple string-matching paradigms and the proposed m-CIVL representation. The comparison emphasizes differences in representational completeness, direct matching capability, and support for dynamic updates.
Table 1. Comparative analysis of representative multiple string-matching paradigms and the proposed m-CIVL representation. The comparison emphasizes differences in representational completeness, direct matching capability, and support for dynamic updates.
MethodParadigmRepresentation PowerDirect MatchingUpdate Support
q-gramFiltering + VerificationPartialRebuild
Block hashingFiltering + VerificationPartialRebuild
SIVLIndexed Matching (1-char)StructuredEfficient
AC-trieAutomaton-based MatchingCompleteLimited
Reverse trieReverse Automaton MatchingCompleteLimited
m-CIVL (proposed)Direct Structural MatchingCompleteEfficient
Table 2. Parameter settings used in the experiments.
Table 2. Parameter settings used in the experiments.
ParameterSymbolDescriptionValue/RangeNotes
Segment sizesLength of each substring block{2,4,8,16,32,64}Controls decomposition granularity
Pattern lengthmLength of the shortest patternDataset-dependentUsed to compute (k = m/s)
Number of patterns|P|Total number of patterns in the dataset10–100,000Affects search complexity and scalability
Text length|T|Length of the input text100 Byte–10 MBImpacts runtime performance
Alphabet sizeΣNumber of distinct characters{2,4,16,64}Controls variability
Number of segmentskSegments per patternm/sImpacts matching depth
Hash structureData structure for HTmHashtable + HashSetTwo-level mapping
Termination flagIndicates last segment{0, 1}Used in matching logic
Timing methodRuntime measurementSystem.nanoTime()High-resolution timing
Memory measurementProcess memory during preprocessingWindows Task ManagerDifference before/after construction
Number of runsIndependent repetitions for runtime and memory experiments≥10Average reported
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

Khancome, C. Multiple String Pattern Matching Algorithm Using Multi-Character Inverted Lists. Algorithms 2026, 19, 362. https://doi.org/10.3390/a19050362

AMA Style

Khancome C. Multiple String Pattern Matching Algorithm Using Multi-Character Inverted Lists. Algorithms. 2026; 19(5):362. https://doi.org/10.3390/a19050362

Chicago/Turabian Style

Khancome, Chouvalit. 2026. "Multiple String Pattern Matching Algorithm Using Multi-Character Inverted Lists" Algorithms 19, no. 5: 362. https://doi.org/10.3390/a19050362

APA Style

Khancome, C. (2026). Multiple String Pattern Matching Algorithm Using Multi-Character Inverted Lists. Algorithms, 19(5), 362. https://doi.org/10.3390/a19050362

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