<html>
<head>
<meta content="text/html; charset=windows-1252"
http-equiv="Content-Type">
</head>
<body bgcolor="#FFFFFF" text="#000000">
Dear Ziye,<br>
<br>
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.<br>
<br>
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.<br>
<br>
Since you create the problem yourself, you probably know the
variable types you prefer at creation time. Then you can use the
methods<br>
<br>
<a
href="http://scip.zib.de/doc/html/var_8c.php#aba9d5313231dd58bab3f55dbc44dc646">SCIPvarChgBranchPriority</a><br>
<br>
or <br>
<br>
<a
href="http://scip.zib.de/doc/html/group__PublicVariableMethods.php#gaf616016202a9ea9eb28f6d3d8da555ef">SCIPchgVarBranchFactor</a><br>
<br>
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.<br>
<br>
Hope this helps,<br>
Gregor<br>
<br>
<div class="moz-cite-prefix">Am 28.05.2017 um 23:11 schrieb Ziye
Tang:<br>
</div>
<blockquote
cite="mid:CAODGa2Tf8h--TW2mJxsAsYquA5vzWDEQkzzLGixMSyuT9ax9aA@mail.gmail.com"
type="cite">
<div dir="ltr">Hi there,
<div><br>
</div>
<div>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.</div>
<div><br>
</div>
<div>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?</div>
<div><br>
</div>
<div>2. Once I have created blocks of variables, should I follow
the branching code in Binpacking example?</div>
<div><br>
</div>
<div>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. </div>
<div><br>
</div>
<div>Thanks very much in advance,</div>
<div>Ziye</div>
<div><br>
</div>
<div><br>
</div>
</div>
<br>
<fieldset class="mimeAttachmentHeader"></fieldset>
<br>
<pre wrap="">_______________________________________________
Scip mailing list
<a class="moz-txt-link-abbreviated" href="mailto:Scip@zib.de">Scip@zib.de</a>
<a class="moz-txt-link-freetext" href="https://listserv.zib.de/mailman/listinfo/scip">https://listserv.zib.de/mailman/listinfo/scip</a>
</pre>
</blockquote>
<br>
</body>
</html>