Global optimization of clustering problems