Hi,
I'm trying to calculate the amount of longest possible subsequences that exist between two strings.
e.g. String X = "efgefg"; String Y = "efegf";
output: The Number of longest common sequences is: 3 (i.e.: efeg, efef, efgf - this doesn't need to be calculated by the algorithm, just shown here for demonstration)
I've managed to do this in O(|X|*|Y|) using dynamic programming based on the general idea here: http://stackoverflow.com/questions/2207987/cheapest-path-algorithm.
Can anyone think of a way to do this calculation with better runtime efficiently?
--Edited in response to Jason's comment.