optimized k-center algorithm