Papers
Topics
Authors
Recent
Gemini 2.5 Flash
Gemini 2.5 Flash
97 tokens/sec
GPT-4o
53 tokens/sec
Gemini 2.5 Pro Pro
43 tokens/sec
o3 Pro
4 tokens/sec
GPT-4.1 Pro
47 tokens/sec
DeepSeek R1 via Azure Pro
28 tokens/sec
2000 character limit reached

Optimal Bounds for Distinct Quartics (2403.06667v1)

Published 11 Mar 2024 in cs.DS and math.CO

Abstract: A fundamental concept related to strings is that of repetitions. It has been extensively studied in many versions, from both purely combinatorial and algorithmic angles. One of the most basic questions is how many distinct squares, i.e., distinct strings of the form $UU$, a string of length $n$ can contain as fragments. It turns out that this is always $\mathcal{O}(n)$, and the bound cannot be improved to sublinear in $n$ [Fraenkel and Simpson, JCTA 1998]. Several similar questions about repetitions in strings have been considered, and by now we seem to have a good understanding of their repetitive structure. For higher-dimensional strings, the basic concept of periodicity has been successfully extended and applied to design efficient algorithms -- it is inherently more complex than for regular strings. Extending the notion of repetitions and understanding the repetitive structure of higher-dimensional strings is however far from complete. Quartics were introduced by Apostolico and Brimkov [TCS 2000] as analogues of squares in two dimensions. Charalampopoulos, Radoszewski, Rytter, Wale\'n, and Zuba [ESA 2020] proved that the number of distinct quartics in an $n\times n$ 2D string is $\mathcal{O}(n2 \log2 n)$ and that they can be computed in $\mathcal{O}(n2 \log2 n)$ time. Gawrychowski, Ghazawi, and Landau [SPIRE 2021] constructed an infinite family of $n \times n$ 2D strings with $\Omega(n2 \log n)$ distinct quartics. This brings the challenge of determining asymptotically tight bounds. Here, we settle both the combinatorial and the algorithmic aspects of this question: the number of distinct quartics in an $n\times n$ 2D string is $\mathcal{O}(n2 \log n)$ and they can be computed in the worst-case optimal $\mathcal{O}(n2 \log n)$ time.

