Sorting objects into categories that have attributes in common