<font face="arial,helvetica,sans-serif">Hi Gabrielle,<br></font><br><div class="gmail_quote">On Mon, Feb 27, 2012 at 2:14 AM, Gabrielle A. Grun <span dir="ltr"><<a href="mailto:grun@cs.sfu.ca">grun@cs.sfu.ca</a>></span> wrote:<br>
<blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex"><br>
<br>
<br>
Hi Haroldo,<br>
<br>
As far as I am concerned, setting the maximum number of solutions only sets a halting condition for Cbc to terminate when the maximum count is reached even if optimality is not reached. One can also stop on a time limit, a gap, maximum node count etc.<br>
</blockquote><div>Thanks for clarifying it. I never used this option.</div><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">
<br>
It seems that none of the savedSolutions_ may be optimal (if optimality is not reached).</blockquote><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">It is an array of integer solution that includes the best solution. If things work "normally", one of these solutions is optimal.[?]<br>
</blockquote><div>Yes, there is no guarantee, it is more likely that only intermediate, sub-optimal solutions are saved and finally (if optimallity was reached), one or more optimal solutions (more if the dual bounds were bad, making it hard to prune nodes)</div>
<div> </div><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">
<br>
Code modifications are needed to find multiple optimal answers.<br>
<br></blockquote><div>Thanks. </div><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">
<br>
<br>
class CbcModel {<br>
<br>
public:<br>
<br>
enum CbcIntParam {<br>
/** The maximum number of nodes before terminating */<br>
CbcMaxNumNode = 0,<br>
/** The maximum number of solutions before terminating */<br>
CbcMaxNumSol,<br>
/** Fathoming discipline<br>
<br>
....<br>
<br>
The snippets of code are all from CbcModel.hpp [trunk version[.<br>
/** Set the<br>
\link CbcModel::CbcMaxNumSol maximum number of solutions \endlink<br>
desired.<br>
*/<br>
inline bool setMaximumSolutions( int value) {<br>
return setIntParam(CbcMaxNumSol, value);<br>
}<br>
<br>
<br>
.........<br>
<br>
<br>
/// Set number of solutions (so heuristics will be different)<br>
inline void setSolutionCount(int value) {<br>
numberSolutions_ = value;<br>
}<br>
/// Number of saved solutions (including best)<br>
int numberSavedSolutions() const;<br>
/// Maximum number of extra saved solutions<br>
inline int maximumSavedSolutions() const {<br>
return maximumSavedSolutions_;<br>
}<br>
/// Set maximum number of extra saved solutions<br>
void setMaximumSavedSolutions(int value);<br>
/// Return a saved solution (0==best) - NULL if off end<br>
const double * savedSolution(int which) const;<br>
/// Return a saved solution objective (0==best) - COIN_DBL_MAX if off end<br>
double savedSolutionObjective(int which) const;<br>
<br>
<br>
<br>
<br>
..........<br>
<br>
/// Array holding the incumbent (best) solution.<br>
double * bestSolution_;<br>
/// Arrays holding other solutions.<br>
double ** savedSolutions_;<br>
<br>
Thanks.<br>
<br>
<br>
Gabrielle<br>
----- Original Message ----- From: Haroldo Gambini Santos<br>
To: <a href="mailto:cbc@list.coin-or.org" target="_blank">cbc@list.coin-or.org</a><br>
Sent: Tuesday, February 21, 2012 5:39 AM<br>
Subject: Re: [Cbc] Multiple Optimal Solutions<div class="HOEnZb"><div class="h5"><br>
<br>
<br>
Hi Satish,<br>
<br>
Please note that CBC will exit as soon as the lower bound reaches the upper bound - unless you "slowdown" this event (disabling all cuts?) CBC will not find *all* optimal solutions. That said, you can configure how many solutions will be saved and access then (in C++) using:<br>
<br>
bool CbcModel::setMaximumSolutions(<u></u>int value)<br>
const double* CbcModel::savedSolution(int which) const<br>
<br>
Cheers,<br>
<br>
Haroldo<br>
<br>
On <a href="tel:21-02-2012%2006" value="+12102201206" target="_blank">21-02-2012 06</a>:50, satish amirisetti wrote:<br>
Hi all,<br>
I am using pyomo with Cbc as solver to solve a problem for which i have multiple optimal solutions. How can I get all the solutions available from Cbc solution pool. Please help me.<br>
<br>
<br>
Thanks,<br>
Satish<br>
<br>
<br>
<br>
<br>
______________________________<u></u>_________________<br>
Cbc mailing list<br>
<a href="mailto:Cbc@list.coin-or.org" target="_blank">Cbc@list.coin-or.org</a><br>
<a href="http://list.coin-or.org/mailman/listinfo/cbc" target="_blank">http://list.coin-or.org/<u></u>mailman/listinfo/cbc</a><br>
<br>
<br>
<br>
<br>
-- <br>
==============================<u></u>==============================<u></u>=<br>
Haroldo Gambini Santos<br>
Computing Department - Universidade Federal de Ouro Preto - UFOP<br>
email: haroldo [at ] <a href="http://iceb.ufop.br" target="_blank">iceb.ufop.br</a><br>
haroldo.santos [at] <a href="http://gmail.com" target="_blank">gmail.com</a><br>
home/research page: <a href="http://www.decom.ufop.br/haroldo/" target="_blank">www.decom.ufop.br/haroldo/</a><br>
<br>
<br>
<br>
<br>
<br>
______________________________<u></u>_________________<br>
Cbc mailing list<br>
<a href="mailto:Cbc@list.coin-or.org" target="_blank">Cbc@list.coin-or.org</a><br>
<a href="http://list.coin-or.org/mailman/listinfo/cbc" target="_blank">http://list.coin-or.org/<u></u>mailman/listinfo/cbc</a> <br>
</div></div></blockquote></div><br><br clear="all"><div><br></div>-- <br>=============================================================<br>Haroldo Gambini Santos<br>Computing Department - Universidade Federal de Ouro Preto - UFOP<br>
email: haroldo [at ] <a href="http://iceb.ufop.br" target="_blank">iceb.ufop.br</a><br>home/research page: <a href="http://www.decom.ufop.br/haroldo/" target="_blank">www.decom.ufop.br/haroldo/</a><br> <br>"Computer science is no more about computers than astronomy <br>
is about telescopes." Edsger Dijkstra<br> <br>