this is a
readme.md
file that introduces the SGA
- double click the
SimpleGA.exe
file - there are 2 inputs that are required from user, one is
POPULATION_SIZE
, the other isN
(chessboard size)
- make sure you have installed python(3.9) and open the file with spyder or pycharm
The basic thought of this algorithm is based on the reference book: Introduction to Evolutionary Computing, chapter 3-4-1 The Eight-Queens problem
This chapter introduce 2 operation:
- "Cut&fill" Crossover
- "Swap" Mutation
- Select a random position, the crossover point, i
$\in$ {1, 2, 3, 4, 5, 6, 7} - Cut both parents into two segments at this position
- Copy the first segment of parent 1 into child 1 and the first segment ofparent 2intochild 2
- Scan parent 2 from left to right and fill the second segment of child 1 with values from parent 2, skipping those that it already contains
- Do the same for parent 1 and child 2
- Randomly choose 2 position and swap thier values