Is there a way to compute quantitatively the distance between two permutations?
Suppose we have the following two sequences of elements:
A = {0, 1, 2, 3}
B = {0, 3, 2, 1}
I could say that the permutation B
differs from A
because:
- I would require 1 swap operation in order to transform
B
toA
- There are 2 elements within
B
that have an index that is different for the same elements inA
Are there other ways to compare and describe the difference between those two?
The main goal is to define an algorithm that is able to approach the second permutation B
to the first one A
, such that if all the steps of this procedure are applied the outcome would be the permutation A
itself.
But in order to to that I think it should be best to define first a sensible procedure that describes how much B
differs from A
.
Is there any known algorithm that allows to approach on permutation to another?