[SCIP] Adding constraints while pricing

Maher, Stephen s.maher3 at lancaster.ac.uk
Tue Apr 9 10:04:37 CEST 2019


Dear Albert,


Your ideas on how to implement a column and row generation approach are correct. As you said, you need to set initial, enforce and check flags of the unnecessary constraints to FALSE when you add them. This should ensure that they are not in the LP, but they will be included in SCIP, which you have observed with the different numbers in the "rows" and "cons" columns.


When adding the constraints I would also suggest that, in addition to the check and enforce flags, you set the initial flag to TRUE. This will inform the LP interface that the constraint should be added to the LP.


What you are observing is not incorrect. Since you have added a new row and column, it is not guaranteed that the new column will enter the basis and also that the new row is active. It could take some LP iterations before the new column enters the basis. Similarly, it could take a some iteration before the new row is active. Unless you observe that the LP solutions are violating the newly added constraints, then it is not a problem that the new rows are not immediately added.


In regards to your final point. I would not suggest creating the constraints within the pricer. I have tested both ways in the past and adding all constraints initially and setting the initial flag to FALSE was the best approach.

Regards,

Steve

________________________________
From: Scip <scip-bounces at zib.de> on behalf of Schrotenboer, Albert <a.h.schrotenboer at rug.nl>
Sent: Thursday, 4 April 2019 9:46 PM
To: scip at zib.de
Subject: [SCIP] Adding constraints while pricing

Dear SCIP Community,

I am working on a column generation algorithm with a substantial amount of constraints (say in the order of 1 million). Actually, those constraints are often redundant until the right columns are generated. So my aim is to include those constraints gradually, that is, I generate a new column (and I already take into account the duals of the not yet included constraints) and while adding that column I want to create a new constraint.

Of course, I can call the SCIPcreateConsLinear() method and create a constraint there, however, I am wondering if a different approach would be possible. Namely, I create all the constraints before I start solving the model by calling the SCIPcreateConsLinear() and the SCIPaddCons() methods. I make sure to put the initial flag, enforce, and check flags to zero while creating the constraints.
I indeed see, that the number of rows is 'small' (let's say in the order of 100's), while the number of cons is indeed very large (let's say in the order of 100,000's). This seems correct, as I don't want to bother about all the (at this moment) redundant constraints.

Then, when I generate a new column I want to set the enforce and check flags equal to true for the constraints that should be included, i.e., constraints that are not redundant anymore. However, I see that there is some delay in the activation of the constraints, i.e., it takes several pricing rounds before the number of 'rows' increase.

My question is, is there an elegant way to directly enforce constraints from within the pricer 'callback' ? And related, when  I use the SCIPsetConsEnforced() or SCIPsetConsChecked() methods from within a pricing loop, when are the changes incorporated within SCIP? Or is the best way to simply create the constraints when I need them?

Thank you,
Albert

--

Albert Schrotenboer

Ph.D. Candidate

Faculty of Economics and Business

University of Groningen

P.O. Box 800, 9700 AV Groningen
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://listserv.zib.de/pipermail/scip/attachments/20190409/f87b9412/attachment.html>


More information about the Scip mailing list