Computing Longest Common Subsequence under Cartesian-Tree Matching Model (2402.19146v3)
Abstract: Two strings of the same length are said to Cartesian-tree match (CT-match) if their Cartesian-trees are isomorphic [Park et al., TCS 2020]. Cartesian-tree matching is a natural model that allows for capturing similarities of numerical sequences. Oizumi et al. [CPM 2022] showed that subsequence pattern matching under CT-matching model can be solved in polynomial time. This current article follows and extends this line of research: We present the first polynomial-time algorithm that finds the longest common subsequence under CT-matching of two given strings $S$ and $T$ of length $n$, in $O(n6)$ time and $O(n4)$ space for general ordered alphabets. We then show that the problem has a faster solution in the binary case, by presenting an $O(n2 / \log n)$-time and space algorithm.
- Tight hardness results for LCS and other sequence similarity measures. In FOCS 2015, pages 59–78, 2015.
- Fast linear-space computations of longest common subsequences. Theor. Comput. Sci., 92(1):3–17, 1992.
- On economical construction of the transitive closure of a directed graph. Soviet Mathematics Doklady, 11(5):1209–1210, 1970.
- Pattern matching for permutations. Inf. Process. Lett., 65(5):277–283, 1998.
- K. Bringmann and M. Künnemann. Quadratic conditional lower bounds for string problems and dynamic time warping. In FOCS 2015, pages 79–97, 2015.
- Order-preserving indexing. Theor. Comput. Sci., 638:122–135, 2016.
- Scaling and related techniques for geometry problems. In STOC 1984, pages 135–143, 1984.
- On indeterminate strings matching. In CPM 2020, volume 161 of LIPIcs, pages 14:1–14:14, 2020.
- Pattern matching in trees. J. ACM, 29(1):68–95, 1982.
- A fast algorithm for computing longest common subsequences. Commun. ACM, 20(5):350–353, 1977.
- Order-preserving matching. Theor. Comput. Sci., 525:68–79, 2014.
- A linear time algorithm for consecutive permutation pattern matching. Inf. Process. Lett., 113(12):430–433, 2013.
- A faster algorithm computing string edit distances. J. Comput. Syst. Sci., 20(1):18–31, 1980.
- A longest common subsequence algorithm suitable for similar text strings. Acta Inf., 18:171–179, 1982.
- Cartesian tree subsequence matching. In CPM 2022, volume 223 of LIPIcs, pages 14:1–14:18, 2022.
- Finding patterns and periods in Cartesian tree matching. Theor. Comput. Sci., 845:181–197, 2020.
- Y. Sakai. Computing the longest common subsequence of two run-length encoded strings. In ISAAC 2012, pages 197–206, 2012.
- Fast algorithms for single and multiple pattern Cartesian tree matching. Theor. Comput. Sci., 849:47–63, 2021.