CPM 2006: Combinatorial Pattern Matching pp 188-199

# Property Matching and Weighted Matching

• Amihood Amir
• Eran Chencinski
• Costas Iliopoulos
• Tsvi Kopelowitz
• Hui Zhang
Conference paper
Part of the Lecture Notes in Computer Science book series (LNCS, volume 4009)

## Abstract

Pattern Matching with Properties (Property Matching, for short), involves a string matching between the pattern and the text, and the requirement that the text part satisfies some property.

It is straightforward to do sequential matching in a text with properties. However, indexing in a text with properties becomes difficult if we desire the time to be output dependent. We present an algorithm for indexing a text with properties in O(nlog|Σ|+n loglogn) time for preprocessing and O(|P|log|Σ|+tocc π ) per query, where n is the length of the text, P is the sought pattern, Σ is the alphabet, and tocc π is the number of occurrences of the pattern that satisfy some property π.

As a practical use of Property Matching we show how to solve Weighted Matching problems using techniques from Property Matching. Weighted sequences have been introduced as a tool to handle a set of sequences that are not identical but have many local similarities. The weighted sequence is a “statistical image” of this set, where we are given the probability of every symbol’s occurrence at every text location. Weighted matching problems are pattern matching problems where the given text is weighted.

We present a reduction from Weighted Matching to Property Matching that allows off-the-shelf solutions to numerous weighted matching problems including indexing, swapped matching, parameterized matching, approximate matching, and many more. Assuming that one seeks the occurrence of pattern P with probability ε in weighted text T of length n, we reduce the problem to a property matching problem of pattern P in text T′ of length $$O(n(\frac{1}{\epsilon})^2 \log \frac{1}{\epsilon})$$.

## Keywords

Pattern Match Match Problem Query Time Weighted Match Approximate Match
These keywords were added by machine and not by the authors. This process is experimental and the keywords may be updated as the learning algorithm improves.

## References

1. 1.
Amir, A., Keselman, D., Landau, G., Lewenstein, M., Lewenstein, N., Rodeh, M.: Indexing and dictionary matching with one error. Journal of Algorithms 37, 309–325 (2000); Preliminary version appeared in Dehne, F., Gupta, A., Sack, J.-R., Tamassia, R. (eds.) WADS 1999. LNCS, vol. 1663, pp. 181–192. Springer, Heidelberg (1999)
2. 2.
Cormen, T.H., Leiserson, C.E., Rivest, R.L., Stein, C.: Introduction to Algorithms, 2nd edn. MIT Press and McGraw-Hill (2001)Google Scholar
3. 3.
Farach, M., Muthukrishnan, S.: Perfect hashing for strings: Formalization and algorithms. In: Proc. 7th Combinatorial Pattern Matching Conference (CPM), pp. 130–140 (1996)Google Scholar
4. 4.
Iliopoulos, C.S., Mouchard, L., Perdikuri, K., Tsakalidis, A.: Computing the repetitions in a weighted sequence. In: Proceeding of the Prague Stringology Conference, pp. 91–98 (2003)Google Scholar
5. 5.
Thompson, J.D., Higgins, D.G., Gibson, T.J.: Clustal w: Improving the sensitivity of progressive multiple sequence alignment through sequence weighting, position-specific gap penalties and weight matrix choice. Nucleic Acids Research 22, 4673–4680 (1994)
6. 6.
Weiner, P.: Linear pattern matching algorithm. In: Proc. 14 IEEE Symposium on Switching and Automata Theory, pp. 1–11 (1973)Google Scholar

## Authors and Affiliations

• Amihood Amir
• 1
• Eran Chencinski
• 2
• Costas Iliopoulos
• 3
• Tsvi Kopelowitz
• 2
• Hui Zhang
• 3
1. 1.Department of Computer Science, Bar-Ilan University, Ramat-Gan 52900, Israel and College of Computing, Georgia TechAtlantaUSA
2. 2.Dept. of Computer ScienceBar-Ilan U.Ramat-GanIsrael
3. 3.Department of Computer ScienceKing’s College LondonStrand, LondonUnited Kingdom