About cookies on this site Our websites require some cookies to function properly (required). In addition, other cookies may be used with your consent to analyze site usage, improve the user experience and for advertising. For more information, please review your options. By visiting our website, you agree to our processing of information as described in IBM’sprivacy statement. To provide a smooth navigation, your cookie preferences will be shared across the IBM web domains listed here.
Publication
Discrete Applied Mathematics
Paper
Finding submasses in weighted strings with Fast Fourier Transform
Abstract
We study the Submass Finding Problem: given a string s over a weighted alphabet, i.e., an alphabet Σ with a weight function μ : Σ → N, we refer to a mass M ∈ N as a submass of s if s has a substring whose weights sum up to M. Now, for a set of input masses { M1, ..., Mk }, we want to find those Mi which are submasses of s, and return one or all occurrences of substrings with mass Mi. 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 Problem 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 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. © 2006 Elsevier B.V. All rights reserved.