I am in the process of writing a small genetic algorithm framework in C++. My chromosomes are encoded as bit strings, where each gene has a predetermined size. Each chromosome stores its genes one after the other in the bit string. Now, I am looking to implement the crossover operator.
My question is, when choosing a point after which to insert bits from the other chromosome, do I do this on a gene boundary or do I just treat the chromosome as a string of bits, and ignore the division into genes? In other words, do I treat the smallest swappable unit as a gene or a bit?
When two chromosome reproduce together, there is a random probability of the gene crossover. Therefore, you should only cross what you consider genes instead of the smaller units.