note
lima1
I am not an expert, but a related problem in bioinformatics is the
multiple sequence alignment (which is basically the longest common sequence with sophisticated scoring functions). exact DP solutions are O(n^m) and the implementation gets really ugly for n>2. So people use heuristics. Which one works depends how similar the strings are, how many you want to align etc... A simple and common approach is to cluster the strings in pairs with something like UPGMA, calculate the pair lcs and then calculate the lcs of the pair lcs according some special rules. [http://en.wikipedia.org/wiki/Multiple_sequence_alignment
].
<p>
The substring problem is solvable in linear time with suffix arrays/trees. [cpan://Tree::Suffix] claims to have this function.
685562
685758