public final class ReversalIndependentDistance extends Object implements PermutationDistanceMeasurer
This class implements the concept of a reversal independent distance measure. This is relevant if the permutation and its reverse have the same problem dependent interpretation.
In this case, this class computes the minimum of distance(p1,p2) and distance(p1,reverse(p2)) for a given distance measure passed as a parameter to the constructor.
| Constructor and Description |
|---|
ReversalIndependentDistance(PermutationDistanceMeasurer d)
Constructs a distance measure for measuring distance with reversal independence, such that
distance = min { distance(p1,p2), distance(p1,reverse(p2)) }
|
| Modifier and Type | Method and Description |
|---|---|
int |
distance(Permutation p1,
Permutation p2)
Measures the distance between two permutations, with reversal independence:
distance = min { distance(p1,p2), distance(p1,reverse(p2)) }
|
double |
distancef(Permutation p1,
Permutation p2)
Measures the distance between two permutations
|
public ReversalIndependentDistance(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.