Approximation Schemes for Inferring Rankings and Clusterings from Pairwise Data