Optimization of the treatment plan