The figure showing the haplotypes of a population before and after a selective sweep is given below:
We assume that at each locus A and B, a pair of alleles is present – black (b) and grey (g). The linkage disequilibrium before selection can be calculated in the following way:
Since D is 0, this population was in linkage equilibrium before the sweep.
After selection:
The number of haplotypes has changed since the red allele is favored.
Since D is not 0, this population is in linkage disequilibrium. The process of selective sweep allows alleles, which are physically linked and at nearby loci to move to higher frequency of linkage disequilibrium.