Beefy Boxes and Bandwidth Generously Provided by pair Networks
P is for Practical
 
PerlMonks  

Re^2: Finding a LCS module on word level

by Limbic~Region (Chancellor)
on May 09, 2008 at 20:05 UTC ( [id://685758]=note: print w/replies, xml ) Need Help??


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

lima1,
Forget chars vs words for a second. Are you familiar with DP solution for LCS (where S=substring or S=subsequence - I don't care) that works for more than 2 strings? I wrote Longest Common Subsequence because I couldn't find any working examples for > 2 strings but am still interested.

Cheers - L~R

  • Comment on Re^2: Finding a LCS module on word level

Replies are listed 'Best First'.
Re^3: Finding a LCS module on word level
by lima1 (Curate) on May 10, 2008 at 10:31 UTC
    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.

Log In?
Username:
Password:

What's my password?
Create A New User
Domain Nodelet?
Node Status?
node history
Node Type: note [id://685758]
help
Chatterbox?
and the web crawler heard nothing...

How do I use this?Last hourOther CB clients
Other Users?
Others contemplating the Monastery: (3)
As of 2024-04-25 19:47 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    No recent polls found