In biological reproduction, offspring inherit traits from both parents — a child might have their mother's eyes and their father's nose. Genetic Algorithms replicate this exact mechanism through crossover (recombination), the process of combining two parent DNA arrays to produce a new child individual.
Crossover is arguably the most important operator in a GA. Without it, a GA is little more than random search. With it, evolution can rapidly assemble beneficial building blocks from different parents into superior offspring.
1. Why Crossover Works: The Building Block Hypothesis
John Holland's Schema Theorem and the associated Building Block Hypothesis explain why crossover is so effective. Short, low-order, high-fitness gene sequences (called schemata or building blocks) tend to be preserved and combined across generations.
Imagine Parent A has excellent color genes and Parent B has excellent shape genes. Crossover can combine them, potentially producing a child that inherits both advantages simultaneously — something that random mutation alone would take exponentially longer to stumble upon.
2. Types of Crossover
Single-Point Crossover
The simplest form. A random cut point is chosen along the DNA string. The two parents exchange the tail segments after that cut point:
Parent A: [A1 A2 A3 | A4 A5 A6]
Parent B: [B1 B2 B3 | B4 B5 B6]
Child 1: [A1 A2 A3 | B4 B5 B6]
Child 2: [B1 B2 B3 | A4 A5 A6]
Simple and fast, but limited: genes on the same side of the cut always stay together.
Two-Point Crossover
Two cut points are chosen, and the middle segment is swapped. This allows more varied gene combinations than single-point crossover.
Uniform Crossover
For each gene position, flip a coin: inherit from Parent A or Parent B with equal probability. This produces the most diverse offspring and is used in gene46.
Uniform Crossover in gene46
Each of the dozens of real-valued DNA parameters (curve coordinates, colors, line widths) is independently assigned from either parent at 50% probability. This creates children that are genuine mixes of both parents' visual traits rather than inheriting a contiguous "half" from each.
Real-Valued Crossover: BLX-α (Blend Crossover)
For real-numbered genes, simple segment swapping can be wasteful. BLX-α (Blend Crossover Alpha) instead samples child gene values from within — and slightly beyond — the range between the two parents' values:
Parent A gene: 0.3
Parent B gene: 0.7
α = 0.5
Range: [0.3, 0.7], extended by α → [0.1, 0.9]
Child gene: sampled uniformly from [0.1, 0.9]
The α parameter controls how far beyond the parents' range the child can explore. Higher α = more exploratory; lower α = more conservative blending.
3. Crossover Rate
Not every pair of parents undergoes crossover. The crossover rate (typically 0.6–0.9) determines the probability that two parents actually recombine versus simply copying themselves. A common configuration:
- Crossover rate: 0.8 (80% of pairs recombine)
- Mutation rate: 0.01–0.05 (1–5% chance per gene)
4. Crossover vs. Mutation: Complementary Roles
Crossover and mutation serve different evolutionary roles:
- Crossover explores new combinations of existing good genes — exploiting what evolution has already discovered.
- Mutation introduces genuinely new genetic material — exploring regions of the search space that no parent has visited.
A GA without crossover is slow to combine beneficial traits. A GA without mutation is vulnerable to premature convergence. Together, they balance exploitation and exploration.
5. What Crossover Looks Like in Practice (gene46)
When you right-swipe 8 individuals in gene46, those 8 become the parent pool. The system randomly pairs them and applies uniform crossover across all DNA parameters. The resulting children inherit a random mix of each parent's curve positions, color values, and shape parameters — creating visual offspring that genuinely resemble both parents while introducing novel combinations neither parent possessed.
This is why certain visual traits (a particular curve shape, a color family) can persist and strengthen across many generations: they are repeatedly selected and recombined into winning combinations.
📚 References
- John H. Holland (1975), Adaptation in Natural and Artificial Systems
- L.J. Eshelman & J.D. Schaffer (1993), Real-Coded Genetic Algorithms and Interval-Schemata
- Wikipedia: Crossover (genetic algorithm)