Skip to main content

Quantum Algorithms for Longest Common Substring with a Gap

  • Conference paper
  • First Online:
String Processing and Information Retrieval (SPIRE 2024)

Abstract

Recent breakthroughs have provided a sublinear time quantum algorithm for the Longest Common Substring Problem running in \(\widetilde{\mathcal {O}}(n^{2/3}/d^{1/6})\) time for two strings of length at most n, where d is the length of the solution. At the same time, no subquadratic time quantum algorithm for the Longest Common Subsequence Problem is known, implying increasing difficulty as gaps are allowed within the solution. In this work, we consider the problem of finding two ordered matching substrings such that their total length is maximized. We present a strongly sublinear-time quantum algorithm.

This is a preview of subscription content, log in via an institution to check access.

Access this chapter

Subscribe and save

Springer+ Basic
$34.99 /Month
  • Get 10 units per month
  • Download Article/Chapter or eBook
  • 1 Unit = 1 Article or 1 Chapter
  • Cancel anytime
Subscribe now

Buy Now

Chapter
USD 29.95
Price excludes VAT (USA)
  • Available as PDF
  • Read on any device
  • Instant download
  • Own it forever

Tax calculation will be finalised at checkout

Purchases are for personal use only

Institutional subscriptions

Notes

  1. 1.

    \(\widetilde{\mathcal {O}}(\cdot )\) suppresses polylogarithmic factors.

