[Cbc] Multiple Optimal Solutions

Haroldo Santos haroldo.santos at gmail.com
Tue Feb 28 10:17:24 EST 2012


Hi Gabrielle,

On Mon, Feb 27, 2012 at 2:14 AM, Gabrielle A. Grun <grun at cs.sfu.ca> wrote:

>
>
>
> Hi Haroldo,
>
> 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.
>
Thanks for clarifying it. I never used this option.

>
> It seems that none of the savedSolutions_ may be optimal (if optimality is
> not reached).

It is an array of integer solution that includes the best solution. If
> things work "normally", one of these solutions is optimal.[?]
>
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)


>
> Code modifications are needed to find multiple optimal answers.
>
> Thanks.

>
>
> class CbcModel {
>
> public:
>
> enum CbcIntParam {
> /** The maximum number of nodes before terminating */
> CbcMaxNumNode = 0,
> /** The maximum number of solutions before terminating */
> CbcMaxNumSol,
> /** Fathoming discipline
>
> ....
>
> The snippets of code are all from CbcModel.hpp [trunk version[.
> /** Set the
> \link CbcModel::CbcMaxNumSol maximum number of solutions \endlink
> desired.
> */
> inline bool setMaximumSolutions( int value) {
> return setIntParam(CbcMaxNumSol, value);
> }
>
>
> .........
>
>
> /// Set number of solutions (so heuristics will be different)
> inline void setSolutionCount(int value) {
> numberSolutions_ = value;
> }
> /// Number of saved solutions (including best)
> int numberSavedSolutions() const;
> /// Maximum number of extra saved solutions
> inline int maximumSavedSolutions() const {
> return maximumSavedSolutions_;
> }
> /// Set maximum number of extra saved solutions
> void setMaximumSavedSolutions(int value);
> /// Return a saved solution (0==best) - NULL if off end
> const double * savedSolution(int which) const;
> /// Return a saved solution objective (0==best) - COIN_DBL_MAX if off end
> double savedSolutionObjective(int which) const;
>
>
>
>
> ..........
>
> /// Array holding the incumbent (best) solution.
> double * bestSolution_;
> /// Arrays holding other solutions.
> double ** savedSolutions_;
>
> Thanks.
>
>
> Gabrielle
> ----- Original Message ----- From: Haroldo Gambini Santos
> To: cbc at list.coin-or.org
> Sent: Tuesday, February 21, 2012 5:39 AM
> Subject: Re: [Cbc] Multiple Optimal Solutions
>
>
>
> Hi Satish,
>
> 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:
>
> bool CbcModel::setMaximumSolutions(**int value)
> const double* CbcModel::savedSolution(int which) const
>
> Cheers,
>
> Haroldo
>
> On 21-02-2012 06:50, satish amirisetti wrote:
> Hi all,
> 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.
>
>
> Thanks,
> Satish
>
>
>
>
> ______________________________**_________________
> Cbc mailing list
> Cbc at list.coin-or.org
> http://list.coin-or.org/**mailman/listinfo/cbc<http://list.coin-or.org/mailman/listinfo/cbc>
>
>
>
>
> --
> ==============================**==============================**=
> Haroldo Gambini Santos
> Computing Department - Universidade Federal de Ouro Preto - UFOP
> email: haroldo [at ] iceb.ufop.br
> haroldo.santos [at] gmail.com
> home/research page: www.decom.ufop.br/haroldo/
>
>
>
>
>
> ______________________________**_________________
> Cbc mailing list
> Cbc at list.coin-or.org
> http://list.coin-or.org/**mailman/listinfo/cbc<http://list.coin-or.org/mailman/listinfo/cbc>
>



-- 
=============================================================
Haroldo Gambini Santos
Computing Department - Universidade Federal de Ouro Preto - UFOP
email: haroldo [at ] iceb.ufop.br
home/research page: www.decom.ufop.br/haroldo/

"Computer science is no more about computers than astronomy
is about telescopes." Edsger Dijkstra
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://list.coin-or.org/pipermail/cbc/attachments/20120228/3cdce2a4/attachment.html>


More information about the Cbc mailing list