Optimization of the possible pathways for gradual energy system decarbonization