Class EnhancedEdgeRecombination
- All Implemented Interfaces:
PermutationBinaryOperator
,Splittable<CrossoverOperator<Permutation>>
,CrossoverOperator<Permutation>
The original Edge Recombination operator, implemented in the EdgeRecombination
class,
is designed to create children that inherit undirected edges from the parents. A child
permutation inherited an edge (i,j), if i and j are in adjacent positions anywhere in the child,
and if there is at least one parent that likewise includes i and j in adjacent positions. Since
the operator considers edges to be undirected, the order also doesn't matter. For example, if j
immediately follows i in the child, then a parent may have been such that i immediately followed
j. And since it considers the permutation to be a cycle, the two endpoints are considered to be
adjacent. The documentation of the EdgeRecombination
class includes an explanation of the
inner workings of the operator, along with an example.
The Enhanced Edge Recombination operator additionally attempts to create children that inherit common subsequences of edges from the parents. It does so using a modified version of the edge map data structure introduced by Whitley et al for efficient implementation of the original Edge Recombination. Starkweather et al's modification involves augmenting the edge map to mark the edges that the parents have in common. Then, when constructing the child, during the decision of which element to add next to the permutation, an edge that is the start of a common subsequence of edges is preferred over other edges from the parents.
We leave the details to the paper that introduced the Enhanced Edge Recombination operator:
T. Starkweather, S McDaniel, K Mathias, D Whitley, and C Whitley. A Comparison of Genetic
Sequencing Operators. Proceedings of the Fourth International Conference on Genetic
Algorithms, pages 69-76, 1991.
The worst case runtime of a call to cross
is O(n), where n is the length of the
permutations.
-
Constructor Summary
ConstructorDescriptionConstructs an enhanced edge recombination operator. -
Method Summary
Modifier and TypeMethodDescriptionvoid
apply
(int[] raw1, int[] raw2) SeePermutationBinaryOperator
for details of this method.void
cross
(Permutation c1, Permutation c2) Performs a crossover for an evolutionary algorithm, such that crossover forms two children from two parents.split()
Generates a functionally identical copy of this object, for use in multithreaded implementations of search algorithms.
-
Constructor Details
-
EnhancedEdgeRecombination
public EnhancedEdgeRecombination()Constructs an enhanced edge recombination operator.
-
-
Method Details
-
cross
Description copied from interface:CrossoverOperator
Performs a crossover for an evolutionary algorithm, such that crossover forms two children from two parents. Implementations of this method modify the parameters, transforming the parents into the children.- Specified by:
cross
in interfaceCrossoverOperator<Permutation>
- Parameters:
c1
- A candidate solution subject to the crossover. This method changes the state of c1.c2
- A candidate solution subject to the crossover. This method changes the state of c2.
-
split
Description copied from interface:Splittable
Generates a functionally identical copy of this object, for use in multithreaded implementations of search algorithms. The state of the object that is returned may or may not be identical to that of the original. Thus, this is a distinct concept from the functionality of theCopyable
interface. Classes that implement this interface must ensure that the object returned performs the same functionality, and that it does not share any state data that would be either unsafe or inefficient for concurrent access by multiple threads. The split method is allowed to simply return the this reference, provided that it is both safe and efficient for multiple threads to share a single copy of the Splittable object. The intention is to provide a multithreaded search with the capability to provide spawned threads with their own distinct search operators. Such multithreaded algorithms can call the split method for each thread it spawns to generate a functionally identical copy of the operator, but with independent state.- Specified by:
split
in interfaceSplittable<CrossoverOperator<Permutation>>
- Returns:
- A functionally identical copy of the object, or a reference to this if it is both safe and efficient for multiple threads to share a single instance of this Splittable object.
-
apply
public void apply(int[] raw1, int[] raw2) SeePermutationBinaryOperator
for details of this method. This method is not intended for direct usage. Use thecross(org.cicirello.permutations.Permutation, org.cicirello.permutations.Permutation)
method instead.- Specified by:
apply
in interfacePermutationBinaryOperator
- Parameters:
raw1
- The raw representation of the first permutation.raw2
- The raw representation of the second permutation.
-