Abstract. We study the Submass Finding Problem: Given a string s over a weighted alphabet, i.e., an alphabet Σ with a weight function μ : Σ → N, decide for an input mass M whether s has a substring whose weights sum up to M. If M is indeed a submass, then we want to find one or all occurrences of such substrings. We present efficient algorithms for both the decision and the search problem. Furthermore, our approach allows us to compute efficiently the number of different submasses of s. The main idea of our algorithms is to define appropriate polynomials such that we can determine the solution for the Submass Finding Prob- lem from the coefficients of the product of these polynomials. We obtain very efficient running times by using Fast Fourier Transform to compute this product. Our main algorithm for the decision problem runs in time O(μs log μs), where μs is the total mass of string s. Employing stan- dard methods for compressing sparse polynomials, this runtime can be viewed as O(σ(s) log2 σ(s)), where σ(s) denotes the number of different submasses of s. In this case, the runtime is independent of the size of the individual masses of characters.
Efficient Algorithms for Finding Submasses in Weighted Strings
Liptak, Zsuzsanna
2004-01-01
Abstract
Abstract. We study the Submass Finding Problem: Given a string s over a weighted alphabet, i.e., an alphabet Σ with a weight function μ : Σ → N, decide for an input mass M whether s has a substring whose weights sum up to M. If M is indeed a submass, then we want to find one or all occurrences of such substrings. We present efficient algorithms for both the decision and the search problem. Furthermore, our approach allows us to compute efficiently the number of different submasses of s. The main idea of our algorithms is to define appropriate polynomials such that we can determine the solution for the Submass Finding Prob- lem from the coefficients of the product of these polynomials. We obtain very efficient running times by using Fast Fourier Transform to compute this product. Our main algorithm for the decision problem runs in time O(μs log μs), where μs is the total mass of string s. Employing stan- dard methods for compressing sparse polynomials, this runtime can be viewed as O(σ(s) log2 σ(s)), where σ(s) denotes the number of different submasses of s. In this case, the runtime is independent of the size of the individual masses of characters.File | Dimensione | Formato | |
---|---|---|---|
FFT_CPM2004.pdf
solo utenti autorizzati
Tipologia:
Versione dell'editore
Licenza:
Copyright dell'editore
Dimensione
186.26 kB
Formato
Adobe PDF
|
186.26 kB | Adobe PDF | Visualizza/Apri Richiedi una copia |
I documenti in IRIS sono protetti da copyright e tutti i diritti sono riservati, salvo diversa indicazione.