I have been using my own GA for a while where I use random selection and elitism (top 10% or so) to get 50% of my population. I then do crossover to produce the next 50%, followed by mutation of course. It sounds strange, but it has gotten me far enough in my problem to be satisfied with it for now.
I'd like to start using more elaborate selection methods, specifically ranked selection. I'd also like to employ a crossover probability.
My questions are:
- When doing ranked selection, is each individual only allowed to be selected once?
- What typically happens to the parents after crossover? Do they get replaced by children or do they also go onto the next generation?
Well, if every individual was allowed to be selected only once, you would have to copy the whole population to form the new one. In ranked selection you just pick probabilistically with probability proportional to the rank of the individual and let the chance decide whether or which individual gets copied more times.
It depends. If you have a so-called generational scheme, you always generate a whole new population that replaces the old one completely. The members of this new population are from these four "sources":
On the other hand, you can have a so-called steady state scheme. In this scheme, in each iteration you select just enough individuals to be able to perform crossover, cross them over (if probability allows), mutate them (if probability allows) and then you somehow put them back into the original population. That means that someone must get thrown away. This may be the parents or the children (if one is worse than the other) or an arbitrary member of the population based on your replacement strategy. You can do e.g. "inversed" selection, i.e. selection with probabilites the other way around (the worst gets the highest while the best gets the lowest).
One final remark - in the realm of GAs, almost any mechanism you come up with may work for your particular problem, or it may not. You just have to try. It's a stochastic method after all.