[Cbc] Cbc changes solver pointer after solving a problem [c++ API]

John Forrest john.forrest at fastercoin.com
Mon Jan 7 04:44:05 EST 2019


See comments below.

On 07/01/2019 05:15, Wendel Melo wrote:
>
> El dom., 6 ene. 2019 a las 21:00, Haroldo Gambini Santos 
> (<haroldo at ufop.edu.br <mailto:haroldo at ufop.edu.br>>) escribió:
>
>     On 06/01/2019 13:18, John Forrest wrote:
>     > If you update Cbc stable and add
>     >
>     >  -DKEEP_ORIGINAL_SOLVER
>     >
>     > to CXXDEFS in configure then solver will stay same.
>     >
>     > Remember that the bounds on integer variables will have been
>     changed
>     > to give an integer solution.
>
>     Wouldn't be better to save original bounds and restore these bounds
>     after the branch-&-bound  ? Storing two vectors of double would be
>     more
>     convenient than cloning the entire problem (if I understood correctly
>     this is why it is advisable to clone the problem today).
>

NO NO.  Unless the bounds are changed then postprocessing won't work.  
Also cloning was done as cuts are added and the solver gets messed up.

If there is pre and post processing then the original model does stay 
same - although again bounds are changed so solution printing and other 
things will work.

I may make change permanent in trunk - but behaviour changes very 
slightly (probably due to pseudo random number generators).

Wendel - if changes are not permanent by the time you release code, I 
can add as option.


John Forrest

>
> I agree. Because it is really strange you call method branch-and-bound 
> twice in a sequence and the behaviours be different. I think users 
> suppose solver object must be kept exactly as it was before 
> optimziation starts.
>

-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://list.coin-or.org/pipermail/cbc/attachments/20190107/ef48acdb/attachment.html>


More information about the Cbc mailing list