Algorithms for Optimal Diverse Matching