[SCIP] write customized branching codes
Gregor Hendel
hendel at zib.de
Sun May 28 23:43:43 CEST 2017
Dear Ziye,
what you describe can be much easier (where easily depends on your C
skills, of course) accomplished by using the branching priorities for
variables. By default, all default branching plugins will only consider
fractional candidates with the highest priority for branching. That
means, if you partition your variables into two classes A and B, to
which you assign the priorities 2 and 1, SCIP will branch on variables
in A as long as a fractional variable of A remains.
A soft version of prioritization can be achieved by using so-called
branching factors of variables. These factors affect the branching score
that SCIP calculates, as you would expect. If you have two variables A
and B, A has a factor of 1.0 and B has a factor of 10.0, then A is only
preferred over B if A's branching score (without the factor) is ten
times better than B's. Of course, factors and priorities can also be
combined.
Since you create the problem yourself, you probably know the variable
types you prefer at creation time. Then you can use the methods
SCIPvarChgBranchPriority
<http://scip.zib.de/doc/html/var_8c.php#aba9d5313231dd58bab3f55dbc44dc646>
or
SCIPchgVarBranchFactor
<http://scip.zib.de/doc/html/group__PublicVariableMethods.php#gaf616016202a9ea9eb28f6d3d8da555ef>
and its friends SCIPaddVarBranchFactor or SCIPscaleVarBranchFactor and
let SCIP do the rest. You save the writing and reading part. Note that
branching priorities or factors are not part of any problem file format
and thus cannot be read in by SCIP. After reading in a problem from an
mps-file, all variables have both their priority and their factor set to
1, as one would expect.
Hope this helps,
Gregor
Am 28.05.2017 um 23:11 schrieb Ziye Tang:
> Hi there,
>
> My current task is the following: I'd like to implement a customized
> branching rules for my MIP problem. I have some prior knowledge to
> partition variables into a few sets with `priorities' used for
> branching, and the branching rules is (roughly) branching according to
> decreasing `priorities'. Since I seem to be the first guy among my
> workmates to code in SCIP, I'd really appreciate it if you could give
> me some guidance here. I've decomposed this task into the following steps.
>
> 1. I can output my problem formulation in commonly used format like
> .mps, .lp etc.. So I need a plugin to read my problem and partition
> variables in the format into a few sets/blocks. Can I do that in the
> already implemented reader plugin, or i need to follow the Binpacking
> example and write my own struct?
>
> 2. Once I have created blocks of variables, should I follow the
> branching code in Binpacking example?
>
> I am reading your example while posting this question. Since I am not
> a fluent C programmer, it might take me several days to understand
> what is going on, I hope getting your reply while reading the code
> could accelerate the whole process.
>
> Thanks very much in advance,
> Ziye
>
>
>
>
> _______________________________________________
> Scip mailing list
> 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/20170528/d6d3ba24/attachment.html>
More information about the Scip
mailing list