Topological Optimization and Optimal Transport