Single-point crossover#

single_point_crossover() draws a cut point and exchanges the tails of the two parents. pymoo (SinglePointCrossover), DEAP (cxOnePoint) and DESDEO (SinglePointBinaryCrossover) provide the same operator. The operator of DESDEO only accepts binary variables, so all packages cross over binary parents here: a parent of zeros and a parent of ones in the KS tests, and random binary parents in the timings.

KS test results#

moocore

pymoo

deap

desdeo

moocore

0.995

0.996

0.650

pymoo

0.995

0.531

0.422

deap

0.996

0.531

0.177

desdeo

0.650

0.422

0.177

All implementations produce the same distribution of offspring.

Performance over number of parents#

../../_images/crossover_bench-single_point-nparents-time.png

With 10 and 20 parents, DEAP is faster than moocore. From 50 parents on, moocore is the fastest. With 10 000 parents, it takes 0.14 ms, while DESDEO, DEAP and pymoo take 9.8, 18 and 270 times as long.

Performance over number of variables#

../../_images/crossover_bench-single_point-nvars-time.png

moocore is the fastest for every number of variables. DEAP takes 2.5 to 5 times as long, and pymoo and DESDEO take 24 to 144 times as long.