Space Lower Bounds for Online Pattern Matching

  • Raphaël Clifford
  • Markus Jalsenius
  • Ely Porat
  • Benjamin Sach
Conference paper
Part of the Lecture Notes in Computer Science book series (LNCS, volume 6661)


We present space lower bounds for online pattern matching under a number of different distance measures. Given a pattern of length m and a text that arrives one character at a time, the online pattern matching problem is to report the distance between the pattern and a sliding window of the text as soon as the new character arrives. We require that the correct answer is given at each position with constant probability. We give Ω(m) bit space lower bounds for L 1, L 2, L  ∞ , Hamming, edit and swap distances as well as for any algorithm that computes the cross-correlation/convolution. We then show a dichotomy between distance functions that have wildcard-like properties and those that do not. In the former case which includes, as an example, pattern matching with character classes, we give Ω(m) bit space lower bounds. For other distance functions, we show that there exist space bounds of Ω(logm) and O(log2 m) bits. Finally we discuss space lower bounds for non-binary inputs and show how in some cases they can be improved.


Hash Function Pattern Match Communication Complexity Edit Distance Character Class 
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.


Unable to display preview. Download preview PDF.

Unable to display preview. Download preview PDF.


  1. 1.
    Amir, A., Aumann, Y., Landau, G., Lewenstein, M., Lewenstein, N.: Pattern Matching with Swaps. Journal of Algorithms 37, 247–266 (2000)MathSciNetCrossRefzbMATHGoogle Scholar
  2. 2.
    Bar-Yossef, Z., Jayram, T.S., Krauthgamer, R., Kumar, R.: Approximating edit distance efficiently. In: FOCS 2004: Proc. 45th Annual Symp. Foundations of Computer Science, pp. 550–559 (2004)Google Scholar
  3. 3.
    Chor, B., Goldreich, O.: Unbiased bits from sources of weak randomness and probabilistic communication complexity. SIAM Journal on Computing 17(2), 230–261 (1988)MathSciNetCrossRefzbMATHGoogle Scholar
  4. 4.
    Datar, M., Gionis, A., Inkyk, P., Motwani, R.: Maintaining stream statistics over sliding windows. SIAM Journal on computing 31(6), 1794–1813 (2002)MathSciNetCrossRefzbMATHGoogle Scholar
  5. 5.
    Huang, W., Shi, Y., Zhang, S., Zhu, Y.: The communication complexity of the Hamming distance problem. Information Processing Letters 99(4), 149–153 (2006)MathSciNetCrossRefzbMATHGoogle Scholar
  6. 6.
    Jayram, T.S., Kumar, R., Sivakumar, D.: The one-way communication complexity of hamming distance. Theory of Computing 4(1), 129–135 (2008)MathSciNetCrossRefzbMATHGoogle Scholar
  7. 7.
    Kushilevitz, E., Nisan, N.: Communication complexity. Cambridge University Press, Cambridge (1997)CrossRefzbMATHGoogle Scholar
  8. 8.
    Linhart, C., Shamir, R.: Faster pattern matching with character classes using prime number encoding. Journal of Computer and System Sciences 75(3), 155–162 (2009)MathSciNetCrossRefzbMATHGoogle Scholar
  9. 9.
    Muthukrishnan, S., Ramesh, H.: String matching under a general matching relation. Inf. Comput. 122(1), 140–148 (1995)MathSciNetCrossRefzbMATHGoogle Scholar
  10. 10.
    Newman, I.: Private vs. common random bits in communication complexity. Information Processing Letters 39(2), 67–71 (1991)MathSciNetCrossRefzbMATHGoogle Scholar
  11. 11.
    Nisan, N.: Personal communication (2011)Google Scholar
  12. 12.
    Pǎtraşcu, M.: CC4: One-Way Communication and a Puzzle, 2009 (accessed January 20, 2011),
  13. 13.
    Porat, B., Porat, E.: Exact and approximate pattern matching in the streaming model. In: FOCS 2009: Proc. 50th Annual Symp. Foundations of Computer Science, pp. 315–323 (2009)Google Scholar
  14. 14.
    Yao, A.C.-C.: Some complexity questions related to distributive computing. In: STOC 1979: Proc. 11th Annual ACM Symp. Theory of Computing, pp. 209–213 (1979)Google Scholar

Copyright information

© Springer-Verlag Berlin Heidelberg 2011

Authors and Affiliations

  • Raphaël Clifford
    • 1
  • Markus Jalsenius
    • 1
  • Ely Porat
    • 2
  • Benjamin Sach
    • 1
  1. 1.Dept. of Computer ScienceUniversity of BristolBristolUK
  2. 2.Dept. of Computer ScienceBar-Ilan UniversityRamat-GanIsrael

Personalised recommendations