문제

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.

다른 팁

The answer to this query would best be understood by looking at the biological processes on which GA is based.

Assuming what you're looking for is a single-point crossover, what you would need is as illustrated below; crossovers affect the entire chromosomes and not just "the smallest swappable unit".

enter image description here

Details about more complex crossover scenarios such as multi-point crossover or ring crossovers may be found at the Wikipedia resource here.

라이센스 : CC-BY-SA ~와 함께 속성
제휴하지 않습니다 StackOverflow
scroll top