I created another generator which represents more of a pounding fists on a keyboard approach -- random strings of random lengths as input. The fact that String::LCSS_XS::lcss_all returns a different number of longest common substrings from your brute code is giving me an ice cream headache. So, I won't be of much use in any further theoretical analysis. Here is an example pair of input strings that shows what I'm talking about:
gghdagahkk akakdadghgh BrowserUk lcss_brute: $VAR1 = [ 'gh', 'da' ]; String::LCSS_XS::lcss_all: $VAR1 = [ 'da', 'gh', 'gh' ];
After I uniq and sort the results, the 2 models match (I have checked this on millions of input string pairs).
In any case, I think I'll revise the patch I uploaded for String::LCSS to use your new code. Un-optimized, but functionally correct code is better than broken code. (UPDATE: I uploaded a new patch)
In reply to Re^5: A better implementation of LCSS? (Do you have any combinatorics expertise to bring to bear?)
by toolic
in thread A better implementation of LCSS?
by BrowserUk
| For: | Use: | ||
| & | & | ||
| < | < | ||
| > | > | ||
| [ | [ | ||
| ] | ] |