The cross scheme in a Genetic Algorithm determines how 2 parent genes combine to produce a child gene.
The cross schemes used by the Maze Solver are
Choose randomly between the other defined cross schemes
Cut 2 genes at a random index. Combine the parts.
Example:
Before Crossing Index 0 1 2 3 4 5 6 7 8 Parent1 E E E E E E E E E Parent2 N N N N N N N N N After Crossing using index = 2 Index 0 1 2 3 4 5 6 7 8 Child E E E N N N N N N
Insert a random section from one gene into another.
Example:
Before Crossing Index 0 1 2 3 4 5 6 7 8 Parent1 E E E E E E E E E Parent2 N N N N N N N N N After Crossing using index1 = 2 index2 = 5 Index 0 1 2 3 4 5 6 7 8 Child E E E N N N E E E
Remove a random section from one gene, append steps from the other.
Example:
Before Crossing Index 0 1 2 3 4 5 6 7 8 Parent1 E W S E W S E W S Parent2 N N N N N N N N N After Crossing using index1 = 1 index2 = 3 Index 0 1 2 3 4 5 6 7 8 Child E W W S E W S N N
Combine the parent genes stepwise.
Example of possible outcome:
Before Crossing Index 0 1 2 3 4 5 6 7 8 Parent1 E E E E E E E E E Parent2 N N N N N N N N N After Crossing (example) Index 0 1 2 3 4 5 6 7 8 Child E N N E E N E N E