I want to implement roulette wheel selection in my GA algorithm. I tried following guide https://stackoverflow.com/a/5315710/536474 but it sends back the new population instead of 2 best parents. Suppose I already found fitness score for the initial population and now I need to select two parent chromosomes for a population according to their fitness. And further it goes for crossover and mutation processes. In the following case, how can I find 2 best parents for crossover based on roulette wheel selection?
population = [[text1],[text2],[text3],.....[textnum]]
fitnesses = [0.8057515980834005, 1.2151126619653638, 0.6429369518995411, ... 0.805412427797966]
num = 50