Cycle Crossover (CX) is a genetic algorithm (GA) crossover technique used in AI and evolutionary computing for recombining two parent solutions to produce offspring while preserving position-based information.
How It Works
Cycle Crossover ensures that every position in the offspring inherits values from exactly one parent while maintaining the order and uniqueness of elements (especially useful for permutations, like the Traveling Salesman Problem).
Steps of Cycle Crossover
Identify Cycles
- Start with the first gene (position) in Parent 1.
- Find the corresponding value in Parent 2 at that position.
- Locate this value’s index in Parent 1.
- Repeat this process until you return to the starting index, forming a cycle.
Swap Values
- Copy the cycle's values from Parent 1 to Offspring 1.
- Fill remaining positions with values from Parent 2.
Repeat for the Second Offspring
- Perform the same process but swap parent roles.
No comments:
Post a Comment