%0 Journal Article %T Optimal pattern matching algorithms %+ Institut de Mathématiques de Marseille (I2M) %+ Institut Montpelliérain Alexander Grothendieck (IMAG) %A Didier, Gilles %< avec comité de lecture %@ 0885-064X %J Journal of Complexity %I Elsevier %V 51 %P 79 - 109 %8 2019-04 %D 2019 %Z 1604.08437 %R 10.1016/j.jco.2018.10.003 %Z Computer Science [cs]/Computational Complexity [cs.CC] %Z Mathematics [math]/Probability [math.PR]Journal articles %X We study a class of finite state machines, called w-matching machines, which yield to simulate the behavior of pattern matching algorithms while searching for a pattern w. They can be used to compute the asymptotic speed, i.e. the limit of the expected ratio of the number of text accesses to the length of the text, of algorithms while parsing an iid text to find the pattern w. Defining the order of a matching machine or of an algorithm as the maximum difference between the current and accessed positions during a search (standard algorithms are generally of order |w|), we show that being given a pattern w, an order k and an iid model, there exists an optimal w-matching machine, i.e. with the greatest asymptotic speed under the model among all the machines of order k, of which the set of states belongs to a finite and enumerable set. It shows that it is possible to determine: 1) the greatest asymptotic speed among a large class of algorithms, with regard to a pattern and an iid model, and 2) a w-matching machine, thus an algorithm, achieving this speed. %G English %2 https://hal.science/hal-01310164/document %2 https://hal.science/hal-01310164/file/MatchingMachine.pdf %L hal-01310164 %U https://hal.science/hal-01310164 %~ CNRS %~ UNIV-AMU %~ I3M_UMR5149 %~ EC-MARSEILLE %~ I2M %~ I2M-2014- %~ IMAG-MONTPELLIER %~ MIPS %~ UNIV-MONTPELLIER %~ UM-2015-2021