Class ScrambleDistance

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

public final class ScrambleDistance extends Object implements NormalizedPermutationDistanceMeasurer
Scramble Distance is the minimum number of random shufflings needed to transform one permutation into the other. This was implemented for a very specific purpose, and unlikely to be subsequently useful.

The scramble distance is 0 if permutation p1 is identical to p2. Otherwise, scramble distance is 1.

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

  • Constructor Details

    • ScrambleDistance

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