I am fairly new to optimization modelling but I am encountering a situation in which I supply initial values to my problem and then after I run my optimization those initial values change. This seems counter-intuitive to me though because if the initial values define the starting point of the problem, how then would these values be altered during the optimization process?

This leads me to my question regarding "warm starts". Unfortunately the book I am learning from does not mention what a warm start is, but from what I gather it seems to have something to do with regards to initial values being supplied to solvers. As well, when I Google some variant of what a warm start is, I get a lot of papers on all the various methods to implement them, but not really explaining what they are. If someone would be able to clarify what a warm-start is, and if it's related to my issue, that would be great.


2 Answers 2


There is a difference between an initial condition and initial values. Initial conditions in the context of differential equations fix the values of dynamic variables at the initial point. When you provide initial values for your variables you are essentially providing a guess of where you think the optimal point is. The optimizer is still free to move the variable values as it (hopefully) converges to the optimal solution (minimizes or maximizes the objective function while satisfying all constraints). A warm start usually means that you're using the optimal solution of a related/simplified optimization problem to provide the initial values (guess) for the problem you actually care about. The hope is that the problems are similar enough that the warm start will get you close to the optimal solution and make convergence easier. Providing a good initial guess is particularly important when solving nonlinear optimization problems or problems known to have many local minima.

  • $\begingroup$ So I think that maybe I am mixing up "initial value" and "initial condition". With regards to Pyomo, when you "initialize" a variable value, this would not be the same as saying something like "At t=0 the value of variable x is 10" but instead saying that "I think the optimal value at t=0 is 10". Because what I am trying to do in my Pyomo model in particular is set the "initial conditions" for some of the variables in order to try and mimic the real world. A simple example might be that I have a forest that starts out with 100 trees. $\endgroup$ Commented Sep 17, 2019 at 16:51
  • $\begingroup$ In your opinion, do you think that I would actually need to add these "initial conditions" as constraints in my model as opposed to using the "initialization" methods? $\endgroup$ Commented Sep 17, 2019 at 16:53
  • $\begingroup$ You don't need to add them as constraints, you can simply fix the variables after they have been initialized to the values you want: m.x.fix() or m.x[0].fix() or m.x.fix(10) $\endgroup$ Commented Sep 17, 2019 at 16:58
  • $\begingroup$ Thank you. This is precisely what I needed to know! I see now in the 2017 book that it's under the Variable section. So much information in that book it can be so easy to pass over things. Thank you very much. $\endgroup$ Commented Sep 17, 2019 at 17:25

Generally warm-start is a feasible solution for your problem and the nature of optimization problems is to evaluate feasible region(all the feasible solutions) to find the optimal solution which is not indeed the initial solution. AFAIK by providing a warm start to the solver you help the solver converge in less number of iterations.

In pyomo to use this feature set the values of variables in the instance and pass warmstart=True to the solve() method. Example(a problem with two variables with the pre-set amount of $1$ and $0$ for $y_0$ and $y_1$):

instance = model.create()
instance.y[0] = 1
instance.y[1] = 0
opt = pyo.SolverFactory("cplex")
results = opt.solve(instance, warmstart=True)

Not the answer you're looking for? Browse other questions tagged or ask your own question.