use triplets to find cluster centers