Class InterchangeDistance

java.lang.Object
org.cicirello.permutations.distance.InterchangeDistance
All Implemented Interfaces:
NormalizedPermutationDistanceMeasurer, NormalizedPermutationDistanceMeasurerDouble, PermutationDistanceMeasurer, PermutationDistanceMeasurerDouble

public final class InterchangeDistance extends Object implements NormalizedPermutationDistanceMeasurer
Interchange distance is the minimum number of swaps necessary to transform one permutation into the other.

Interchange distance is computed efficiently by counting the number of permutation cycles between the permutations. A permutation cycle of length k is transformed into k fixed points with k − 1 swaps (a fixed point is a cycle of length 1).

Runtime: O(n), where n is the permutation length.

Computing Interchange distance using cycle lengths is described in:
V.A. Cicirello, "The Permutation in a Haystack Problem and the Calculus of Search Landscapes," IEEE Transactions on Evolutionary Computation, 20(3):434-446, June 2016.

  • Constructor Details

    • InterchangeDistance

      public InterchangeDistance()
      Constructs the distance measurer as specified in the class documentation.
  • Method Details