Finding Optimal Solutions for Covering and Matching Problems