<div dir="ltr"><div dir="ltr"><div dir="ltr"><br></div><br><div class="gmail_quote"><div dir="ltr">El dom., 6 ene. 2019 a las 21:00, Haroldo Gambini Santos (<<a href="mailto:haroldo@ufop.edu.br">haroldo@ufop.edu.br</a>>) escribió:<br></div><blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left:1px solid rgb(204,204,204);padding-left:1ex">On 06/01/2019 13:18, John Forrest wrote:<br>
> If you update Cbc stable and add<br>
><br>
>  -DKEEP_ORIGINAL_SOLVER<br>
><br>
> to CXXDEFS in configure then solver will stay same.<br>
><br>
> Remember that the bounds on integer variables will have been changed <br>
> to give an integer solution.<br>
<br>
Wouldn't be better to save original bounds and restore these bounds <br>
after the branch-&-bound  ? Storing two vectors of double would be more <br>
convenient than cloning the entire problem (if I understood correctly <br>
this is why it is advisable to clone the problem today).<br>
<br></blockquote><div><br></div><div>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.<br></div><div><br></div><div> </div><blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left:1px solid rgb(204,204,204);padding-left:1ex">
><br>
> John Forrest<br>
><br>
> On 05/01/2019 23:12, Wendel Melo wrote:<br>
>> Dear friends<br>
>><br>
>> I am giving my first steps with CBC to Mixed Integer Linear <br>
>> Programming (MILP) by means of the C++ API. My current goal is to <br>
>> turn Cbc one of the MILP solvers supported in Muriqui Optimizer, a <br>
>> free MINLP solver (<a href="http://www.wendelmelo.net/software" rel="noreferrer" target="_blank">www.wendelmelo.net/software</a> <br>
>> <<a href="https://urldefense.proofpoint.com/v2/url?u=http-3A__www.wendelmelo.net_software&d=DwMDaQ&c=Ngd-ta5yRYsqeUsEDgxhcqsYYY1Xs5ogLxWPA_2Wlc4&r=pLOfVNEEHf-xhIqn1-uzYcZ6Q7UefG6Bg6rXCKTMiAA&m=Ud8-hd8c2MRU6-pxt0hBz7Js4YPHFHD8UF7q7reBa5g&s=jyyW2EsmmjheIShvnbQ-4TgZLO4iAOzOqRTTGOqvELg&e=" rel="noreferrer" target="_blank">https://urldefense.proofpoint.com/v2/url?u=http-3A__www.wendelmelo.net_software&d=DwMDaQ&c=Ngd-ta5yRYsqeUsEDgxhcqsYYY1Xs5ogLxWPA_2Wlc4&r=pLOfVNEEHf-xhIqn1-uzYcZ6Q7UefG6Bg6rXCKTMiAA&m=Ud8-hd8c2MRU6-pxt0hBz7Js4YPHFHD8UF7q7reBa5g&s=jyyW2EsmmjheIShvnbQ-4TgZLO4iAOzOqRTTGOqvELg&e=</a>>).<br>
>><br>
>> Due to design questions, I have been constructing an object of the <br>
>> CbcModel class using an empty OsiSolverInterface object:<br>
>><br>
>> OsiClpSolverInterface   clp ;<br>
>> CbcModel   *model = new (std::nothrow) CbcModel(clp);<br>
>><br>
>> After that, I have been set the coefficients of my MILP problem by <br>
>> means of the pointer returned by the method CbcModel::solver, for <br>
>> example:<br>
>><br>
>> OsiSolverInterface *solver = model->solver()<br>
>><br>
>> solver->addCol(0, NULL, NULL,   0.0,  1000.0,   1.0);<br>
>><br>
>> I am performing in this way to avoid delay copping the <br>
>> OsiSolverInterface object in the CbcModel constructor since I need to <br>
>> solve a sequence where the same MILP problem has to be solved several <br>
>> times just changing some parameters.<br>
>><br>
>> But I have been getting some problems. After calling method <br>
>> CbcModel::branchAndBound by the second time, the pointer returned by <br>
>> CbcModel::solver is getting a different value of the previous call, <br>
>> for example:<br>
>><br>
>> std::cout << "before BB solver pointer: " << model->solver() << <br>
>> std::endl;<br>
>> model->branchAndBound()<br>
>> std::cout << "after BB solver pointer: " << model->solver() << std::endl;<br>
>><br>
>> The code above prints:<br>
>><br>
>> before BB solver pointer:  0x1455a628<br>
>> after BB solver pointer:  0x14887f88<br>
>><br>
>> So, we can see the solver pointer in CbcModel object was changed. Why <br>
>> is it happening? I believe creating new solver objects is bad because <br>
>> increase the computations. Is there a way to avoid the changing of <br>
>> solver object pointer? Are there other methods in CbcModel that can <br>
>> provoke the changing of the solver pointer?<br>
>><br>
>> Thanks in advanced<br>
>><br>
>> Best regards<br>
>><br>
>><br>
>> Wendel Melo<br>
>> <a href="http://www.wendeldelo.net" rel="noreferrer" target="_blank">www.wendeldelo.net</a> <br>
>> <<a href="https://urldefense.proofpoint.com/v2/url?u=http-3A__www.wendeldelo.net&d=DwMDaQ&c=Ngd-ta5yRYsqeUsEDgxhcqsYYY1Xs5ogLxWPA_2Wlc4&r=pLOfVNEEHf-xhIqn1-uzYcZ6Q7UefG6Bg6rXCKTMiAA&m=Ud8-hd8c2MRU6-pxt0hBz7Js4YPHFHD8UF7q7reBa5g&s=8d0BNsk_i_Suf0pr9MnIGBMx2Rhr4u-Z92NbTsDdBcQ&e=" rel="noreferrer" target="_blank">https://urldefense.proofpoint.com/v2/url?u=http-3A__www.wendeldelo.net&d=DwMDaQ&c=Ngd-ta5yRYsqeUsEDgxhcqsYYY1Xs5ogLxWPA_2Wlc4&r=pLOfVNEEHf-xhIqn1-uzYcZ6Q7UefG6Bg6rXCKTMiAA&m=Ud8-hd8c2MRU6-pxt0hBz7Js4YPHFHD8UF7q7reBa5g&s=8d0BNsk_i_Suf0pr9MnIGBMx2Rhr4u-Z92NbTsDdBcQ&e=</a>><br>
>><br>
>> _______________________________________________<br>
>> Cbc mailing list<br>
>> <a href="mailto:Cbc@list.coin-or.org" target="_blank">Cbc@list.coin-or.org</a><br>
>> <a href="https://list.coin-or.org/mailman/listinfo/cbc" rel="noreferrer" target="_blank">https://list.coin-or.org/mailman/listinfo/cbc</a><br>
><br>
><br>
><br>
> _______________________________________________<br>
> Cbc mailing list<br>
> <a href="mailto:Cbc@list.coin-or.org" target="_blank">Cbc@list.coin-or.org</a><br>
> <a href="https://urldefense.proofpoint.com/v2/url?u=https-3A__list.coin-2Dor.org_mailman_listinfo_cbc&d=DwICAg&c=Ngd-ta5yRYsqeUsEDgxhcqsYYY1Xs5ogLxWPA_2Wlc4&r=pLOfVNEEHf-xhIqn1-uzYcZ6Q7UefG6Bg6rXCKTMiAA&m=Ud8-hd8c2MRU6-pxt0hBz7Js4YPHFHD8UF7q7reBa5g&s=EV7yTTN8bNFQFrK2-RePTD2j8dVUKPp-w2jWuQW6qwY&e=" rel="noreferrer" target="_blank">https://urldefense.proofpoint.com/v2/url?u=https-3A__list.coin-2Dor.org_mailman_listinfo_cbc&d=DwICAg&c=Ngd-ta5yRYsqeUsEDgxhcqsYYY1Xs5ogLxWPA_2Wlc4&r=pLOfVNEEHf-xhIqn1-uzYcZ6Q7UefG6Bg6rXCKTMiAA&m=Ud8-hd8c2MRU6-pxt0hBz7Js4YPHFHD8UF7q7reBa5g&s=EV7yTTN8bNFQFrK2-RePTD2j8dVUKPp-w2jWuQW6qwY&e=</a><br>
<br>
-- <br>
=============================================================<br>
Haroldo Gambini Santos<br>
Computing Department<br>
Universidade Federal de Ouro Preto - UFOP<br>
email: <a href="mailto:haroldo@ufop.edu.br" target="_blank">haroldo@ufop.edu.br</a><br>
home/research page: <a href="http://www.decom.ufop.br/haroldo" rel="noreferrer" target="_blank">www.decom.ufop.br/haroldo</a><br>
<br>
<br>
It has long been an axiom of mine that the little things are infinitely<br>
the most important.<br>
-- Sir Arthur Conan Doyle, "A Case of Identity"<br>
<br>
_______________________________________________<br>
Cbc mailing list<br>
<a href="mailto:Cbc@list.coin-or.org" target="_blank">Cbc@list.coin-or.org</a><br>
<a href="https://list.coin-or.org/mailman/listinfo/cbc" rel="noreferrer" target="_blank">https://list.coin-or.org/mailman/listinfo/cbc</a><br>
</blockquote></div><br clear="all"><br>-- <br><div dir="ltr" class="gmail_signature">Wendel</div></div></div>