Efficient STR-EC-LCS Computation Algorithm

faster str ec lcs computation n.w
1 / 36
Embed
Share

"Explore a new algorithm for solving the substring-excluding constrained LCS problem efficiently, outperforming existing methods. Learn how to find the longest common subsequence of two strings while excluding a specified substring."

  • Algorithm
  • Substring
  • LCS
  • Computation
  • Efficiency

Uploaded on | 0 Views


Download Presentation

Please find below an Image/Link to download the presentation.

The content on the website is provided AS IS for your information and personal use only. It may not be sold, licensed, or shared on other websites without obtaining consent from the author. If you encounter any issues during the download, it is possible that the publisher has removed the file from their server.

You are allowed to download the files provided on this website for personal or commercial use, subject to the condition that they are used lawfully. All files are the property of their respective owners.

The content on the website is provided AS IS for your information and personal use only. It may not be sold, licensed, or shared on other websites without obtaining consent from the author.

E N D

Presentation Transcript


  1. Faster STR-EC-LCS Computation Kohei Yamada ,Yuto Nakashima , Shunsuke Inenaga , Hideo Bannai Masayuki Takeda Japan Science and Technology Agency, Kawaguchi( ), Japan Presenter : En-An Sung Date : Jan 5, 2021

  2. Abstract(1/2) 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-ECLCS) 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.

  3. Abstract(2/2) 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| | + ( L + 1)( m L + 1) r) time where | | 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 O(1) or m L O(1)), and is at least as efficient as the O (mnr)-time algorithm for all cases.

  4. STR-EC-LCS X = abcabac Y = acbcaacbaa P = abc LCS(X,Y) = abcaba STR-EC-LCS(X,Y,P) = bcaac

  5. LCS by Nakatsu X[i] 0 1 2 3 4 5 6 7 X = abcabac Y = acbcaacbaa LCS length 0 0 0 0 0 0 0 0 0 1 2 3 4 5 6 7

  6. LCS by Nakatsu X[i] 0 1 2 3 4 5 6 7 X = abcabac Y = acbcaacbaa LCS length 0 0 0 0 0 0 0 0 0 1 1 2 3 4 5 6 7

  7. LCS by Nakatsu X[i] 0 1 2 3 4 5 6 7 X = abcabac Y = acbcaacbaa LCS length 0 0 0 0 0 0 0 0 0 1 1 2 3 3 4 5 6 7

  8. LCS by Nakatsu X[i] 0 1 2 3 4 5 6 7 X = abcabac Y = acbcaacbaa LCS length 0 0 0 0 0 0 0 0 0 1 1 2 3 3 4 4 5 6 7

  9. LCS by Nakatsu X[i] 0 1 2 3 4 5 6 7 X = abcabac Y = acbcaacbaa LCS length 0 0 0 0 0 0 0 0 0 1 1 2 3 3 4 4 5 5 8 6 9 7 *

  10. LCS by Nakatsu X[i] 0 1 2 3 4 5 6 7 X = abcabac Y = acbcaacbaa LCS length 0 0 0 0 0 0 0 0 0 1 1 1 2 3 3 4 4 5 5 8 6 9 7 *

  11. LCS by Nakatsu X[i] 0 1 2 3 4 5 6 7 X = abcabac Y = acbcaacbaa LCS length 0 0 0 0 0 0 0 0 0 1 1 1 2 3 3 3 4 4 5 5 8 6 9 7 *

  12. LCS by Nakatsu X[i] 0 1 2 3 4 5 6 7 X = abcabac Y = acbcaacbaa LCS length 0 0 0 0 0 0 0 0 0 1 1 1 2 3 3 3 4 4 4 5 5 5 8 6 6 9 7 *

  13. LCS by Nakatsu X[i] 0 1 2 3 4 5 6 7 X = abcabac Y = acbcaacbaa LCS length 0 0 0 0 0 0 0 0 0 1 1 1 2 3 3 3 4 4 4 5 5 5 8 6 6 9 7 7 *

  14. LCS by Nakatsu X[i] 0 1 2 3 4 5 6 7 X = abcabac Y = acbcaacbaa LCS length 0 0 0 0 0 0 0 0 0 1 1 1 2 3 3 LCS(X,Y) = abcaac 3 4 4 4 5 5 5 8 6 6 9 7 7 *

  15. STR-EC-LCS X = abcabac Y = acbcaacbaa P = abc STR-EC-LCS(X,Y,P) = bcaac

  16. STR-EC-LCS P = abc k = 0 : suffix = (ex : bcababb) k = 1 : suffix = a (ex : bcaba) k = 2 : suffix = ab (ex : bcabab) b b bcaba(k=1,length=5) bcabab (k=2,length=6) bcababb(k=0,length=7)

  17. STR-EC-LCS X = abcabac Y = acbcaacbaa 0 1 2 3 4 5 6 7 0 0 0 0 0 0 0 0 0 1 2 3 4 5 6 7 0 1 2 3 4 5 6 7 0 * * * * * * * * 1 2 3 4 5 6 7 0 1 2 3 4 5 6 7 0 * * * * * * * * 1 2 3 4 5 6 7 suffix = a suffix = ab suffix =

  18. STR-EC-LCS X = abcabac Y = acbcaacbaa + a = a 0 1 2 3 4 5 6 7 0 0 0 0 0 0 0 0 0 1 2 3 4 5 6 7 0 1 2 3 4 5 6 7 0 * * * * * * * * 1 2 3 4 5 6 7 0 1 2 3 4 5 6 7 0 * * * * * * * * 1 2 3 4 5 6 7 suffix = a suffix = ab suffix =

  19. STR-EC-LCS X = abcabac Y = acbcaacbaa + a = a 0 1 2 3 4 5 6 7 0 0 0 0 0 0 0 0 0 1 * 2 3 4 5 6 7 0 1 2 3 4 5 6 7 0 * * * * * * * * 1 1 2 3 4 5 6 7 0 1 2 3 4 5 6 7 0 * * * * * * * * 1 * 2 3 4 5 6 7 suffix = a suffix = ab suffix =

  20. STR-EC-LCS X = abcabac Y = acbcaacbaa a + b = ab 0 1 2 3 4 5 6 7 0 0 0 0 0 0 0 0 0 1 * 2 3 4 5 6 7 0 1 2 3 4 5 6 7 0 * * * * * * * * 1 1 2 3 4 5 6 7 0 1 2 3 4 5 6 7 0 * * * * * * * * 1 * 2 3 4 5 6 7 suffix = a suffix = ab suffix =

  21. STR-EC-LCS X = abcabac Y = acbcaacbaa a + b = ab 0 1 2 3 4 5 6 7 0 0 0 0 0 0 0 0 0 1 * 2 * 3 4 5 6 7 0 1 2 3 4 5 6 7 0 * * * * * * * * 1 1 2 * 3 4 5 6 7 0 1 2 3 4 5 6 7 0 * * * * * * * * 1 * 2 3 3 4 5 6 7 suffix = a suffix = ab suffix =

  22. STR-EC-LCS X = abcabac Y = acbcaacbaa ab + c = abc 0 1 2 3 4 5 6 7 0 0 0 0 0 0 0 0 0 1 * 2 * 3 4 5 6 7 0 1 2 3 4 5 6 7 0 * * * * * * * * 1 1 2 * 3 4 5 6 7 0 1 2 3 4 5 6 7 0 * * * * * * * * 1 * 2 3 3 4 5 6 7 suffix = a suffix = ab suffix =

  23. STR-EC-LCS X = abcabac Y = acbcaacbaa ab + c = abc 0 1 2 3 4 5 6 7 0 0 0 0 0 0 0 0 0 1 * 2 * 3 * 4 5 6 7 0 1 2 3 4 5 6 7 0 * * * * * * * * 1 1 2 * 3 * 4 5 6 7 0 1 2 3 4 5 6 7 0 * * * * * * * * 1 * 2 3 3 * 4 5 6 7 suffix = a suffix = ab suffix =

  24. STR-EC-LCS X = abcabac Y = acbcaacbaa + b = b 0 1 2 3 4 5 6 7 0 0 0 0 0 0 0 0 0 1 * 2 * 3 * 4 5 6 7 0 1 2 3 4 5 6 7 0 * * * * * * * * 1 1 2 * 3 * 4 5 6 7 0 1 2 3 4 5 6 7 0 * * * * * * * * 1 * 2 3 3 * 4 5 6 7 suffix = a suffix = ab suffix =

  25. STR-EC-LCS X = abcabac Y = acbcaacbaa + b = b 0 1 2 3 4 5 6 7 0 0 0 0 0 0 0 0 0 1 * 3 2 * 3 * 4 5 6 7 0 1 2 3 4 5 6 7 0 * * * * * * * * 1 1 1 2 * 3 * 4 5 6 7 0 1 2 3 4 5 6 7 0 * * * * * * * * 1 * * 2 3 3 * 4 5 6 7 suffix = a suffix = ab suffix =

  26. STR-EC-LCS X = abcabac Y = acbcaacbaa + c = c 0 1 2 3 4 5 6 7 0 0 0 0 0 0 0 0 0 1 * 3 2 * 3 * 4 5 6 7 0 1 2 3 4 5 6 7 0 * * * * * * * * 1 1 * 2 * 3 * 4 5 6 7 0 1 2 3 4 5 6 7 0 * * * * * * * * 1 * * 2 3 3 * 4 5 6 7 suffix = a suffix = ab suffix =

  27. STR-EC-LCS X = abcabac Y = acbcaacbaa + c = c 0 1 2 3 4 5 6 7 0 0 0 0 0 0 0 0 0 1 * 3 2 * 4 3 * 4 5 6 7 0 1 2 3 4 5 6 7 0 * * * * * * * * 1 1 * 2 * * 3 * 4 5 6 7 0 1 2 3 4 5 6 7 0 * * * * * * * * 1 * * 2 3 3 3 * 4 5 6 7 suffix = a suffix = ab suffix =

  28. STR-EC-LCS X = abcabac Y = acbcaacbaa + a = a ab + a = aba 0 1 2 3 4 5 6 7 0 0 0 0 0 0 0 0 0 1 * 3 2 * 4 3 * 4 5 6 7 0 1 2 3 4 5 6 7 0 * * * * * * * * 1 1 * 2 * * 3 * 4 5 6 7 0 1 2 3 4 5 6 7 0 * * * * * * * * 1 * * 2 3 3 3 * 4 5 6 7 suffix = a suffix = ab suffix =

  29. STR-EC-LCS X = abcabac Y = acbcaacbaa + a = a ab + a = aba 0 1 2 3 4 5 6 7 0 0 0 0 0 0 0 0 0 1 * 3 2 * 4 3 * * 4 5 6 7 0 1 2 3 4 5 6 7 0 * * * * * * * * 1 1 * 2 * * 3 * 5 4 5 6 7 0 1 2 3 4 5 6 7 0 * * * * * * * * 1 * * 2 3 3 3 * * 4 5 6 7 suffix = a suffix = ab suffix =

  30. STR-EC-LCS X = abcabac Y = acbcaacbaa a + b = ab 0 1 2 3 4 5 6 7 0 0 0 0 0 0 0 0 0 1 * 3 2 * 4 3 * * 4 5 6 7 0 1 2 3 4 5 6 7 0 * * * * * * * * 1 1 * 2 * * 3 * 5 4 5 6 7 0 1 2 3 4 5 6 7 0 * * * * * * * * 1 * * 2 3 3 3 * * 4 5 6 7 suffix = a suffix = ab suffix =

  31. STR-EC-LCS X = abcabac Y = acbcaacbaa a + b = ab 0 1 2 3 4 5 6 7 0 0 0 0 0 0 0 0 0 1 * 3 2 * 4 3 * * 4 5 6 7 0 1 2 3 4 5 6 7 0 * * * * * * * * 1 1 * 2 * * 3 * 5 4 5 6 7 0 1 2 3 4 5 6 7 0 * * * * * * * * 1 * * 2 3 3 3 * * 4 5 6 7 * * 8 suffix = a suffix = ab suffix =

  32. STR-EC-LCS X = abcabac Y = acbcaacbaa ab + a = aba 0 1 2 3 4 5 6 7 0 0 0 0 0 0 0 0 0 1 * 3 2 * 4 3 * * 4 5 6 7 0 1 2 3 4 5 6 7 0 * * * * * * * * 1 1 * 2 * * 3 * 5 4 5 6 7 0 1 2 3 4 5 6 7 0 * * * * * * * * 1 * * 2 3 3 3 * * 4 5 6 7 * * 8 suffix = a suffix = ab suffix =

  33. STR-EC-LCS X = abcabac Y = acbcaacbaa ab + a = aba 0 1 2 3 4 5 6 7 0 0 0 0 0 0 0 0 0 1 * 3 2 * 4 3 * * 4 5 6 7 0 1 2 3 4 5 6 7 0 * * * * * * * * 1 1 * 2 * * 3 * 5 4 5 6 7 0 1 2 3 4 5 6 7 0 * * * * * * * * 1 * * 2 3 3 3 * * 4 5 6 7 * * 8 * 9 * suffix = a suffix = ab suffix =

  34. STR-EC-LCS X = abcabac Y = acbcaacbaa 0 1 2 3 4 5 6 7 0 0 0 0 0 0 0 0 0 1 * 3 2 * 4 3 * * 4 5 6 7 0 1 2 3 4 5 6 7 0 * * * * * * * * 1 1 * 2 * * 3 * 5 4 5 6 7 0 1 2 3 4 5 6 7 0 * * * * * * * * 1 * * 2 3 3 3 * * 4 5 6 7 * * 8 9 * * * * * suffix = a suffix = ab suffix =

  35. STR-EC-LCS X = abcabac Y = acbcaacbaa 0 1 2 3 4 5 6 7 0 0 0 0 0 0 0 0 0 1 * 3 2 * 4 3 * * 4 5 6 7 0 1 2 3 4 5 6 7 0 * * * * * * * * 1 1 * 2 * * 3 * 5 4 5 6 7 0 1 2 3 4 5 6 7 0 * * * * * * * * 1 * * 2 3 3 3 * * 4 5 6 7 * * 8 9 * * * * * suffix = a suffix = ab suffix =

  36. Time complexity O((L + 1)*(m L + 1)*r) r : P s length

Related


More Related Content