clustering of equivalence classes