0

Is there a way to solve longest common subsequence(LCS) problem using branch and bound technique. I understand branch and bound but I am not able to apply the technique to solve LCS. Just wanted forum opinion to point in right direction to find the solution.

zeal
  • 465
  • 2
  • 11
  • 22
  • In order to apply B&B to a maximisation problem like this one, you need to somehow generate partial solutions that give *upper* bounds on the solution size (length of the common subsequence). The usual recursive procedure that would generate all common subsequences will produce sequences of *increasing* length as you go deeper in the search tree -- that is, that give *lower* bounds on the length of the optimal solution -- so it won't work directly, but ... – j_random_hacker Nov 23 '16 at 14:49
  • ... you can adapt it into something that gives upper bounds by adding any upper bound on the remaining parts of the sequences. For example, suppose string #1 has length 100 and string #2 has length 200, and you are at a search node where you have already decided that the first 10 characters of sequence #1 and the first 15 characters of sequence #2 have a common subsequence of length 5: you could get an *upper* bound on the best possible CS length achievable with the remaining 90 characters from S #1 and the remaining 185 characters of S #2 by counting character frequencies, taking the ... – j_random_hacker Nov 23 '16 at 14:53
  • ... minimum between the 2 sequences for each character, and adding these minimums. This upper bound can be added to the CS of length 5 that you have already decided. – j_random_hacker Nov 23 '16 at 14:53
  • @j_random_hacker Thank you, I somewhat got what you are saying about the bound but it is not very clear to me. If possible could you please provide a pseudo code for solving the problem. – zeal Nov 24 '16 at 00:55

0 Answers0