A Game-Theoretic Approach to Pairwise Clustering and Matching