KmeansOPT function

Finds the partition which minimize the within-leaves sum of squares.