[Cbc] How to decide with variable to branch ?

Haroldo Gambini Santos haroldo.santos at gmail.com
Fri Dec 23 18:11:51 EST 2011


Hi Forrest,

Yes, to inherit from CbcBranchDynamicDecision and to override 
betterBranch makes it work !

Perhaps an updated example should be included in the CBC distribution 
(e.g. the one you send-me).

The example which is included now (CbcBranchUser.cpp) inherits from 
CbcBranchDecision and overrides bestBranch - could not make it work this 
way.

Thanks and Merry Christmas.

Haroldo



On 23-12-2011 08:29, John Forrest wrote:
> Haroldo,
>
> Maybe you have to derive from CbcBranchDynamicDecision - anyway that 
> works - see attached.
>
> John Forrest
>
> On 22/12/11 21:57, Haroldo Gambini Santos wrote:
>> Hi Forrest,
>>
>> Put a printf inside betterBranch  and  bestBranch  in my class derived
>> from CbcBranchDecision   and   set   cbcMode->setBranching method for an
>> object of this class but after solving (many nodes processes) it appears
>> that this was never called since I got no output from the expected
>> messages. What I am missing ?
>>
>>
>> On 21-12-2011 06:20, John Forrest wrote:
>>> Haroldo,
>>>
>>>
>>> You want betterBranch.  bestBranch was older and is only called if 
>>> there are no dynamic pseudo costs etc etc.
>>>
>>> You may also want to derive from CbcSimpleIntegerDynamicPseudoCost 
>>> to give yourself even more control.
>>>
>>> John
>>>
>>> On 20/12/11 19:06, Haroldo Gambini Santos wrote:
>>>> Dear All,
>>>>
>>>> I would like to insert a code in my solver (built using cbc) to 
>>>> decide which variable to branch and the direction.
>>>>
>>>> What should I do ? Write a callback ? To specialize some class ?
>>>>
>>>> Tried to create a class derived from
>>>> CbcBranchDecision, override the method  bestBranch  and call 
>>>> cbcModel->cbcBranchingMethod for this class but apparently this 
>>>> method was not even called (put a printf inside to check).
>>>>
>>>> Regards,
>>>>
>>>> Haroldo
>>>>
>>>>
>>>> _______________________________________________
>>>> Cbc mailing list
>>>> Cbc at list.coin-or.org
>>>> http://list.coin-or.org/mailman/listinfo/cbc
>>>>
>>>>
>>>
>>> _______________________________________________
>>> Cbc mailing list
>>> Cbc at list.coin-or.org
>>> http://list.coin-or.org/mailman/listinfo/cbc
>>
>>
>>
>
>
>
> _______________________________________________
> Cbc mailing list
> Cbc at list.coin-or.org
> http://list.coin-or.org/mailman/listinfo/cbc

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


More information about the Cbc mailing list