http://qs321.pair.com?node_id=685847


in reply to Re^2: Finding a LCS module on word level
in thread Finding a LCS module on word level

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.

The substring problem is solvable in linear time with suffix arrays/trees. Tree::Suffix claims to have this function.