References

  1. Abboud, A., Backurs, A., Williams, V.V.: Tight hardness results for LCS and other sequence similarity measures. In: Guruswami, V. (ed.) IEEE 56th Annual Symposium on Foundations of Computer Science, FOCS 2015, Berkeley, CA, USA, 17-20 October, 2015. pp. 59–78. IEEE Computer Society (2015). https://doi.org/10.1109/FOCS.2015.14

  2. Abboud, A., Hansen, T.D., Williams, V.V., Williams, R.: Simulating branching programs with edit distance and friends: or: a polylog shaved is a lower bound made. In: Wichs, D., Mansour, Y. (eds.) Proceedings of the 48th Annual ACM SIGACT Symposium on Theory of Computing, STOC 2016, Cambridge, MA, USA, 18-21 June 2016. pp. 375–388. ACM (2016). https://doi.org/10.1145/2897518.2897653

  3. Akmal, S., Jin, C.: Near-optimal quantum algorithms for string problems. In: Naor, J.S., Buchbinder, N. (eds.) Proceedings of the 2022 ACM-SIAM Symposium on Discrete Algorithms, SODA 2022, Virtual Conference / Alexandria, VA, USA, 9 - 12 January 2022, pp. 2791–2832. SIAM (2022). https://doi.org/10.1137/1.9781611977073.109

  4. Akmal, S., Williams, V.V.: Improved approximation for longest common subsequence over small alphabets. In: Bansal, N., Merelli, E., Worrell, J. (eds.) 48th International Colloquium on Automata, Languages, and Programming, ICALP 2021, 12-16 July 2021, Glasgow, Scotland (Virtual Conference). LIPIcs, vol. 198, pp. 13:1–13:18. Schloss Dagstuhl - Leibniz-Zentrum für Informatik (2021). https://doi.org/10.4230/LIPIcs.ICALP.2021.13

  5. Ambainis, A.: Quantum walk algorithm for element distinctness. SIAM J. Comput. 37(1), 210–239 (2007). https://doi.org/10.1137/S0097539705447311

    Article  MathSciNet  Google Scholar 

  6. Amir, A., Charalampopoulos, P., Pissis, S.P., Radoszewski, J.: Dynamic and internal longest common substring. Algorithmica 82(12), 3707–3743 (2020). https://doi.org/10.1007/s00453-020-00744-0

    Article  MathSciNet  Google Scholar 

  7. Babenko, M.A., Starikovskaya, T.: Computing the longest common substring with one mismatch. Probl. Inf. Transm. 47(1), 28–33 (2011). https://doi.org/10.1134/S0032946011010030

    Article  MathSciNet  Google Scholar 

  8. de Berg, M., Cheong, O., van Kreveld, M.J., Overmars, M.H.: Computational geometry: algorithms and applications, 3rd Edition. Springer (2008). https://www.worldcat.org/oclc/227584184

  9. Buhrman, H., Patro, S., Speelman, F.: A framework of quantum strong exponential-time hypotheses. In: Bläser, M., Monmege, B. (eds.) 38th International Symposium on Theoretical Aspects of Computer Science, STACS 2021, 16-19 March 2021, Saarbrücken, Germany (Virtual Conference). LIPIcs, vol. 187, pp. 19:1–19:19. Schloss Dagstuhl - Leibniz-Zentrum für Informatik (2021). https://doi.org/10.4230/LIPIcs.STACS.2021.19

  10. Charalampopoulos, P., et al.: Linear-time algorithm for long LCF with k mismatches. In: Navarro, G., Sankoff, D., Zhu, B. (eds.) Annual Symposium on Combinatorial Pattern Matching, CPM 2018, 2-4 July 2018 - Qingdao, China. LIPIcs, vol. 105, pp. 23:1–23:16. Schloss Dagstuhl - Leibniz-Zentrum für Informatik (2018). https://doi.org/10.4230/LIPIcs.CPM.2018.23

  11. Farach, M.: Optimal suffix tree construction with large alphabets. In: 38th Annual Symposium on Foundations of Computer Science, FOCS ’97, Miami Beach, Florida, USA, 19-22 October 1997, pp. 137–143. IEEE Computer Society (1997). https://doi.org/10.1109/SFCS.1997.646102

  12. Flouri, T., Giaquinta, E., Kobert, K., Ukkonen, E.: Longest common substrings with k mismatches. Inf. Process. Lett. 115(6–8), 643–647 (2015). https://doi.org/10.1016/J.IPL.2015.03.006

    Article  MathSciNet  Google Scholar 

  13. Gall, F.L., Seddighin, S.: Quantum meets fine-grained complexity: sublinear time quantum algorithms for string problems. Algorithmica 85(5), 1251–1286 (2023). https://doi.org/10.1007/s00453-022-01066-z

    Article  MathSciNet  Google Scholar 

  14. Gibney, D., Jin, C., Kociumaka, T., Thankachan, S.V.: Near-optimal quantum algorithms for bounded edit distance and lempel-ziv factorization. In: Woodruff, D.P. (ed.) Proceedings of the 2024 ACM-SIAM Symposium on Discrete Algorithms, SODA 2024, Alexandria, VA, USA, 7-10 January 2024, pp. 3302–3332. SIAM (2024). https://doi.org/10.1137/1.9781611977912.118

  15. Grover, L.K.: A fast quantum mechanical algorithm for database search. In: Proceedings of the 28th Annual ACM Symposium on the Theory of Computing (STOC 1996), pp. 212–219 (1996). https://doi.org/10.1145/237814.237866

  16. Hariharan, R., Vinay, V.: String matching in õ(sqrt(n)+sqrt(m)) quantum time. J. Dis. Algorithms 1(1), 103–110 (2003). https://doi.org/10.1016/S1570-8667(03)00010-8

    Article  Google Scholar 

  17. Heeger, K., Nichterlein, A., Niedermeier, R.: Parameterized lower bounds for problems in P via fine-grained cross-compositions. In: Berenbrink, P., Bouyer, P., Dawar, A., Kanté, M.M. (eds.) 40th International Symposium on Theoretical Aspects of Computer Science, STACS 2023, 7-9 March 2023, Hamburg, Germany. LIPIcs, vol. 254, pp. 35:1–35:19. Schloss Dagstuhl - Leibniz-Zentrum für Informatik (2023). https://doi.org/10.4230/LIPIcs.STACS.2023.35

  18. Jin, C., Nogler, J.: Quantum speed-ups for string synchronizing sets, longest common substring, and k-mismatch matching. In: Bansal, N., Nagarajan, V. (eds.) Proceedings of the 2023 ACM-SIAM Symposium on Discrete Algorithms, SODA 2023, Florence, Italy, 22-25 January 2023, pp. 5090–5121. SIAM (2023). https://doi.org/10.1137/1.9781611977554.ch186

  19. Kempa, D., Kociumaka, T.: String synchronizing sets: sublinear-time BWT construction and optimal LCE data structure. In: Charikar, M., Cohen, E. (eds.) Proceedings of the 51st Annual ACM SIGACT Symposium on Theory of Computing, STOC 2019, Phoenix, AZ, USA, 23-26 June 2019, pp. 756–767. ACM (2019). https://doi.org/10.1145/3313276.3316368

  20. Kociumaka, T., Radoszewski, J., Starikovskaya, T.: Publisher correction: longest common substring with approximately k mismatches. Algorithmica 85(10), 3323 (2023). https://doi.org/10.1007/S00453-023-01119-X

    Article  MathSciNet  Google Scholar 

  21. Li, T., Zhu, D., Jiang, H., Feng, H., Cui, X.: Longest k-tuple common sub-strings. In: Adjeroh, D.A., et al. (eds.) IEEE International Conference on Bioinformatics and Biomedicine, BIBM 2022, Las Vegas, NV, USA, 6-8 December 2022, pp. 63–66. IEEE (2022). https://doi.org/10.1109/BIBM55620.2022.9995199

  22. Magniez, F., Nayak, A., Roland, J., Santha, M.: Search via quantum walk. In: Johnson, D.S., Feige, U. (eds.) Proceedings of the 39th Annual ACM Symposium on Theory of Computing, San Diego, California, USA, 11-13 June 2007, pp. 575–584. ACM (2007). https://doi.org/10.1145/1250790.1250874

  23. Nielsen, M.A., Chuang, I.L.: Quantum Computation and Quantum Information (10th Anniversary edition). Cambridge University Press (2016). https://www.cambridge.org/de/academic/subjects/physics/quantum-physics-quantum-information-and-quantum-computation/quantum-computation-and-quantum-information-10th-anniversary-edition?format=HB

  24. Pavetic, F., Zuzic, G., Sikic, M.: \(lcsk\)++: Practical similarity metric for long strings. CoRR arXiv: abs/1407.2407 (2014)

  25. Rubinstein, A., Seddighin, S., Song, Z., Sun, X.: Approximation algorithms for LCS and LIS with truly improved running times. In: Zuckerman, D. (ed.) 60th IEEE Annual Symposium on Foundations of Computer Science, FOCS 2019, Baltimore, Maryland, USA, 9-2 November 2019, pp. 1121–1145. IEEE Computer Society (2019). https://doi.org/10.1109/FOCS.2019.00071

  26. Thankachan, S.V., Apostolico, A., Aluru, S.: A provably efficient algorithm for the k-mismatch average common substring problem. J. Comput. Biol. 23(6), 472–482 (2016). https://doi.org/10.1089/cmb.2015.0235

    Article  MathSciNet  Google Scholar 

  27. Ueki, Y., et al.: Longest common subsequence in at least k length order-isomorphic substrings. In: Steffen, B., Baier, C., van den Brand, M., Eder, J., Hinchey, M., Margaria, T. (eds.) SOFSEM 2017. LNCS, vol. 10139, pp. 363–374. Springer (2017). https://doi.org/10.1007/978-3-319-51963-0_28

  28. Weiner, P.: Linear pattern matching algorithms. In: 14th Annual Symposium on Switching and Automata Theory, Iowa City, Iowa, USA, 15-17 October 1973, pp. 1–11. IEEE Computer Society (1973). https://doi.org/10.1109/SWAT.1973.13

  29. Ziv, J., Lempel, A.: A universal algorithm for sequential data compression. IEEE Trans. Inf. Theory 23(3), 337–343 (1977). https://doi.org/10.1109/TIT.1977.1055714

    Article  MathSciNet  Google Scholar 

Download references

Author information

Authors and Affiliations

Authors

Corresponding author

Correspondence to Daniel Gibney .

Editor information

Editors and Affiliations

Rights and permissions

Reprints and permissions

Copyright information

© 2025 The Author(s), under exclusive license to Springer Nature Switzerland AG

About this paper

Check for updates. Verify currency and authenticity via CrossMark

Cite this paper

Gibney, D., Hossen, M.H. (2025). Quantum Algorithms for Longest Common Substring with a Gap. In: Lipták, Z., Moura, E., Figueroa, K., Baeza-Yates, R. (eds) String Processing and Information Retrieval. SPIRE 2024. Lecture Notes in Computer Science, vol 14899. Springer, Cham. https://doi.org/10.1007/978-3-031-72200-4_11

Download citation

  • DOI: https://doi.org/10.1007/978-3-031-72200-4_11

  • Published:

  • Publisher Name: Springer, Cham

  • Print ISBN: 978-3-031-72199-1

  • Online ISBN: 978-3-031-72200-4

  • eBook Packages: Computer ScienceComputer Science (R0)

Publish with us

Policies and ethics