Definition Search Book Streamline Icon: https://streamlinehq.com
References (75)
  1. Efficient two-dimensional compressed matching. In Data Compression Conference, pages 279–288. IEEE Computer Society, 1992. doi:10.1109/DCC.1992.227453.
  2. Two-dimensional periodicity in rectangular arrays. SIAM J. Comput., 27(1):90–106, 1998. doi:10.1137/S0097539795298321.
  3. An alphabet independent approach to two-dimensional pattern matching. SIAM Journal on Computing, 23(2):313–323, 1994. doi:10.1137/S0097539792226321.
  4. Optimal two-dimensional compressed matching. J. Algorithms, 24(2):354–379, 1997. doi:10.1006/JAGM.1997.0860.
  5. Optimal parallel two dimensional text searching on a CREW PRAM. Inf. Comput., 144(1):1–17, 1998. doi:10.1006/INCO.1998.2705.
  6. Real two dimensional scaled matching. Algorithmica, 53(3):314–336, 2009. doi:10.1007/S00453-007-9021-X.
  7. Faster two dimensional scaled matching. Algorithmica, 56(2):214–234, 2010. doi:10.1007/S00453-008-9173-3.
  8. Two-dimensional dictionary matching. Inf. Process. Lett., 44(5):233–239, 1992. doi:10.1016/0020-0190(92)90206-B.
  9. Efficient 2-dimensional approximate matching of half-rectangular figures. Inf. Comput., 118(1):1–11, 1995. doi:10.1006/INCO.1995.1047.
  10. Two-dimensional maximal repetitions. Theoretical Computer Science, 812:49–61, 2020. doi:10.1016/j.tcs.2019.07.006.
  11. Inplace 2d matching in compressed images. J. Algorithms, 49(2):240–261, 2003. doi:10.1016/S0196-6774(03)00088-9.
  12. A. Apostolico and V.E. Brimkov. Fibonacci arrays and their two-dimensional repetitions. Theoretical Computer Science, 237(1-2):263–273, 2000. doi:10.1016/S0304-3975(98)00182-0.
  13. Alberto Apostolico. Optimal parallel detection of squares in strings. Algorithmica, 8(4):285–319, 1992. doi:10.1007/BF01758848.
  14. An optimal 𝒪⁢(log⁡log⁡n)𝒪𝑛\mathcal{O}(\log\log n)caligraphic_O ( roman_log roman_log italic_n )-time parallel algorithm for detecting all squares in a string. SIAM J. Comput., 25(6):1318–1331, 1996. doi:10.1137/S0097539793260404.
  15. Optimal discovery of repetitions in 2D. Discrete Applied Mathematics, 151(1-3):5–20, 2005. doi:10.1016/j.dam.2005.02.019.
  16. Optimal off-line detection of repetitions in a string. Theor. Comput. Sci., 22:297–315, 1983. doi:10.1016/0304-3975(83)90109-3.
  17. Theodore P. Baker. A technique for extending rapid exact-match string matching to arrays of more than one dimension. SIAM Journal on Computing, 7(4):533–541, 1978. doi:10.1137/0207043.
  18. The “runs” theorem. SIAM Journal on Computing, 46(5):1501–1514, 2017. doi:10.1137/15M1011032.
  19. Computing all distinct squares in linear time for integer alphabets. In CPM, pages 22:1–22:18, 2017. doi:10.4230/LIPICS.CPM.2017.22.
  20. Weighted ancestors in suffix trees revisited. In 32nd Annual Symposium on Combinatorial Pattern Matching, CPM 2021, pages 8:1–8:15, 2021. doi:10.4230/LIPICS.CPM.2021.8.
  21. The origins of combinatorics on words. Eur. J. Comb., 28(3):996–1022, 2007. doi:10.1016/J.EJC.2005.07.019.
  22. Richard S. Bird. Two dimensional pattern matching. Inf. Process. Lett., 6(5):168–170, 1977. doi:10.1016/0020-0190(77)90017-5.
  23. S. Brlek and S. Li. On the number of squares in a finite word. arXiv, 2022. URL: http://arxiv.org/abs/2204.10204.
  24. On the number of distinct squares in finite sequences: Some old and new results. In Combinatorics on Words - 14th International Conference, WORDS 2023, pages 35–44, 2023. doi:10.1007/978-3-031-33180-0_3.
  25. The number of repetitions in 2D-strings. In 28th Annual European Symposium on Algorithms, ESA 2020, pages 1–18, 2020. doi:10.4230/LIPICS.ESA.2020.32.
  26. Dynamic suffix tree and two-dimensional texts management. Inf. Process. Lett., 61(4):213–220, 1997. doi:10.1016/S0020-0190(97)00018-5.
  27. Dynamic and approximate pattern matching in 2D. In SPIRE, pages 133–144, 2016. doi:10.1007/978-3-319-46049-9_13.
  28. Maxime Crochemore. An optimal algorithm for computing the repetitions in a word. Information Processing Letters, 12(5):244–250, 1981. doi:10.1016/0020-0190(81)90024-7.
  29. Maxime Crochemore. An optimal algorithm for computing the repetitions in a word. Inf. Process. Lett., 12(5):244–250, 1981. doi:10.1016/0020-0190(81)90024-7.
  30. A constant time optimal parallel algorithm for two-dimensional pattern matching. SIAM J. Comput., 27(3):668–681, 1998. doi:10.1137/S0097539795280068.
  31. Two-dimensional pattern matching in linear time and small space. In STACS 95, 12th Annual Symposium on Theoretical Aspects of Computer Science, pages 181–192, 1995. doi:10.1007/3-540-59042-0_72.
  32. Algorithms on strings. Cambridge University Press, 2007.
  33. Maximal repetitions in strings. J. Comput. Syst. Sci., 74(5):796–807, 2008. doi:10.1016/j.jcss.2007.09.003.
  34. The "runs" conjecture. Theor. Comput. Sci., 412(27):2931–2941, 2011. doi:10.1016/j.tcs.2010.06.019.
  35. Extracting powers and periods in a word from its runs structure. Theor. Comput. Sci., 521:29–41, 2014. doi:10.1016/J.TCS.2013.11.018.
  36. Efficient parallel algorithms to test square-freeness and factorize strings. Inf. Process. Lett., 38(2):57–60, 1991. doi:10.1016/0020-0190(91)90223-5.
  37. Usefulness of the Karp-Miller-Rosenberg algorithm in parallel computations on strings and arrays. Theor. Comput. Sci., 88(1):59–82, 1991. doi:10.1016/0304-3975(91)90073-B.
  38. On linear-time alphabet-independent 2-dimensional pattern matching. In LATIN ’95: Theoretical Informatics, pages 220–229, 1995. doi:10.1007/3-540-59175-3_91.
  39. Squares, cubes, and time-space efficient string searching. Algorithmica, 13(5):405–425, 1995. doi:10.1007/BF01190846.
  40. How many double squares can a string contain? Discrete Applied Mathematics, 180:52–69, 2015. doi:10.1016/J.DAM.2014.08.016.
  41. R. P. Dilworth. A decomposition theorem for partially ordered sets. Annals of Mathematics, 51(1):161–166, 1950. URL: http://www.jstor.org/stable/1969503.
  42. Linear Time Runs Over General Ordered Alphabets. 48th International Colloquium on Automata, Languages, and Programming (ICALP 2021), pages 63:1–63:16, 2021. doi:10.4230/LIPICS.ICALP.2021.63.
  43. Optimal square detection over general alphabets. In Proceedings of the 2023 ACM-SIAM Symposium on Discrete Algorithms, SODA 2023, pages 5220–5242. SIAM, 2023. doi:10.1137/1.9781611977554.CH189.
  44. Martin Farach. Optimal suffix tree construction with large alphabets. In 38th Annual Symposium on Foundations of Computer Science, FOCS 1997, pages 137–143. IEEE Computer Society, 1997. doi:10.1109/SFCS.1997.646102.
  45. Uniqueness theorems for periodic functions. Proceedings of the American Mathematical Society, 16(1):109–114, 1965. doi:10.2307/2034009.
  46. How many squares can a string contain? Journal of Combinatorial Theory, Series A, 82(1):112–120, 1998. doi:10.1006/jcta.1997.2843.
  47. Alphabet-independent two-dimensional witness computation. SIAM J. Comput., 25(5):907–935, 1996. doi:10.1137/S0097539792241941.
  48. Lower bounds for the number of repetitions in 2D strings. In SPIRE 2021, pages 179–192, 2021. doi:10.1007/978-3-030-86692-1_15.
  49. Raffaele Giancarlo. A generalization of the suffix tree to square matrices, with applications. SIAM J. Comput., 24(3):520–562, 1995. doi:10.1137/S0097539792231982.
  50. On the construction of classes of suffix trees for square matrices: Algorithms and applications. Inf. Comput., 130(2):151–182, 1996. doi:10.1006/INCO.1996.0087.
  51. Mathieu Giraud. Not so many runs in strings. In Language and Automata Theory and Applications, Second International Conference, LATA 2008, volume 5196, pages 232–239. Springer, 2008. doi:10.1007/978-3-540-88282-4_22.
  52. Mathieu Giraud. Asymptotic behavior of the numbers of runs and microruns. Inf. Comput., 207(11):1221–1228, 2009. doi:10.1016/j.ic.2009.02.007.
  53. Dan Gusfield. Algorithms on Strings, Trees, and Sequences - Computer Science and Computational Biology. Cambridge University Press, 1997.
  54. Linear time algorithms for finding and representing all the tandem repeats in a string. J. Comput. Syst. Sci., 69(4):525–546, 2004. doi:10.1016/J.JCSS.2004.03.004.
  55. Efficient on-line repetition detection. Theor. Comput. Sci., 407(1-3):554–563, 2008. doi:10.1016/j.tcs.2008.08.038.
  56. Multiple matching of rectangular patterns. Inf. Comput., 117(1):78–90, 1995. doi:10.1006/INCO.1995.1030.
  57. L. Ilie. A simple proof that a word of length n has at most 2n distinct squares. Journal of Combinatorial Theory, Series A, 112(1):163–164, 2005. doi:10.1016/J.JCTA.2005.01.006.
  58. L. Ilie. A note on the number of squares in a word. Theoretical Computer Science, 380(3):373–376, 2007. doi:10.1016/J.TCS.2007.03.025.
  59. Two- and higher-dimensional pattern matching in optimal expected time. SIAM J. Comput., 29(2):571–589, 1999. doi:10.1137/S0097539794275872.
  60. Fast pattern matching in strings. SIAM Journal on Computing, 6(2):323–350, 1977. doi:10.1137/0206024.
  61. Tomasz Kociumaka. Efficient Data Structures for Internal Queries in Texts. PhD thesis, University of Warsaw, 2018. URL: https://mimuw.edu.pl/~kociumaka/files/phd.pdf.
  62. Internal pattern matching queries in a text and applications. In Proceedings of the Twenty-Sixth Annual ACM-SIAM Symposium on Discrete Algorithms, SODA 2015, pages 532–551. SIAM, 2015. doi:10.1137/1.9781611973730.36.
  63. Finding maximal repetitions in a word in linear time. In 40th Annual Symposium on Foundations of Computer Science, FOCS 1999, pages 596–604. IEEE Computer Society, 1999. doi:10.1109/SFFCS.1999.814634.
  64. Dmitry Kosolobov. Online square detection. CoRR, abs/1411.2022, 2014. arXiv:1411.2022.
  65. Dmitry Kosolobov. Online detection of repetitions with backtracking. In Combinatorial Pattern Matching - 26th Annual Symposium, CPM 2015, volume 9133, pages 295–306. Springer, 2015. doi:10.1007/978-3-319-19929-0_25.
  66. N. H. Lam. On the number of squares in a string. AdvOL-Report 2, 2013.
  67. An efficient algorithm for online square detection. Theor. Comput. Sci., 363(1):69–75, 2006. doi:10.1016/J.TCS.2006.06.011.
  68. An 𝒪⁢(n⁢log⁡n)𝒪𝑛𝑛\mathcal{O}(n\log n)caligraphic_O ( italic_n roman_log italic_n ) algorithm for finding all repetitions in a string. J. Algorithms, 5(3):422–432, 1984. doi:10.1016/0196-6774(84)90021-X.
  69. Excluded permutation matrices and the stanley-wilf conjecture. J. Comb. Theory, Ser. A, 107(1):153–160, 2004. doi:10.1016/J.JCTA.2004.04.002.
  70. Succinct 2D dictionary matching. Algorithmica, 65(3):662–684, 2013. doi:10.1007/S00453-012-9615-9.
  71. How many runs can a string contain? Theor. Comput. Sci., 401(1-3):165–171, 2008. doi:10.1016/J.TCS.2008.04.020.
  72. Digital Picture Processing: Volume 1 and 2. Computer Science and Applied Mathematics. Academic Press, Orlando, FL, 2 edition, 1982.
  73. Wojciech Rytter. The number of runs in a string: Improved analysis of the linear upper bound. In STACS 2006, 23rd Annual Symposium on Theoretical Aspects of Computer Science, pages 184–195, 2006. doi:10.1007/11672142_14.
  74. A. Thierry. A proof that a word of length n𝑛nitalic_n has less than 1.5⁢n1.5𝑛1.5n1.5 italic_n distinct squares. arXiv, 2020. URL: http://arxiv.org/abs/2001.02996.
  75. A. Thue. Über unendliche Zeichenreihen. Norske Vid. Selsk. Skr., I Mat.–Nat. Kl., Christiania, 7:1–22, 1906.
User Edit Pencil Streamline Icon: https://streamlinehq.com
Authors (3)
  1. Panagiotis Charalampopoulos (34 papers)
  2. Paweł Gawrychowski (151 papers)
  3. Samah Ghazawi (4 papers)
Citations (1)

Summary

We haven't generated a summary for this paper yet.