Javascript must be enabled to continue!
On the Practical Power of Automata in Pattern Matching
View through CrossRef
AbstractMany papers in the intersection of theoretical and applied algorithms show that the simple, asymptotically less efficient algorithm, performs better than the bestcomplex theoretical algorithms on random data or in specialized “real world” applications. This paper considers the Knuth–Morris–Pratt automaton, and shows a counter-intuitive practical result. The classical pattern matching paradigm is that of seeking occurrences of one string—the pattern, in another—the text, where both strings are drawn from an alphabet set $$\Sigma$$
Σ
. Assuming the text length is n and the pattern length is m, this problem can naively be solved in time O(nm). In Knuth, Morris and Pratt’s seminal paper of 1977, an automaton, was developed that allows solving this problem in time O(n) for any alphabet. This automaton, which we will refer to as the KMP-automaton, has proven useful in solving many other problems. A notable example is the parameterized pattern matching model. In this model, a consistent renaming of symbols from $$\Sigma$$
Σ
is allowed in a match. The parameterized matching paradigm has proven useful in problems in software engineering, computer vision, and other applications. It has long been believed that for texts where the symbols are uniformly random, the naive algorithm will perform as well as the KMP algorithm. In this paper, we examine the practical efficiency of the KMP algorithm versus the naive algorithm on a randomly generated text. We analyze the time under various parameters, such as alphabet size, pattern length, and the distribution of pattern occurrences in the text. We do this for both the original exact matching problem and parameterized matching. While the folklore wisdom is vindicated by these findings for the exact matching case, surprisingly, the KMP algorithm always works significantly faster than the naive in the parameterized matching case. We check this hypothesis for DNA texts and image data and observe a similar behavior as in the random text. We also show a very structured exact matching case where the automaton is much more efficient.
Springer Science and Business Media LLC
Title: On the Practical Power of Automata in Pattern Matching
Description:
AbstractMany papers in the intersection of theoretical and applied algorithms show that the simple, asymptotically less efficient algorithm, performs better than the bestcomplex theoretical algorithms on random data or in specialized “real world” applications.
This paper considers the Knuth–Morris–Pratt automaton, and shows a counter-intuitive practical result.
The classical pattern matching paradigm is that of seeking occurrences of one string—the pattern, in another—the text, where both strings are drawn from an alphabet set $$\Sigma$$
Σ
.
Assuming the text length is n and the pattern length is m, this problem can naively be solved in time O(nm).
In Knuth, Morris and Pratt’s seminal paper of 1977, an automaton, was developed that allows solving this problem in time O(n) for any alphabet.
This automaton, which we will refer to as the KMP-automaton, has proven useful in solving many other problems.
A notable example is the parameterized pattern matching model.
In this model, a consistent renaming of symbols from $$\Sigma$$
Σ
is allowed in a match.
The parameterized matching paradigm has proven useful in problems in software engineering, computer vision, and other applications.
It has long been believed that for texts where the symbols are uniformly random, the naive algorithm will perform as well as the KMP algorithm.
In this paper, we examine the practical efficiency of the KMP algorithm versus the naive algorithm on a randomly generated text.
We analyze the time under various parameters, such as alphabet size, pattern length, and the distribution of pattern occurrences in the text.
We do this for both the original exact matching problem and parameterized matching.
While the folklore wisdom is vindicated by these findings for the exact matching case, surprisingly, the KMP algorithm always works significantly faster than the naive in the parameterized matching case.
We check this hypothesis for DNA texts and image data and observe a similar behavior as in the random text.
We also show a very structured exact matching case where the automaton is much more efficient.
Related Results
Simulations for Event-Clock Automata
Simulations for Event-Clock Automata
Event-clock automata (ECA) are a well-known semantic subclass of timed
automata (TA) which enjoy admirable theoretical properties, e.g.,
determinizability, and are practically usef...
A Unified Model for Real-Time Systems: Symbolic Techniques and Implementation
A Unified Model for Real-Time Systems: Symbolic Techniques and Implementation
AbstractIn this paper, we consider a model of generalized timed automata (GTA) with two kinds of clocks, history and future, that can express many timed features succinctly, includ...
Permutation Groups in Automata Diagrams
Permutation Groups in Automata Diagrams
Automata act as classical models for recognition devices. From the previous researches, the classical models of automata have been used to scan strings and to determine the types o...
FUZZY‐FUZZY AUTOMATA
FUZZY‐FUZZY AUTOMATA
Based on the concept of fuzzy sets of type 2 (or fuzzy‐fuzzy sets) defined by L. A. Zadeh, fuzzy‐fuzzy automata ate newly formulated and some properties of these automata are inves...
Minimisation and Language Inclusion for Separating B\"uchi and Parity Automata
Minimisation and Language Inclusion for Separating B\"uchi and Parity Automata
We provide simple proofs of the NC results for the universality, language inclusion, and equivalence problems of unambiguous finite automata, based on recent advances in model chec...
From Macro Plans to Automata Plans
From Macro Plans to Automata Plans
Macros have a long-standing role in planning as a tool for representing repeating subsequences of operators. Macros are useful both for guiding search towards a solution and for re...
A Fast Pattern Matching Algorithm Based on Middle Characters of Pattern String
A Fast Pattern Matching Algorithm Based on Middle Characters of Pattern String
String pattern matching is one of the important string operation. At present, the pattern matching algorithm of strings mainly includes BF algorithm, KMP algorithm, and improved KM...
2021 Census to Census Coverage Survey Matching Results.
2021 Census to Census Coverage Survey Matching Results.
The 2021 England and Wales Census was matched to the Census Coverage Survey (CCS). This was an essential requisite for estimating undercount in the Census. To ensure outputs could ...

