I have two strings, where one is a permutation of the other. I was wondering if there is an alternative to Hamming distance where instead of finding the minimum number of substitutions required, it would find the minimum number of translocations required to go from string a to string b.
My strings are always of the same size and I know there are no errors/substitutions.
Example:
1 2 3 4 5
3 2 5 4 1
This would give me two:
3 2 5 4 1 (start)
-> 3 2 1 4 5
-> -> 1 2 3 4 5
If this is already implemented in R that would be even better.