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

Matheus Ota matheusota at gmail.com
Tue Jun 5 21:48:20 CEST 2018


Dear Gerald,

Thanks to your answer I was able to solve the problem. What I did is that I
removed the SCIPreleaseRow when creating the cut and check with
SCIProwIsInLP before trying to add the variable to the row. I also remove
from the data structure and release the row if it is not in the LP.

Now I'm getting another error, after calling the CONSEPALP method from the
constraint handler, the code goes into infinite loop and just stops after
pressing CTRL+C 2 times.

Debugging the CONSEPALP I discovered that the current solution is feasible
but not integer. Therefore, no cuts are added. So the code exit with result
= SCIP_DIDNOTFIND.
After the CONSEPALP I would expect SCIP to call the my Branching Rule, but
this only happens after pressing CTRL+C 2 times (and the solution that I
get is not optimal).

Here is a part of my output:

> ...
> [cvrpcutscallbackscip.cpp:85] debug: consepalp
> ^Cpressed CTRL-C 1 times (5 times for forcing termination) -> INFINITE
> LOOP HERE
> ^Cpressed CTRL-C 1 times (5 times for forcing termination)
> [cvrpcutscallbackscip.cpp:106] debug: consenfolp
> [cvrpbranchingrule.cpp:294] debug: branching execlp
> ...
>

Do you have any tips here?

Thanks,
Matheus

2018-06-05 13:29 GMT-03:00 Gerald Gamrath <gamrath at zib.de>:

> 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 listScip at zib.dehttps://listserv.zib.de/mailman/listinfo/scip
>
>
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://listserv.zib.de/pipermail/scip/attachments/20180605/0e2dde67/attachment.html>


More information about the Scip mailing list