Lexicographically minimal string rotation (LMSR) is a problem to find the minimal one among all rotations of a string in the lexicographical order, which is widely used in equality checking of graphs, polygons, automata and chemical structures. In this paper, we propose an $O(n^{3/4})$ quantum query algorithm for LMSR. In particular, the algorithm has average-case query complexity $O(\sqrt n \log n)$, which is shown to be asymptotically optimal up to a polylogarithmic factor, compared to its $\Omega\left(\sqrt{n/\log n}\right)$ lower bound. Furthermore, we show that our quantum algorithm outperforms any (classical) randomized algorithms in both worst and average cases. As an application, it is used in benzenoid identification and disjoint-cycle automata minimization.
翻译:字典序最小字符串旋转(LMSR)是指在一个字符串的所有旋转中,按字典序找出最小的那个,该问题广泛应用于图、多边形、自动机和化学结构的相等性检验。本文提出一个复杂度为$O(n^{3/4})$的量子查询算法求解LMSR。特别地,该算法的平均情况查询复杂度为$O(\sqrt n \log n)$,相较于其$\Omega\left(\sqrt{n/\log n}\right)$的下界,该结果在多项式对数因子意义下渐近最优。进一步证明,在平均情况和最坏情况下,该量子算法均优于任何(经典)随机化算法。应用方面,该算法可用于苯系物识别和不相交循环自动机最小化。