Skip to main content

A Polynomial Time Algorithm for a Generalized Longest Common Subsequence Problem

  • Conference paper
  • First Online:
Green, Pervasive, and Cloud Computing

Part of the book series: Lecture Notes in Computer Science ((LNTCS,volume 9663))

Abstract

In this paper, we consider a generalized longest common subsequence problem with multiple substring exclusive constraints. For the two input sequences X and Y of lengths n and m, and a set of d constraints \(P=\{P_1,\cdots ,P_d\}\) of total length r, the problem is to find a common subsequence Z of X and Y excluding each of constraint string in P as a substring and the length of Z is maximized. A very simple dynamic programming algorithm to this problem is presented in this paper. The correctness of the new algorithm is demonstrated. The time and space complexities of the new algorithm are both O(nmr).

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

Access this chapter

Chapter
USD 29.95
Price excludes VAT (USA)
  • Available as PDF
  • Read on any device
  • Instant download
  • Own it forever
eBook
USD 39.99
Price excludes VAT (USA)
  • Available as EPUB and PDF
  • Read on any device
  • Instant download
  • Own it forever
Softcover Book
USD 54.99
Price excludes VAT (USA)
  • Compact, lightweight edition
  • Dispatched in 3 to 5 business days
  • Free shipping worldwide - see info

Tax calculation will be finalised at checkout

Purchases are for personal use only

Institutional subscriptions

