[SCIP] Error: constraint is not linear

Gerald Gamrath gamrath at zib.de
Thu Jun 27 22:56:29 CEST 2019


Dear Mahdi,

I am sorry, but I did not really understand what is going wrong, you 
need to give more detail. When do you call SCIPwriteTransProblem()? It 
does not write anything or are variables missing in the .lp file?

If I understand you correctly, you have a function that adds the priced 
variables and that should write the problem, which does not happen, and 
also some output that you would expect which should be printed at the 
end of the function is not printed. I can only guess that you have some 
if conditions in the function that return earlier and thus, you do not 
reach the end of the function. But I cannot help you debug your code. 
You could compile in debug mode and run it with gdb to set break points 
and go step-by-step to see what happens, if you cannot identify it just 
by looking at the code.

Best,
Gerald

On 26.06.19 08:31, mahdi noorizadegan wrote:
> Hi Gerald,
>
> I have a pricing procedure which finds variables with negative reduced 
> cost.
> Once they are found they are added to the master problem. However, the 
> .lp file via SCIPwriteTransProblem is not created after addition. It 
> is set to create .lp file after addition of variables.
>
> I do cout "check" at the end of the variable adding function (before 
> return SCIP_OKAY) and also after call for this function. While it 
> leaves the function and starts the pricing procedure, it does not 
> print the check point after the var adding function. Therefore no .lp 
> file is created.
> Could you please let me know what I have done wrong?
>
> Regards,
> Mahdi
>
>
> On Sat, 25 May 2019 at 12:58, Gerald Gamrath <gamrath at zib.de 
> <mailto:gamrath at zib.de>> wrote:
>
>     Dear Mahdi,
>
>     even if you create a model with only linear constraints, SCIP
>     might upgrade them in presolving to specialized linear constraints
>     like knapsack or set cover constraints. SCIP does not do this if
>     you marked a constraint to be modifiable, which you should have
>     done if priced variables will potentially be added to the
>     constraint. On the other hand, if you will not add any priced
>     variables to the constraint, you don't need to mark it to be
>     modifiable, but you should also not need its dual value.
>
>     I would suggest you check what type the constraint has via
>     SCIPconshdlrGetName(SCIPconsGetHdlr(cons)) either in gdb or in
>     your code.
>
>     Best,
>     Gerald
>
>     On 22.05.19 14:45, mahdi noorizadegan wrote:
>>     Hello,
>>
>>     I am implementing an IP using branch and price method.
>>     When I want to get the dual value of constraints which are all
>>     linear, I get the following error
>>
>>     [src/scip/cons_linear.c:17033] ERROR: constraint is not linear
>>
>>     What can be wrong?
>>
>>     Looking forward to hearing from you,
>>     Regards,
>>     Mahdi
>>
>>     _______________________________________________
>>     Scip mailing list
>>     Scip at zib.de  <mailto: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/20190627/ad4f41ae/attachment.html>


More information about the Scip mailing list