[SCIP] How to add priced variable to a row?

Gerald Gamrath gamrath at zib.de
Tue Jun 5 18:29:08 CEST 2018


Dear Matheus,

probably, you are not capturing the rows using SCIPcaptureRow(). In that 
case, the row structure may have been freed in the meantime, resulting 
in the segmentation fault.
Note that the cuts that you add to the LP are in fact added to the 
sepastore, which filters the cuts and finally adds some of them to the 
LP and discards the others. Also, rows may be removed later from the LP 
due to aging. Those rows are freed if they were not captured or added to 
the cut pool as well, which however, is not possible for modifiable cuts.
If you capture the rows when creating them (and release them at some 
time after solving), you avoid the segmentation fault. Additionally, you 
might want to check if the row is still in the LP via SCIProwIsInLP() 
and update it only if this returns TRUE (you might even release it then 
and remove it from your data structures).

There is no such thing as a transformed row since rows can only be 
created after the problem is transformed, so there cannot be rows in the 
original space. concerning your code snipped for the constraints: I 
would recommend to get the transformed counterparts of the original 
constraints once and use those directly later. This should typically be 
done in the INIT callback of a plugin.

Best,
Gerald

On 05.06.2018 02:05, Matheus Ota wrote:
> Hi All,
>
> I'm sorry for asking again, but I'm not able to find the answer on the 
> internet. I'm implementing a Branch-Cut-and-Price algorithm. The 
> Constraint Handler creates rows and adds them using SCIPaddCut. Then, 
> when a new variable is generated during column generation, it should 
> be inserted in the rows created by the Constraint Handler. The problem 
> is that I'm getting a segmentation fault when doing this.
>
> What I'm doing is calling a "pricing" routine on the PRICERFARKAS and 
> PRICERREDCOST methods. This pricing routing tries to adds to the row 
> using the following piece of code:
>
> SCIP_CALL(SCIPaddVarToRow(scip, row, var, coef));
>
> I also already made sure that when creating the rows they are set to 
> modifiable = true
>
> Should I use some kind of "getTransformedRow" before calling the addVar?
>
> The following is my code for SCIP_CONS, instead of SCIP_ROWS, and it 
> works fine:
>
> SCIP_CONS *transfCons;
> SCIPgetTransformedCons(scip, cons, &transfCons);
> SCIP_CALL(SCIPaddCoefLinear(scip, transfCons, var, coef));
>
> Do anyone have some tips here?
>
> Thanks,
> Matheus
>
>
> _______________________________________________
> Scip mailing list
> Scip at zib.de
> https://listserv.zib.de/mailman/listinfo/scip

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


More information about the Scip mailing list