[Coin-ipopt] Heuristic for IPOPT

Dahai Xu dahaixu at cse.buffalo.edu
Wed May 17 09:31:43 EDT 2006

Hi Andreas,

Many thanks for your information. The reason of modifying the core code of 
IPOPT is that my problem can not be exactly and efficiently formulated with 
smooth functions (e.g. a=min(b, c, d), etc.), whereas get_warm_start_iterate 
and "save_warm_start_iterate" are not implemented yet in the code.

It took me a while to figure out how to modify the IpoptData within you 
excellent object oriented framework. I tried to fix some variables after 
some iterations at two locations

1) in intermediate_callback: I modify some variables of x() by accessing 
2) in IpoptData::set_delta(SmartPtr<IteratesVector>& delta), I change the 
corresponding directions (components of delta) to 0 to avoid changing of 
these fixed variables.

Generally it works fine, but some Access violation will happen during the 
process of program destruction (i.e. after finishing main()).

Could you please comment a little more about my method?


Yours sincerely
Dahai Xu
----- Original Message ----- 
From: "Andreas Waechter" <andreasw at watson.ibm.com>
To: "Dahai Xu" <dahaixu at cse.Buffalo.EDU>
Cc: "coin-ipopt mailing list" <coin-ipopt at list.coin-or.org>
Sent: Tuesday, May 16, 2006 3:42 PM
Subject: Re: [Coin-ipopt] Heuristic for IPOPT

> 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 
> activities.
> 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++ 
> program.)
> 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...
> Regards,
> Andreas

More information about the Coin-ipopt mailing list