[Cbc] CbcModel::passInPriorities

John Forrest john.forrest at fastercoin.com
Wed Aug 8 05:23:07 EDT 2012


Alexis,

sos.cpp is a semi artificial example but the idea is to improve the 
branching.  So initially we just have 0-1 variables in problem which 
could have been in SOS but the user may not know much about SOS.  So we 
find them and add the sets using CbcObject (and CbcSOS).  If all the 
variables were in sets then we could delete the existing 
CbcSimpleInteger objects and the code would give the same answer.  But 
various cut generators only know about integers so we would miss out on 
some cuts.  So the answer is to use the SOS for branching but still say 
that the variables are integer. We do this by putting a high priority 
(1) on the SOS while the integers would have the default priority( 
1000).  In general the use of priorities is unfashionable but can be 
very powerful.

If we have "classic" SOS with a well defined order and weights (e.g. 
size of facility) then the default SOS branching is probably correct.  
In other cases it may be worthwhile writing your own branching object so 
that you can try and get integer solutions quickly and then switch to 
classic SOS branching (it may also be useful to look at CbcNWay.?pp).

John Forrest

On 07/08/12 22:56, Alexis Guigue wrote:
> Dear all,
>
> I have just started working with CBC. As my problem contains some SOS 
> constraints of type 1, I got
> interested in the example sos.cpp. In this model, what is the 
> advantage of identifying these constraints
> from the input file and specifically creating CbcObject? Is is to 
> improve the branching, i.e.,
> by setting higher priority to branching for variables from the SOS 
> constraint? It is not very
> clear to me what the function ''passInPriorities'' does (see below):
>
>   int * priority = new int[numberSOS];
>   // Set SOS priorities high
>   CoinFillN(priority,numberSOS,1);
>   model.passInPriorities(priority,true);
>   delete [] priority;
>
> Thanks in advance
>
> Alexis
>



More information about the Cbc mailing list