Motivation: A few algorithms have been developed for splitting the genome in nearly independent blocks of linkage disequilibrium. Due to the complexity of this problem, these algorithms rely on heuristics, which makes them suboptimal. Results: Here, we develop an optimal solution for this problem using dynamic programming.