Mathematica notebook from The limits to parapatric speciation 3: Evolution of strong reproductive isolation in presence of gene flow despite limited ecological differentiation

Gene flow tends to impede the accumulation of genetic divergence. Here, we determine the limits for the evolution of postzygotic reproductive isolation in a model of two populations that are connected by gene flow. We consider two selective mechanisms for the creation and maintenance of a genetic barrier: local adaptation leads to divergence among incipient species due to selection against migrants, and Dobzhansky–Muller incompatibilities (DMIs) reinforce the genetic barrier through selection against hybrids. In particular, we are interested in the maximum strength of the barrier under a limited amount of local adaptation, a challenge that many incipient species may initially face. We first confirm that with classical two-locus DMIs, the maximum amount of local adaptation is indeed a limit to the strength of a genetic barrier. However, with three or more loci and cryptic epistasis, this limit holds no longer. In particular, we identify a minimal configuration of three epistatically interacting mutations that is sufficient to confer strong reproductive isolation.This article is part of the theme issue ‘Towards the completion of speciation: the evolution of reproductive isolation beyond the first barriers’.