Pergunta

Given two circular lists, is there an efficient way to compute the optimal alignment between the two lists? For example, given circular lists:

a b b c
b c a

the optimal alignment is

a b b c
a b _ c

because this alignment has the smallest edit distance (note: this optimal alignment is not and need not be unique).

One way to do this is to compute the edit distance between the first list and each cyclic permutation of the second list, taking the minimum edit distance as the optimal alignment. Is there a more efficient way to do so?

Foi útil?

Solução

suppose S1="abbc", S2="bca"

now let S2'=strcat(S2,S2)="bcabca", then compute edit distance between S1 and S2', you will get

--abbc-
bcab-ca

just a hint, more details should be considered

Licenciado em: CC-BY-SA com atribuição
Não afiliado a StackOverflow
scroll top