[SCIP] question on branching
Tristan Gally
gally at mathematik.tu-darmstadt.de
Fri Feb 17 07:19:45 CET 2017
Dear James,
if you only want to branch on this particular variable, it shouldn't be
necessary to get all branching candidates. You could write a branching
rule where you just check the bounds of your particular variable (you
can get it via SCIPfindVar()), in case they are equal, you return
SCIP_DIDNOTRUN to skip your branching rule and continue with SCIP's own
ones. Otherwise you directly call SCIPbranchVar() to branch on your
variable.
If you wanted to use the SCIPgetPseudoBranchCands() callback (which, as
I said, shouldn't be necessary), you would get a list of all possible
candidates to iterate over and select one based on any criterion of your
choice. In your case, you could iterate over the list and check whether
any of the variables is named "x".
Best,
Tristan
On 02/16/2017 04:13 PM, James Cussens wrote:
> Dear SCIPers,
>
> I have a problem which includes a particular integer variable (call it
> x) which I always want to branch on even if it is integral and other
> binary/integer variables are fractional - I would only branch on any
> other variable if x were fixed. As for how to branch on this variable,
> the BRANCHEXECPS approach described here:
> http://scip.zib.de/doc/html/BRANCH.php
> is exactly what I am looking for.
>
> Giving this x variable maximal branching priority does not work, since
> if (as is normally the case) there is an LP solution with some
> fractional variables not including my x, then x will not be branched on.
>
> So it looks like I need to write my own (simple) branching rule where
> the BRANCHEXECLP callback grabs branching candidates
> using SCIPgetPseudoBranchCands rather than SCIPgetLPBranchCands.
> However, looking at the code in branch.c it appears
> that SCIPgetPseudoBranchCands returns branching candidates without
> taking variable priority into account.
>
> Is that correct?
>
> Best wishes,
>
> James
>
> --
> James Cussens
> Dept of Computer Science &
> York Centre for Complex Systems Analysis
> Room 326, The Hub, Deramore Lane Tel +44 (0)1904 325371
> University of York Fax +44 (0)1904 500159
> York YO10 5GE, UK http://www.cs.york.ac.uk/~jc
> <http://www.cs.york.ac.uk/%7Ejc>
> http://www.york.ac.uk/docs/disclaimer/email.htm
>
>
> _______________________________________________
> Scip mailing list
> Scip at zib.de
> http://listserv.zib.de/mailman/listinfo/scip
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://listserv.zib.de/pipermail/scip/attachments/20170217/b4518f93/attachment.html>
More information about the Scip
mailing list