[SCIP] Getting address of transformed variables

Stefan Helber stefan.helber at prod.uni-hannover.de
Mon May 2 14:43:16 CEST 2022


Dear SCIP community,

Implementing a Branch&Price algorithm with SCIP using C++ (which works, finally), I stumbled over a strange problem. When I set up the master problem to later hand it over to the pricer, I not only create the (essentially empty) constraints of the master problem, but also some auxiliary (binary or integer) variables added to those constraints which I can later use to enforce branching decisions in constraint handlers. (I know that there are other ways to enforce branching decisions as well.)

When I then initialize my pricer, I obtain the addresses of the constraints of the transformed problem like this without difficulties:

SCIPgetTransformedCons(_scip, p_dicbapsolver->_cons_usageLinks[ *(_d->link_it) ], &p_dicbapsolver->_cons_usageLinks[ *(_d->link_it) ]   )

However, when I try to get the addresses of the transformed variables like this

SCIPgetTransformedVar( _scip, p_dicbapsolver->_vars_usageLinks[ *(_d->link_it) ], &(p_dicbapsolver->_vars_usageLinks[ *(_d->link_it) ]  )

which seems to be perfectly analogous, I get a segmentation fault.

As a consequence, those auxiliary variables to enforce branching decisions which I added initially to the master problem do not get automatically released ,even though I set the “true” flag for this option when I created the pricer in the first place (as well as for the branching rule and the constraint handler, of course). So to get rid of the warning, I release all those variables “manually” right before I free the SCIP object itself, which works.

So now I am wondering why this is? Is it because I impose lower and upper bounds on those auxiliary variables that SCIP cannot determine transformed variables, which is why I have to release them on my own? Or is there some other reason why I can get the addresses of the transformed constraints, but not the addresses of the transformed variables contained in those constraints?

Would it be better to add those auxiliary variables to the constraints of the transformed master problem when the pricer is initialized (as opposed to adding them intially to the “original” master problem before the transformation takes place)? That should also work, I think, even though I have not yet tried it.

I would be very grateful for a hint why trying to get the transformed variables (or rather, their addresses) fails for my problem.

Kind regards

Stefan Helber






********************************************************

Prof. Dr. Stefan Helber

Institut für Produktionswirtschaft

Wirtschaftswissenschaftliche Fakultät

Leibniz Universität Hannover

Königsworther Platz 1

D-30167 Hannover

stefan.helber at prod.uni-hannover.de<mailto:stefan.helber at prod.uni-hannover.de>

http://www.prod.uni-hannover.de/

Tel. ++49 511 7625650

Fax. ++49 511 7624863

*********************************************************
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://listserv.zib.de/pipermail/scip/attachments/20220502/de727aa8/attachment.html>


More information about the Scip mailing list