CSC266 ยท 2078 ยท 5 marks
What is iscrossver operation in genetic algorithm? Given following chromosomes show the result of one-point and two point crossover. C1 = 01100010, C2 = 10101100. Choose appropriate crossover points as per your own suggestions.
What is iscrossver operation in genetic algorithm? Given following chromosomes show the result of one-point and two point crossover. C1 = 01100010, C2 = 10101100. Choose appropriate crossover points as per your own suggestions. [5]
Crossover Operation in Genetic Algorithm
Given Data
- Chromosome $C_1 = 01100010$
- Chromosome $C_2 = 10101100$
- Each chromosome has 8 bits.
- Crossover points to be chosen by student.
Position indexing:
C1 = 0 1 1 0 0 0 1 0
C2 = 1 0 1 0 1 1 0 0
1 2 3 4 5 6 7 8
Definition of Crossover
Crossover (also called recombination) is a genetic operator in a Genetic Algorithm that combines the genetic material of two parent chromosomes to produce one or more offspring. Two parents are selected from the mating pool, one or more crossover points are chosen, and the segments of the parents are exchanged around these points. Crossover is the primary operator responsible for exploring new regions of the search space by recombining good building blocks (schemas) from both parents, thereby helping the population converge toward better solutions.
One-Point Crossover
Chosen crossover point: after position 4.
Split at position 4:
| Chromosome | Head (pos 1-4) | Tail (pos 5-8) |
|---|---|---|
| $C_1$ | 0110 | 0010 |
| $C_2$ | 1010 | 1100 |
Swap the tails:
C1 = 0110 | 0010
C2 = 1010 | 1100
^ (cut after position 4)
O1 = 0110 | 1100 = 01101100
O2 = 1010 | 0010 = 10100010
Offspring: $O_1 = 01101100$, $O_2 = 10100010$.
Verification of bit copy:
- O1 head = C1 head
0110โ; O1 tail = C2 tail1100โ - O2 head = C2 head
1010โ; O2 tail = C1 tail0010โ
Two-Point Crossover
Chosen crossover points: after position 2 and after position 6.
Split into three segments:
| Chromosome | Seg 1 (1-2) | Seg 2 (3-6) | Seg 3 (7-8) |
|---|---|---|---|
| $C_1$ | 01 | 1000 | 10 |
| $C_2$ | 10 | 1011 | 00 |
Check the middle segment of C1 (pos 3-6): C1 = 0 1 1 0 0 0 1 0 โ 1000 โ
Middle segment of C2 (pos 3-6): C2 = 1 0 1 0 1 1 0 0 โ 1011 โ
Swap the middle segment:
C1 = 01 | 1000 | 10
C2 = 10 | 1011 | 00
^ ^
cut after 2 cut after 6
O1 = 01 | 1011 | 10 = 01101110
O2 = 10 | 1000 | 00 = 10100000
Offspring: $O_1 = 01101110$, $O_2 = 10100000$.
Summary Table
| Operation | Crossover Points | Offspring 1 | Offspring 2 |
|---|---|---|---|
| One-Point | after pos 4 | 01101100 | 10100010 |
| Two-Point | after pos 2 & 6 | 01101110 | 10100000 |
Crossover recombines features of both parents to generate new candidate solutions, which is essential for the genetic algorithm to search effectively and converge toward an optimal solution.
Short on time? The 1, 5 and 10 mark versions of this answer, flashcards and practice sets come with a program pass.