References

  1. Aho, A.V., Corasick, M.J.: Efficient string matching: an aid to bibliographic search. Commun. ACM 18(6), 333–340 (1975)

    Article  MathSciNet  MATH  Google Scholar 

  2. Ann, H.Y., Yang, C.B., Tseng, C.T., Hor, C.Y.: A fast and simple algorithm for computing the longest common subsequence of run-length encoded strings. Inform. Process Lett. 108(11), 360–364 (2008)

    Article  MathSciNet  MATH  Google Scholar 

  3. Ann, H.Y., Yang, C.B., Peng, Y.H., Liaw, B.C.: Efficient algorithms for the block edit problems. Inf. Comput. 208(3), 221–229 (2010)

    Article  MathSciNet  MATH  Google Scholar 

  4. Apostolico, A., Guerra, C.: The longest common subsequences problem revisited. Algorithmica 2(1), 315–336 (1987)

    Article  MathSciNet  MATH  Google Scholar 

  5. Arslan, A.N., Egecioglu, O.: Algorithms for the constrained longest common subsequence problems. Int. J. Found. Comput. Sci. 16(6), 1099–1109 (2005)

    Article  MathSciNet  MATH  Google Scholar 

  6. Blum, C., Blesa, M.J., Lpez-Ibnez, M.: Beam search for the longest common subsequence problem. Comput. Oper. Res. 36(12), 3178–3186 (2009)

    Article  MathSciNet  MATH  Google Scholar 

  7. Chen, Y.C., Chao, K.M.: On the generalized constrained longest common subsequence problems. J. Comb. Optim. 21(3), 383–392 (2011)

    Article  MathSciNet  MATH  Google Scholar 

  8. Chin, F.Y.L., Santis, A.D., Ferrara, A.L., Ho, N.L., Kim, S.K.: A simple algorithm for the constrained sequence problems. Inform. Process. Lett. 90(4), 175–179 (2004)

    Article  MathSciNet  MATH  Google Scholar 

  9. Crochemore, M., Hancart, C., Lecroq, T.: Algorithms on Strings. Cambridge University Press, Cambridge, UK (2007)

    Book  MATH  Google Scholar 

  10. Deorowicz, S.: Quadratic-time algorithm for a string constrained LCS problem. Inform. Process. Lett. 112(11), 423–426 (2012)

    Article  MathSciNet  MATH  Google Scholar 

  11. Deorowicz, S., Obstoj, J.: Constrained longest common subsequence computing algorithms in practice. Comput. Inform. 29(3), 427–445 (2010)

    MathSciNet  Google Scholar 

  12. Farhana, E., Ferdous, J., Moosa, T., Rahman, M.S.: Finite automata based algorithms for the generalized constrained longest common subsequence problems. In: Chavez, E., Lonardi, S. (eds.) SPIRE 2010. LNCS, vol. 6393, pp. 243–249. Springer, Heidelberg (2010)

    Chapter  Google Scholar 

  13. Gotthilf, Z., Hermelin, D., Lewenstein, M.: Constrained LCS: hardness and approximation. In: Ferragina, P., Landau, G.M. (eds.) CPM 2008. LNCS, vol. 5029, pp. 255–262. Springer, Heidelberg (2008)

    Chapter  Google Scholar 

  14. Gotthilf, Z., Hermelin, D., Landau, G.M., Lewenstein, M.: Restricted LCS. In: Chavez, E., Lonardi, S. (eds.) SPIRE 2010. LNCS, vol. 6393, pp. 250–257. Springer, Heidelberg (2010)

    Chapter  Google Scholar 

  15. Gusfield, D.: Algorithms on Strings, Trees, and Sequences: Computer Science and Computational Biology. Cambridge University Press, Cambridge (1997)

    Book  MATH  Google Scholar 

  16. Hirschberg, D.S.: Algorithms for the longest common subsequence problem. J. ACM 24(4), 664–675 (1977)

    Article  MathSciNet  MATH  Google Scholar 

  17. Hunt, J.W., Szymanski, T.G.: A fast algorithm for computing longest common subsequences. Commun. ACM 20(5), 350–353 (1977)

    Article  MathSciNet  MATH  Google Scholar 

  18. Iliopoulos, C.S., Rahman, M.S.: New efficient algorithms for the LCS and constrained LCS problems. Inform. Process. Lett. 106(1), 13–18 (2008)

    Article  MathSciNet  MATH  Google Scholar 

  19. Iliopoulos, C.S., Rahman, M.S.: A new efficient algorithm for computing the longest common subsequence. Theor. Comput. Sci. 45(2), 355–371 (2009)

    MathSciNet  MATH  Google Scholar 

  20. Iliopoulos, C.S., Rahman, M.S., Rytter, W.: Algorithms for two versions of LCS problem for indeterminate strings. J. Comb. Math. Comb. Comput. 71, 155–172 (2009)

    MathSciNet  MATH  Google Scholar 

  21. Iliopoulos, C.S., Rahman, M.S., Vorcek, M., Vagner, L.: Finite automata based algorithms on subsequences and supersequences of degenerate strings. J. Discrete Algorithm 8(2), 117–130 (2010)

    Article  MathSciNet  MATH  Google Scholar 

  22. Knuth, D.E., Morris, J.H., Pratt, V.: Fast pattern matching in strings. SIAM J. Comput. 6(2), 323–350 (1977)

    Article  MathSciNet  MATH  Google Scholar 

  23. Maier, D.: The complexity of some problems on subsequences and supersequences. J. ACM 25, 322–336 (1978)

    Article  MathSciNet  MATH  Google Scholar 

  24. Peng, Y.H., Yang, C.B., Huang, K.S., Tseng, K.T.: An algorithm and applications to sequence alignment with weighted constraints. Int. J. Found. Comput. Sci. 21(1), 51–59 (2010)

    Article  MathSciNet  MATH  Google Scholar 

  25. Shyu, S.J., Tsai, C.Y.: Finding the longest common subsequence for multiple biological sequences by ant colony optimization. Comput. Oper. Res. 36(1), 73–91 (2009)

    Article  MathSciNet  MATH  Google Scholar 

  26. Tang, C.Y., Lu, C.L.: Constrained multiple sequence alignment tool development and its application to RNase family alignment. J. Bioinform. Comput. Biol. 1, 267–287 (2003)

    Article  Google Scholar 

  27. Tsai, Y.T.: The constrained longest common subsequence problem. Inform. Process. Lett. 88(4), 173–176 (2003)

    Article  MathSciNet  MATH  Google Scholar 

  28. Tseng, C.T., Yang, C.B., Ann, H.Y.: Efficient algorithms for the longest common subsequence problem with sequential substring constraints. J. Complex. 29, 44–52 (2013)

    Article  MathSciNet  MATH  Google Scholar 

  29. Wagner, R., Fischer, M.: The string-to-string correction problem. J. ACM 21(1), 168–173 (1974)

    Article  MathSciNet  MATH  Google Scholar 

  30. Wang, L., Wang, X., Wu, Y., Zhu, D.: A dynamic programming solution to a generalized LCS problem. Inform. Process. Lett. 113(1), 723–728 (2013)

    Article  MathSciNet  MATH  Google Scholar 

Download references

Author information

Authors and Affiliations

Authors

Corresponding author

Correspondence to Daxin Zhu .

Editor information

Editors and Affiliations

Rights and permissions

Reprints and permissions

Copyright information

© 2016 Springer International Publishing Switzerland

About this paper

Cite this paper

Wang, X., Wu, Y., Zhu, D. (2016). A Polynomial Time Algorithm for a Generalized Longest Common Subsequence Problem. In: Huang, X., Xiang, Y., Li, KC. (eds) Green, Pervasive, and Cloud Computing. Lecture Notes in Computer Science(), vol 9663. Springer, Cham. https://doi.org/10.1007/978-3-319-39077-2_2

Download citation

  • DOI: https://doi.org/10.1007/978-3-319-39077-2_2

  • Published:

  • Publisher Name: Springer, Cham

  • Print ISBN: 978-3-319-39076-5

  • Online ISBN: 978-3-319-39077-2

  • eBook Packages: Computer ScienceComputer Science (R0)

Publish with us

Policies and ethics