[SCIP] Creating a new Branching Rule in SCIP
Leon Eifler
eifler at zib.de
Thu May 28 10:05:56 CEST 2020
Hi once again Matheus,
you can see the priorities in each of the 'branch_*.c' files. I quickly
grepped them all for you:
./scip/branch_inference.c:47:#define BRANCHRULE_PRIORITY 1000
./scip/branch_nodereopt.c:34:#define BRANCHRULE_PRIORITY -9000000
./scip/branch_random.c:43:#define BRANCHRULE_PRIORITY -100000
./scip/branch_vanillafullstrong.c:48:#define BRANCHRULE_PRIORITY
-2000
./scip/branch_cloud.c:59:#define BRANCHRULE_PRIORITY 0
./scip/branch_xyz.c:31:#define BRANCHRULE_PRIORITY 0
./scip/branch_multaggr.c:61:#define BRANCHRULE_PRIORITY 0
./scip/branch_allfullstrong.c:62:#define BRANCHRULE_PRIORITY -1000
./scip/branch_leastinf.c:37:#define BRANCHRULE_PRIORITY 50
./scip/branch_mostinf.c:37:#define BRANCHRULE_PRIORITY 100
./scip/branch_pscost.c:46:#define BRANCHRULE_PRIORITY 2000
./scip/branch_fullstrong.c:48:#define BRANCHRULE_PRIORITY 0
./scip/branch_relpscost.c:60:#define BRANCHRULE_PRIORITY 10000
./scip/branch_lookahead.c:78:#define BRANCHRULE_PRIORITY 0
./scip/branch_distribution.c:83:#define BRANCHRULE_PRIORITY 0
So you can see that reliability pseudocost branching
(branch_relpscost.c) has the highest priority of 10000.
To also answer the previous question: You can get local variable bounds
by calling "SCIPvarGetLbLocal" and "SCIPvarGetUbLocal", respectively.
There is also a page in the documentation that might help you in finding
C-API methods easier on your own: https://scip.zib.de/doc-7.0.0/html/DOC.php
Best,
Leon
On 27.05.20 23:48, Matheus Ota wrote:
> Hi,
>
> I think I implemented correctly a branching rule that inherits from
> ObjBranchRule, but I don't know what value I should assign for the
> priority. I tried 1000 and it was not being called, I tried 100000 and
> it was called ok. Just to be sure, where can I find the priority
> values of the other branching rules used by SCIP?
>
> Thanks,
> Matheus
>
> Em ter., 26 de mai. de 2020 às 12:24, Matheus Ota
> <matheusota at gmail.com <mailto:matheusota at gmail.com>> escreveu:
>
> Hi Leon,
>
> Thanks for your detailed answer! Yes, I want to query if the lower
> bound of the variable equals the upper bound, and what is this value.
>
> Thanks again,
> Matheus
>
> Em ter., 26 de mai. de 2020 às 04:57, Leon Eifler <eifler at zib.de
> <mailto:eifler at zib.de>> escreveu:
>
> 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
>
>
> _______________________________________________
> Scip mailing list
> Scip at zib.de <mailto:Scip at zib.de>
> https://listserv.zib.de/mailman/listinfo/scip
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://listserv.zib.de/pipermail/scip/attachments/20200528/e622eb35/attachment.html>
More information about the Scip
mailing list