Abstract
The longest common subsequence (LCS) problem is a central problem in stringology that finds the longest common subsequence of given two strings A and B. More recently, a set of four constrained LCS problems (called generalized constrained LCS problem) were proposed by Chen and Chao [J. Comb. Optim, 2011]. In this paper, we consider the substring-excluding constrained LCS (STR-EC-LCS) problem. A string Z is said to be an STR-EC-LCS of two given strings A and B excluding P if, Z is one of the longest common subsequences of A and B that does not contain P as a substring. Wang et al. proposed a dynamic programming solution which computes an STR-EC-LCS in O(mnr) time and space where \(m = |A|, n = |B|, r = |P|\) [Inf. Process. Lett., 2013]. In this paper, we show a new solution for the STR-EC-LCS problem. Our algorithm computes an STR-EC-LCS in \(O(n|\varSigma | + (L+1)(m-L+1)r)\) time where \(|\varSigma | \le \min \{m, n\}\) denotes the set of distinct characters occurring in both A and B, and L is the length of the STR-EC-LCS. This algorithm is faster than the O(mnr)-time algorithm for short/long STR-EC-LCS (namely, \(L \in O(1)\) or \(m-L \in O(1)\)), and is at least as efficient as the O(mnr)-time algorithm for all cases.
Access this chapter
Tax calculation will be finalised at checkout
Purchases are for personal use only
References
Abboud, A., Backurs, A., Williams, V.V.: Tight hardness results for LCS and other sequence similarity measures. FOCS 2015, 59–78 (2015)
Ahsan, S.B., Aziz, S.P., Rahman, M.S.: Longest common subsequence problem for run-length-encoded strings. In: 2012 15th International Conference on Computer and Information Technology (ICCIT), pp. 36–41, December 2012
Bunke, H., Csirik, J.: An improved algorithm for computing the edit distance of run-length coded strings. Inf. Process. Lett. 54(2), 93–96 (1995). http://www.sciencedirect.com/science/article/pii/002001909500005W
Chen, Y.C., Chao, K.M.: On the generalized constrained longest common subsequence problems. J. Comb. Optim. 21(3), 383–392 (2011). https://doi.org/10.1007/s10878-009-9262-5
Chin, F.Y., Santis, A.D., Ferrara, A.L., Ho, N., Kim, S.: A simple algorithm for the constrained sequence problems. Inf. Process. Lett. 90(4), 175–179 (2004). http://www.sciencedirect.com/science/article/pii/S0020019004000614
Deorowicz, S.: Quadratic-time algorithm for a string constrained lcs problem. Inf. Process. Lett. 112(11), 423–426 (2012). http://www.sciencedirect.com/science/article/pii/S0020019012000567
Inenaga, S., Hyyrö, H.: A hardness result and new algorithm for the longest common palindromic subsequence problem. Inf. Process. Lett. 129, 11–15 (2018)
Kuboi, K., Fujishige, Y., Inenaga, S., Bannai, H., Takeda, M.: Faster STR-IC-LCS computation via RLE. In: Kärkkäinen, J., Radoszewski, J., Rytter, W. (eds.) 28th Annual Symposium on Combinatorial Pattern Matching, CPM 2017, 4–6 July 2017, Warsaw, Poland. LIPIcs, vol. 78, pp. 20:1–20:12. Schloss Dagstuhl - Leibniz-Zentrum fuer Informatik (2017). https://doi.org/10.4230/LIPIcs.CPM.2017.20
Liu, J.J., Wang, Y.L., Chiu, Y.S.: Constrained longest common subsequences with run-length-encoded strings. Comput. J. 58(5), 1074–1084 (2014). https://doi.org/10.1093/comjnl/bxu012
Nakatsu, N., Kambayashi, Y., Yajima, S.: A longest common subsequence algorithm suitable for similar text strings. Acta Inf. 18, 171–179 (1982). https://doi.org/10.1007/BF00264437
Stern, H., Shmueli, M., Berman, S.: Most discriminating segment - longest common subsequence (MDSLCS) algorithm for dynamic hand gesture classification. Pattern Recogn. Lett. 34(15), 1980–1989 (2013). http://www.sciencedirect.com/science/article/pii/S0167865513000512, smart Approaches for Human Action Recognition
Tsai, Y.T.: The constrained longest common subsequence problem. Inf. Process. Lett. 88(4), 173–176 (2003). http://www.sciencedirect.com/science/article/pii/S002001900300406X
Wagner, R.A., Fischer, M.J.: The string-to-string correction problem. J. ACM 21(1), 168–173 (1974). https://doi.org/10.1145/321796.321811
Wang, C., Zhang, D.: A novel compression tool for efficient storage of genome resequencing data. Nucleic Acids Res. 39(7), e45 (2011). https://doi.org/10.1093/nar/gkr009
Wang, L., Wang, X., Wu, Y., Zhu, D.: A dynamic programming solution to a generalized LCS problem. Inf. Process. Lett. 113(19–21), 723–728 (2013). https://doi.org/10.1016/j.ipl.2013.07.005
Acknowledgments
This work was supported by JSPS KAKENHI Grant Numbers JP18K18002 (YN), JP17H01697 (SI), JP16H02783 (HB), JP18H04098 (MT), and by JST PRESTO Grant Number JPMJPR1922 (SI).
Author information
Authors and Affiliations
Corresponding author
Editor information
Editors and Affiliations
Rights and permissions
Copyright information
© 2020 Springer Nature Switzerland AG
About this paper
Cite this paper
Yamada, K., Nakashima, Y., Inenaga, S., Bannai, H., Takeda, M. (2020). Faster STR-EC-LCS Computation. In: Chatzigeorgiou, A., et al. SOFSEM 2020: Theory and Practice of Computer Science. SOFSEM 2020. Lecture Notes in Computer Science(), vol 12011. Springer, Cham. https://doi.org/10.1007/978-3-030-38919-2_11
Download citation
DOI: https://doi.org/10.1007/978-3-030-38919-2_11
Published:
Publisher Name: Springer, Cham
Print ISBN: 978-3-030-38918-5
Online ISBN: 978-3-030-38919-2
eBook Packages: Computer ScienceComputer Science (R0)