[Coin-ipopt] Heuristic for IPOPT

Andreas Waechter andreasw at watson.ibm.com
Tue May 16 15:42:42 EDT 2006

Hi Dahai,

> I would like to modify the core code of IPOPT to implement some heuristic. 
> For example, a variable x is 0.01 at some iteration and I want to FIX it to 0 
> afterwards (i.e. future iterations). So where are the best locations / 
> functions to do that?

I don't think it would really work to change the problem definition during 
the optimization.  In particular, fixing a variable to a value changes the 
dimension of the problem, and the data structure cannot be adapted.  In 
addition, I'm not sure how useful it is to fix a variable during the 
optimization, since you don't know yet if it is really going to 0.  The 
purpose of the interior point approach is not to make decisions about 

However, if you still want to try something, you could simply interrupt 
the optimization when you realize that you want to fix a number of 
variables and restart the algorithm from that point, after changing the 
problem statement (I'm assuming that you are using Ipopt from a C++ 

You could overload the method intermediate_callback of the TNLP class, 
which is called once per iteration (around the time of the convergence 
check).  You could monitor the variables there and decide when you want to 
quick (and return false in that case).  It is a bit tricky to get the 
information about the variables out of the Ipopt internal data structures 
(it is stored in the IpoptData object).  After the optimization was 
aborted by you (by returning false), you could use the 
get_warm_start_iterate method of the TNLP class, to set the starting point 
for ALL Ipopt-internal variables.  All this is not documented, so you 
would have to dig into the code...



More information about the Coin-ipopt mailing list