<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1">
<style type="text/css" style="display:none;"><!-- P {margin-top:0;margin-bottom:0;} --></style>
</head>
<body dir="ltr">
<div id="divtagdefaultwrapper" style="font-size:12pt;color:#000000;font-family:Calibri,Helvetica,sans-serif;" dir="ltr">
<p style="margin-top:0;margin-bottom:0">Dear Albert,</p>
<p style="margin-top:0;margin-bottom:0"><br>
</p>
<p style="margin-top:0;margin-bottom:0">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.</p>
<p style="margin-top:0;margin-bottom:0"><br>
</p>
<p style="margin-top:0;margin-bottom:0">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.</p>
<p style="margin-top:0;margin-bottom:0"><br>
</p>
<p style="margin-top:0;margin-bottom:0">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.</p>
<p style="margin-top:0;margin-bottom:0"><br>
</p>
<p style="margin-top:0;margin-bottom:0">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.</p>
<div><br>
</div>
Regards,
<div><br>
</div>
<div>Steve<br>
<br>
<div style="color: rgb(0, 0, 0);">
<hr style="display:inline-block;width:98%" tabindex="-1">
<div id="divRplyFwdMsg" dir="ltr"><font face="Calibri, sans-serif" style="font-size:11pt" color="#000000"><b>From:</b> Scip <scip-bounces@zib.de> on behalf of Schrotenboer, Albert <a.h.schrotenboer@rug.nl><br>
<b>Sent:</b> Thursday, 4 April 2019 9:46 PM<br>
<b>To:</b> scip@zib.de<br>
<b>Subject:</b> [SCIP] Adding constraints while pricing</font>
<div> </div>
</div>
<div>
<div dir="ltr">
<div dir="ltr">
<div dir="ltr">
<div class="x_gmail_default" style="font-family:arial,helvetica,sans-serif">Dear SCIP Community,</div>
<div class="x_gmail_default" style="font-family:arial,helvetica,sans-serif"><br>
</div>
<div class="x_gmail_default" style="font-family:arial,helvetica,sans-serif">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.
<br>
</div>
<div class="x_gmail_default" style="font-family:arial,helvetica,sans-serif"><br>
</div>
<div class="x_gmail_default" style="font-family:arial,helvetica,sans-serif">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.</div>
<div class="x_gmail_default" style="font-family:arial,helvetica,sans-serif">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.</div>
<div class="x_gmail_default" style="font-family:arial,helvetica,sans-serif"><br>
</div>
<div class="x_gmail_default" style="font-family:arial,helvetica,sans-serif">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.<br>
</div>
<div class="x_gmail_default" style="font-family:arial,helvetica,sans-serif"><br>
</div>
<div class="x_gmail_default" style="font-family:arial,helvetica,sans-serif">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?<br>
</div>
<div class="x_gmail_default" style="font-family:arial,helvetica,sans-serif"><br>
</div>
<div class="x_gmail_default" style="font-family:arial,helvetica,sans-serif">Thank you,</div>
<div class="x_gmail_default" style="font-family:arial,helvetica,sans-serif">Albert<br>
</div>
</div>
<div dir="ltr"><br>
</div>
<div dir="ltr">-- <br>
<div dir="ltr" class="x_gmail_signature">
<div dir="ltr">
<div>
<div dir="ltr">
<div>
<div dir="ltr">
<div dir="ltr">
<div dir="ltr">
<div dir="ltr">
<div style="color:rgb(0,0,0); font-size:10pt; letter-spacing:normal; line-height:12pt; margin-bottom:0px; margin-top:0px">
<p class="x_MsoNormal"><span style="color:rgb(102,102,102)">Albert Schrotenboer</span></p>
<p class="x_MsoNormal"><span style="color:rgb(102,102,102)">Ph.D. Candidate</span></p>
<p class="x_MsoNormal"><span style="color:rgb(102,102,102)">Faculty of Economics and Business</span></p>
<p class="x_MsoNormal"><span style="color:rgb(102,102,102)"></span><font color="rgb(34, 34, 34)"><span style="color:rgb(102,102,102)">University of Groningen</span></font><font color="rgb(34, 34, 34)"><span style="color:rgb(102,102,102)"><br>
</span></font></p>
<p class="x_MsoNormal"><font color="rgb(34, 34, 34)"><span style="color:rgb(102,102,102)">P.O. Box 800, 9700 AV Groningen</span>
</font></p>
</div>
</div>
</div>
</div>
</div>
</div>
</div>
</div>
</div>
</div>
</div>
</div>
</div>
</div>
</div>
</div>
</div>
</body>
</html>