[Scip] linear constraint turns into nonlinear

Gerald Gamrath gamrath at zib.de
Thu Apr 17 09:46:23 CEST 2014


Hi Shahin,

first of all, it might happen happen that constraints are detected to be 
redundant during presolving or (as in your case) upgraded, which means, 
e.g., linear to a special form of linear like knapsack or setppc, or 
also linear-type constraints to nonlinear constraints like "and" (in 
case a set of linear constraints models exactly this nonlinearity; this 
is done by the gate presolver).

However, all of this can only happen, if your constraint is not marked 
to be modifiable. Otherwise, SCIP cannot detect the structure of a 
constraint, because it does not know which variables will be added and 
with which coefficient.

In your case, if your master-only constraints are not modifiable because 
you don't add variables to them during pricing, removing or upgrading 
these constraints can happen. But what do you need the dual solution 
values of these constraints for, anyway?

If you want to keep the constraints as they are, you can also disable 
the gate presolver and all upgrading techniques (check the cons_linear 
settings in the interactive shell). But still, unless you disable 
presolving, SCIP might detect that some of them are redundant and remove 
them.

By the way: Whenever you store a pointer to a constraint or variable, 
you should capture this constraint/variable (unless it was already 
captured, e.g, by SCIPcreateVar()). Later, if you don't need these 
pointers anymore, you must release them. This can be done by 
SCIPcapture/releaseVar/Cons(). In this case, you would still have the 
transformed linear constraints in your hand, because SCIP cannot delete 
them since you still have a capture on it. However, it would not fix 
your particular problem, since the constraints would not be in the 
problem anymore after deletion.

Best,
Gerald


Am 16.04.2014 23:21, schrieb Shahin Gelareh:
> Dear SCIPers
>
> in CG:
> in scip_init
> I do the following:
> SCIP_CALL( SCIPgetTransformedCons(scip, m_con_MasterOnly[i], 
> &m_con_MasterOnly[i]) );
>
> where these constraints are declared as
>            true,                   /* initial */
>             false,                  /* separate */
>             true,                   /* enforce */
>             true,                   /* check */
>             true,                   /* propagate */
>             false,                  /* local */
>             false,                  /* modifiable */
>             false,                  /* dynamic */
>             false,                  /* removable */
>             false) );               /* stickingatnode */
> in the master problem (non-modifiable because they do not contain any 
> column of pricing problem).  The transformation is done successfully.
> But when it arrives first time in the pricing problem and I ask
> dual_MasterOnly.push_back(SCIPgetDualsolLinear(scip, 
> m_con_MasterOnly[i]));
> then I get an error message that the constraint is not linear!
> Moreover, when I look at the  constraint it s name has changed to 
> "andgate_0" which does not correspond with the original constraint 
> (and the rest of elements of array have name field equal to "NULL").
>
> The strange thing is that the first element of this array is correct 
> but the second up to end have changed.
>
> instead I have a set of constraints which are linking constraints and 
> I have declared them as
>
> true,                   /* initial */
> false,                  /* separate */
> true,                   /* enforce */
> true,                   /* check */
> true,                   /* propagate */
> false,                  /* local */
> true,                  /* modifiable */
> false,                  /* dynamic */
> false,                  /* removable */
>                                             false) );               /* 
> stickingatnode */
>
> to be modified upon need (adding  new col).
> Everything is fine with this set of constraints. and I can get the 
> dual values.
>
> Now the question is that I have a set of constraint which need to be 
> extended by adding new columns (linking constraints, master-only and 
> priced vars) , a set of masterOnly constraints (constraints made of 
> master-only variables) and a set of convexity constraints.
>
>
> What should be the way of declaring each set of such constraints? Is 
> there something wrong?
>
> Cheers
> Shahin
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
> _______________________________________________
> Scip mailing list
> Scip at zib.de
> http://listserv.zib.de/mailman/listinfo/scip

-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://listserv.zib.de/pipermail/scip/attachments/20140417/72fd6d04/attachment.html>


More information about the Scip mailing list