sequential consecutive crossover algorithm in python