[SCIP] Adding constraints while pricing

Maher, Stephen s.maher3 at lancaster.ac.uk
Fri Apr 12 11:19:47 CEST 2019


Hi Albert,

I don't have any direct experience with setting the 'removable flag' to 
TRUE. However, I would not recommend doing this, since it would be 
difficult to know what constraints were actually removed when trying to 
compute the reduced cost.

One thing that I have tried is setting the 'initial' flag to FALSE to 
remove the constraints. I can't recall whether this was actually all 
that helpful, but it is something that is easy to try. One of the other 
developers may be able to explain better if, how and when rows are 
removed from the LP by setting the 'initial' flag to FALSE.

Cheers,

Steve

On 11/04/2019 17:10, Schrotenboer, Albert wrote:
> Dear Steve,
> 
> Thank you for the extensive reply. I forgot to set the initial flag to 
> TRUE,  thinking that that would only make sense before starting(i.e. 
> "initializing") to solve the model, and now actually realizing having 
> made this mistake before... I
> 
> Do you also have experiences with setting the 'removable' flag to TRUE? 
> As my reduced cost pricings are not really standard (i.e., I can ignore 
> certain columns based on an upper bound on the reduced cost (which is <= 
> 0 otherwise it would be useless of course), I am a bit worried that 
> setting that flag to TRUE causes undefined behavior.
> 
> Thanks,
> Albert
> 
> 
> 
> 
> 
> On Tue, Apr 9, 2019 at 4:04 AM Maher, Stephen <s.maher3 at lancaster.ac.uk 
> <mailto:s.maher3 at lancaster.ac.uk>> wrote:
> 
>     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 <mailto:scip-bounces at zib.de>> on
>     behalf of Schrotenboer, Albert <a.h.schrotenboer at rug.nl
>     <mailto:a.h.schrotenboer at rug.nl>>
>     *Sent:* Thursday, 4 April 2019 9:46 PM
>     *To:* scip at zib.de <mailto: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
> 
> 
> 
> -- 
> 
> Albert Schrotenboer
> 
> Ph.D. Candidate
> 
> Faculty of Economics and Business
> 
> University of Groningen
> 
> P.O. Box 800, 9700 AV Groningen
> 



More information about the Scip mailing list