Optimalization with clusters