public final class CyclicIndependentDistance extends Object implements PermutationDistanceMeasurer
This class implements the concept of a cyclic independent distance measure. This is relevant if any rotation of the permutation has the same problem dependent interpretation.
In this case, this class computes the minimum of the distance from permutation p1 to rotations of p2, where the underlying distance measure is passed as a parameter to the constructor.
| Constructor and Description |
|---|
CyclicIndependentDistance(PermutationDistanceMeasurer d)
Constructs a distance measure for measuring distance with cyclic independence, such that
distance = min_{i in [0,N)} distance(p1,rotate(p2,i))
|
| Modifier and Type | Method and Description |
|---|---|
int |
distance(Permutation p1,
Permutation p2)
Measures the distance between two permutations, with cyclic independence:
distance = min_{i in [0,N)} distance(p1,rotate(p2,i))
|
double |
distancef(Permutation p1,
Permutation p2)
Measures the distance between two permutations
|
public CyclicIndependentDistance(PermutationDistanceMeasurer d)
d - A distance measure.public int distance(Permutation p1, Permutation p2)
distance in interface PermutationDistanceMeasurerp1 - first permutationp2 - second permutationpublic final double distancef(Permutation p1, Permutation p2)
distancef in interface PermutationDistanceMeasurerDoublep1 - first permutationp2 - second permutationCopyright © 2005-2020 Vincent A. Cicirello. All rights reserved.