A program in Python was written to simulate the hybridisation between two populations under natural selection. This program incorporates the concept of fitness epistasis, which is the interaction between fitness effects of different genetic loci. Simulations with varied population size, selection strength, fitness epistasis and D/n (genetic loci number to phenotypic trait number) ratio were done to investigate their effect on the fitness outcome of hybridisation.
There are two hypothetical populations, P1 and P2. They have diverged from a common ancestor and have each accumulated mutations that made them differ genetically at D variable loci. Each locus contains two possible alleles. For ease of notation, the allele present in P1 is set as the reference allele, and the allele in P2 is set as the derived allele. At each locus, an individual can carry 0, 1 or 2 copies of the derived allele. The genotype of any one individual can be represented by a vector of length D, in which the genotype at locus