String 1: X = ABCABCABC
String 2: Y = BABACBAB
Common subsequence 1: AAA
X = ABCABCABC Y = BABACBAB
Common subsequence 2: ABAA
X = ABCABCABC Y = BABACBAB
Common subsequence 3: ABABA
X = ABCABCABC Y = BABACBAB
Common subsequence 4: ABABAB
X = ABCABCABC Y = BABACBAB
Longest Common Subsequence (LCS)
The LCS problem:
Given2 strings X and Y
Find the longest common substring
in X and Y
Applications
Gene similarity:
When 2 gene sequences (strings)
have a large (long)
common subsequence,
the genes are more alike
The LCS algorithm will
allow you to discovergenes that are
similar
Text similarity testing:
Given 2 text documents
The longer their
common substring, the
better the match
between the 2 text documents.
The LCS algorithm will
allow you to
discoverplagerized documents