<div dir="ltr"><div><div>Dear Gerald,<br></div><br></div>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.<br><br>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.<br><br>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.<br>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).<br><br>Here is a part of my output:<br><blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left:1px solid rgb(204,204,204);padding-left:1ex">...<br>[cvrpcutscallbackscip.cpp:85] debug: consepalp<br>^Cpressed CTRL-C 1 times (5 times for forcing termination) -> INFINITE LOOP HERE<br>^Cpressed CTRL-C 1 times (5 times for forcing termination)<br>[cvrpcutscallbackscip.cpp:106] debug: consenfolp<br>[cvrpbranchingrule.cpp:294] debug: branching execlp<br>...<br></blockquote><div><br></div><div>Do you have any tips here?<br><br></div><div>Thanks,<br></div><div>Matheus<br></div></div><div class="gmail_extra"><br><div class="gmail_quote">2018-06-05 13:29 GMT-03:00 Gerald Gamrath <span dir="ltr"><<a href="mailto:gamrath@zib.de" target="_blank">gamrath@zib.de</a>></span>:<br><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">
<div text="#000000" bgcolor="#FFFFFF">
Dear Matheus,<br>
<br>
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.<br>
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.<br>
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).<br>
<br>
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.<br>
<br>
Best,<br>
Gerald<div><div class="h5"><br>
<br>
<div class="m_6631000680428250984moz-cite-prefix">On 05.06.2018 02:05, Matheus Ota wrote:<br>
</div>
</div></div><blockquote type="cite"><div><div class="h5">
<div dir="ltr">
<div>
<div>
<div>
<div>Hi All,<br>
<br>
</div>
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. <br>
<br>
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:<br>
<br>
SCIP_CALL(SCIPaddVarToRow(<wbr>scip, row, var, coef));<br>
<br>
</div>
I also already made sure that when creating the rows they
are set to modifiable = true<br>
<br>
</div>
<div>Should I use some kind of "getTransformedRow" before
calling the addVar?<br>
<br>
</div>
<div>The following is my code for SCIP_CONS, instead of
SCIP_ROWS, and it works fine:<br>
<br>
SCIP_CONS *transfCons;<br>
SCIPgetTransformedCons(scip, cons, &transfCons);<br>
SCIP_CALL(SCIPaddCoefLinear(<wbr>scip, transfCons, var, coef));<br>
</div>
<div><br>
Do anyone have some tips here? <br>
<br>
</div>
Thanks,<br>
</div>
Matheus<br>
</div>
<br>
<fieldset class="m_6631000680428250984mimeAttachmentHeader"></fieldset>
<br>
</div></div><pre>______________________________<wbr>_________________
Scip mailing list
<a class="m_6631000680428250984moz-txt-link-abbreviated" href="mailto:Scip@zib.de" target="_blank">Scip@zib.de</a>
<a class="m_6631000680428250984moz-txt-link-freetext" href="https://listserv.zib.de/mailman/listinfo/scip" target="_blank">https://listserv.zib.de/<wbr>mailman/listinfo/scip</a>
</pre>
</blockquote>
<br>
</div>
</blockquote></div><br></div>