Sorting contacts by similarity.