We propose a technique to accurately correct the spherical topology of cortical surfaces. We construct a mapping from the original surface onto the sphere to detect topological defects as minimal non-homeomorphic regions. A genetic algorithm corrects each defect by finding the maximum-a-posteriori retessellation in a Bayesian framework. During the genetic search, incorrect vertices are iteratively identified and eliminated, while the optimal retessellation is constructed. Applied to synthetic and real data, our method generates optimal topological corrections with only a few iterations.