[Scip] Constraints as branching decisions

Tobias Achterberg achterberg at zib.de
Thu Dec 11 11:05:20 MET 2008


Hi Sandro!

What you can do is the following:

You create the constraint in your branching rule (or in your constraint handler, if you do
the branching there) and add it with SCIPaddConsNode(). Additionally, you do *not* call
SCIPreleaseCons() but instead store the constraint in some of your private data structures
in order to be able to reference the constraint in your pricer.
Then, in your pricer you can query SCIPconsIsActive(cons) in order to find out whether the
constraint is active at the current node. If this returns FALSE, this means that you
either are not in the subtree at which the constraint was added, or the constraint became
redundant in the current node and was deleted.

To get the dual value of the constraint, you need to call a method of the constraint
handler that is responsible for your constraint, for example SCIPgetDualsolLinear() or
SCIPgetDualsolSetppc().

Regarding your second question about changing a constraint after it has been added to the
problem: this is not possible. Instead, you need to create a new constraint and add it.


Best,

Tobias

Sandro Pirkwieser wrote:
> Hi all,
> 
> in one of my branching rules I have to include additional constraints
> and would like to know the recommended (or most appropriate) way of
> doing this. I also need their dual values in the pricer, so only adding
> them via SCIPaddConsNode is not enough (I assume), since some reference
> is missing (?). A first idea is to use a constraint handler and
> add/remove the constraint(s) using a suitable data structure. What is
> common practice?
> I have also a question regarding global and local constraints: how can I
> change the left/right hand side of a global constraint during branching,
> s.t. it basically becomes a local constraint in the corresponding node?
> Thanks.
> 
> Best regards,
> Sandro Pirkwieser
> 
> _______________________________________________
> Scip mailing list
> Scip at zib.de
> http://listserv.zib.de/mailman/listinfo/scip


More information about the Scip mailing list