perdistance
Perdistance, short for permutation distance, is a distance measure between two vectors that accounts for all possible re-orderings of coordinates and takes the smallest distance achieved under any permutation. It is used in contexts where the arrangement of features is not fixed or where only the multiset of feature values matters.
Formal definition: Let x and y be vectors in R^n. For each permutation π of {1,...,n}, let P_π
Properties: Perdistance is non-negative and symmetric. If y is a permutation of x, the distance is zero.
Computation: A naive implementation that checks all permutations is factorial in time. In practice, the problem
Variants and applications: Variants may restrict permutations to blocks, use partial permutations, or blend permutation distance