Recoloring optimization