Longest Common Substring and Longest Palindromic Substring in πͺΜ(β(n)) Time
The Longest Common Substring (LCS) and Longest Palindromic Substring (LPS) are classical problems in computer science, representing fundamental challenges in string processing. Both problems can be solved in linear time using a classical model of computation, by means of very similar algorithms, both relying on the use of suffix trees. Very recently, two sublinear algorithms for LCS and LPS in the quantum query model have been presented by Le Gall and SeddighinΒ <cit.>, requiring πͺΜ(n^5/6) and πͺΜ(β(n)) queries, respectively. However, while the query model is fascinating from a theoretical standpoint, its practical applicability becomes limited when it comes to crafting algorithms meant for actual execution on real hardware. In this paper we present, for the first time, a πͺΜ(β(n)) quantum algorithm for both LCS and LPS working in the circuit model of computation. Our solutions are simpler than previous ones and can be easily translated into quantum procedures. We also present actual implementations of the two algorithms as quantum circuits working in πͺ(β(n)log^5(n)) and πͺ(β(n)log^4(n)) time, respectively.
READ FULL TEXT