Two sequences of integers x and z of the same length m ≥ 2 are shape-isomorphic if, up to a positive proportional factor, the sequences of the distances between consecutive elements of x and z are the same, i.e., if for some ρ > 0 one has x[i + 1] − x[i] = ρ(z[i + 1] − z[i]), for each 1 ≤ i ≤ m − 1. In this paper we present two linear-time algorithms which, given a text y and a pattern x over an integer alphabet, finds all the factors of y that are shape-isomorphic to x. Our first solution is a two steps algorithm based on a reduction to the standard exact string matching problem, while our second solution is an online algorithm based on the well-known Knuth-Morris-Pratt string matching algorithm. We call this problem shape-preserving pattern-matching problem.
Shape-preserving pattern matching
Cantone D.;Faro S.
;
2020-01-01
Abstract
Two sequences of integers x and z of the same length m ≥ 2 are shape-isomorphic if, up to a positive proportional factor, the sequences of the distances between consecutive elements of x and z are the same, i.e., if for some ρ > 0 one has x[i + 1] − x[i] = ρ(z[i + 1] − z[i]), for each 1 ≤ i ≤ m − 1. In this paper we present two linear-time algorithms which, given a text y and a pattern x over an integer alphabet, finds all the factors of y that are shape-isomorphic to x. Our first solution is a two steps algorithm based on a reduction to the standard exact string matching problem, while our second solution is an online algorithm based on the well-known Knuth-Morris-Pratt string matching algorithm. We call this problem shape-preserving pattern-matching problem.File | Dimensione | Formato | |
---|---|---|---|
Cantone2020-ShapePreserving-paper_13.pdf
accesso aperto
Tipologia:
Documento in Post-print
Licenza:
Creative commons
Dimensione
593.56 kB
Formato
Adobe PDF
|
593.56 kB | Adobe PDF | Visualizza/Apri |
I documenti in IRIS sono protetti da copyright e tutti i diritti sono riservati, salvo diversa indicazione.