How should roulette wheel selection be organized for non-sorted population in genetic algorithm?
My question is linked with this one: Roulette-wheel selection in Genetic algorithm. Population needs to be sorted first? If we don't sort the population what is the way of organizing roulette wheel selection for it? Surely, we have to search in linear way now. Have you got any code snippets in C++ or Java for this case? The population does not need to be sorted at all - the key to roulette selection is that the probability of a given individual being selected for reproduction is proportional to its fitness. Say you have an unsorted population, with fitnesses as follows: [12, 45, 76, 32, 54, 21