Each generation is an individual-based, discrete-time Wright-Fisher model, the same engine used by the 3D version of this simulator, rendered here as three linked 2D charts instead of a 3D grid. A chromosome is 41 linked sites (positions -20…+20, ~2 kb apart); site 0 is under selection. Every one of N offspring picks a "primary" parent with probability proportional to fitness:
w = 1 + s (carries the beneficial allele)
w = 1 (ancestral allele)
P(parent = i) = w_i / Σ w_j
Averaged over the population this reproduces the deterministic selection recursion p' = p(1+s)/(1+ps) — the discrete-generation form of dp/dt = s·p(1-p) — shown as the dashed theory curve on the trajectory chart, with genetic drift from finite N added on top of the realized (solid) simulated curve.
Linked neutral sites hitchhike unless recombination breaks them free. For a site at genetic distance d from the selected locus, the per-generation probability of recombining onto a random second parent is:
P(recombine) = 1 - e^(-r·d)
Near d = 0 this probability is tiny, so those sites are dragged to fixation along with the sweeping allele — the classic genetic hitchhiking effect (Maynard Smith & Haigh, 1974). Far sites recombine often and keep reshuffling among the population's original lineages, so diversity there stays high. The valley chart plots realized diversity at every site alongside the closed-form hitchhiking approximation p_linked ≈ p(r·d/s), the fixation probability of a marker at genetic distance d given a sweep of strength s.
- Selection coefficient s — fitness advantage of the beneficial allele; higher s sweeps faster and leaves a wider hitchhiking footprint.
- Recombination rate r — how quickly linkage decays with distance; higher r narrows the swept block.
- Population size N — more individuals means more distinguishable lineages and stronger selection relative to drift.
- Diversity H — Simpson heterozygosity 1 − Σ(freq_k)² over the distinct ancestral lineages still present at a site; it collapses toward 0 as one lineage sweeps to fixation.
Real-world relevance: this exact signature — a dip in nucleotide diversity flanked by an extended haplotype of low recombination — is how genome scans detect recent positive selection, e.g. around the human LCT lactase-persistence locus.