[Scip] How to get node constraint

Gerald Gamrath gamrath at zib.de
Thu Jun 7 16:29:16 MEST 2012


Hi Benoit,

I suppose you implemented a constraint handler that is used to store 
some data at the nodes, as it is suggested in the FAQ?
What I usually do in this case is to implement a stack in the constraint 
handler, that always contains all constraints corresponding to the 
active nodes, ordered from the root node to the current node. You can 
add this stack to the data of the constraint handler (as an array, 
together with its size and the number of constraints stored), and use 
the CONSACTIVE and CONSDEACTIVE callbacks of your constraint handler to 
put a constraint on top of the stack or remove the topmost constraint. 
Then, you only need an interface method of your constraint handler, that 
returns the topmost constraint, because that is the one of the current node.

This concept is implemented in the storeGraph constraint handler of the 
Coloring example (see examples/Coloring/src/cons_storeGraph.c in your 
SCIP directory or 
http://scip.zib.de/doc/examples/Coloring/cons__storeGraph_8c_source.html), 
just search for all occurences of "stack" for getting the places where 
the stack is managed or used.

Best,
Gerald


Am 06.06.2012 08:53, schrieb bernay at isima.fr:
> Hi
>
>    I am working on a problem which use a pricer and a ryan/foster branching
> rule. In my pricer, to choose the new variable to price, i need to have
> the consdata of the constraints of the current node. I know how to get
> the current node but I don't find any function to get the constraint. So
> how to get the constraints of the current node?
>
> thank for your help
>
> Benoit Bernay
>
> _______________________________________________
> Scip mailing list
> Scip at zib.de
> http://listserv.zib.de/mailman/listinfo/scip




More information about the Scip mailing list