[SCIP] Creating a new Branching Rule in SCIP

Leon Eifler eifler at zib.de
Tue May 26 09:54:55 CEST 2020


Hello Matheus,

everything you want to achieve can be implemented in a branching rule. I 
don't think there is a benefit of doing this in a constraint handler. In 
your branching rule you can create to child nodes and add all bound 
changes that you want to do for S and T to those child nodes.

> Also, in order to select the sets S and T I also need to know all the 
> variables already fixed to 0 and to 1. Is there any way of doing this? 
> Should I store all the variables fixed in each branching in a data 
> structure? Or there is an easier way of just checking if the variable 
> is already fixed or not?

You can get all fractional variables by calling SCIPgetLPBranchCands (or 
do you think of fixed as in local lower bound equals local upper bound?)

> Also, my idea for branching is not enough to separate all fractional 
> solutions. So when it is not possible to use my branching, I want SCIP 
> to use the branching it normally uses (I guess it is strong 
> branching). Could anyone that knows about this give me some help here?

You do not have to do anything here. If you give your branching rule a 
high priority it will get called first. Just ensure that your branching 
rule sets the result pointer to SCIP_DIDNOTFIND or SCIP_DIDNOTRUN 
(whichever makes more sense) if it does not find a branching. Then the 
branching rule with the next hightest priority will get called.

Best,
Leon




More information about the Scip mailing list