[Couenne] How to extract best solution so far ?
Pietro Belotti
belotti at lehigh.edu
Thu Mar 4 00:31:19 EST 2010
Hi Bruno,
>> Is there a way to store the variables' values once a
>> integer solution is found
A cbc parameter, MaxNumSol, is defined as the number of feasible
solution after which cbc stops (it is by default very large). However,
in order to store the solutions I agree with Pete on what to do.
>> (or even stop the execution once a integer
>> solution is found) ?
Another way to stop a branch-and-bound at the *first* feasible
solution found is to solve a modified problem where the objective
function is 0, i.e., if your problem is min{f(x): g(x)<=0} then the
modified problem is min{0: g(x)<= 0}. Since every feasible solution
has value 0 and 0 is a lower bound, the branch-and-bound terminates
immediately.
>> Are these values the ones from the best
>> solution found?
Yes, they are.
Cheers,
Pietro
_________________________________________
Pietro Belotti, Lehigh University
Dept. of Industrial and Systems Engineering
200 W Packer Ave, Bethlehem PA 18015.
phone: 610-758-3865 fax: 610-758-4886
email: belotti at lehigh.edu
web: http://www.lehigh.edu/~pib208
On 03/03/2010, Pete Janes <ppjanes at gmail.com> wrote:
> Hi Bruno,
>
> I think you need to consult the Cbc manual.
>
> I have been trying to store a list of the best solution myself, and I
> believe it involves modifying the CBC source code, not the Couenne
> source code. Right now, I just trap the solution in
>
> void
> CbcModel::setBestSolution (CBC_Message how,
> double & objectiveValue, const double *solutionIn,
> int fixVariables)
>
> In Cbc/CbcModel.cpp
>
> this routine is called whenever a solution is found. It then verifies
> whether the solution is feasible. The solution is "const double
> *solutionIn" and the associated objective value is "double &
> objectiveValue."
>
> Unfortunately this involves recompiling the source, I am not sure if
> there is a parameter you can pass to Cbc to do this automatically.
>
> Kind regards,
>
> Pete
>
>
>
> On Thu, Mar 4, 2010 at 10:37 AM, Bruno Conti Marini
> <bcmarini at gmail.com> wrote:
>> Hello,
>>
>> I am running Couenne with "time_limit 7200". After that time limit expires I
>> print the value of the variables. Are these values the ones from the best
>> solution found ? Is there a way to store the variables' values once a
>> integer solution is found (or even stop the execution once a integer
>> solution is found) ?
>>
>> I didn't find any mention of this on the "Couenne User's Manual" neither on
>> the generated documentation (doxydoc).
>>
>> Thanks for your time.
>>
>> --
>> Bruno Conti Marini
>> M. Sc. Computer Science Student
>> Institute of Computing, UNICAMP
>> http://www.students.ic.unicamp.br/~ra042272/
----------------------------------------------------------------
This message was sent using IMP, the Internet Messaging Program.
More information about the Couenne
mailing list