[SCIP] Same row added multiple times

Marc Pfetsch pfetsch at mathematik.tu-darmstadt.de
Tue Aug 24 11:58:19 CEST 2021



Hi Eddie and Matheus,

let me try to add some information to the issues raised below and in the 
previous email by Eddie:

- If you use "forcecut = true" this just means that the row/cut is 
always added to the LP of the local node, even if it is globally valid. 
It is *not* automatically added to all LPs. In order to achieve this, 
you should add the row/cut to the cut pool with SCIPaddPoolCut(). It 
will then be automatically separated (and added if it is efficient enough).

- Eddie mentions that SCIPlpShrinkRows() removes rows, even though they 
have not been marked as not removable. I have checked the code and this 
function is only called if the complete LP is cleared, e.g., if a 
sub-SCIP is freed, or if diving heuristics have added cuts. In both 
cases, I think that it is correct to remove these rows. As far as I can 
see, rows that are marked as removable are not removed otherwise.

In conclusion: It is also important to check where rows are removed. For 
this, one can check the backtrace in a debugger and see whether the rows 
are added/removed within a heuristic that uses a sub-SCIP.

I hope that this sheds some light on the two issues.

Best

Marc



On 21/08/2021 07.17, Edward Lam wrote:
> Hi all,
> 
> This is the same issue I had a while ago that was not resolved. It didn’t affect me in the end. I just had to keep adding the same rows.
> 
> http://listserv.zib.de/pipermail/scip/2021-February/004210.html <http://listserv.zib.de/pipermail/scip/2021-February/004210.html>
> 
> Cheers
> Eddie
> 
>> On 20 Aug 2021, at 1:43 am, Matheus Ota <matheusota at gmail.com> wrote:
>>
>> Hi Ambros,
>>
>> Thanks for the reply! I used the SCIPwriteMIP, and indeed, when the constraint is added the second time, it is not present in the current LP relaxation. In fact, only the constraints that were added at the same node (node 5) are present. This is strange, since I'm adding the row with local = FALSE. In my understanding, this should mean that every such row is added "globally".
>>
>> So to answer your questions:
>> 1 - I generate the cuts both in the root and at the other nodes.
>> 2 - I'm creating the row with SCIPcreateEmptyRowConshdlr setting local, modifiable and removable as FALSE.
>> 3 - I'm adding only rows where the violations is of at least 0.0001.
>>
>> Thanks!
>> Matheus
>>
>> Em ter., 17 de ago. de 2021 às 13:51, Ambros Gleixner <gleixner at zib.de <mailto:gleixner at zib.de>> escreveu:
>> Dear Matheus,
>>
>> You can write the current LP relaxation with integrality information
>> using SCIPwriteMIP().
>>
>> Maybe check again what is happening and then you can give us also more
>> details:  Where do you generate the cuts (root/local nodes), with which
>> flags do you add them exactly, and how big is the violation (efficacy,
>> i.e., normalized by the 2 norm of the coefficient vector)?
>>
>> Best,
>> Ambros
>>
>>
>> Am 16.08.21 um 01:40 schrieb Matheus Ota:
>>> Dear Scipers,
>>>
>>> I've been implementing a branch-and-cut using SCIP, I already
>>> implemented the constraint handler and I'm adding the violated rows
>>> using "SCIPaddRow". I'm also setting forcecut = true, and thus, I would
>>> suppose that, once a violated row is added, the same row should not be
>>> added again. However, my program add the same row multiple times.
>>>
>>> For example, in one instance it adds this row in the beginning:
>>> 196 <= +196<t_x_7,2> +196<t_x_7,3> +196<t_x_6,2> +196<t_x_6,3>
>>> +196<t_x_5,2> +196<t_x_5,3> +196<t_x_4,2> +196<t_x_4,3> -196<t_x_3,2>
>>> -196<t_x_3,4> -196<t_x_2,3> -196<t_x_2,4> +196<t_x_1,2> +196<t_x_1,3>
>>> +1<t_y_163> +392 <= 1e+20
>>>
>>> Then, after exploring some other solution, it adds the same row again:
>>> 196 <= +196<t_x_7,2> +196<t_x_7,3> +196<t_x_6,2> +196<t_x_6,3>
>>> +196<t_x_5,2> +196<t_x_5,3> +196<t_x_4,2> +196<t_x_4,3> -196<t_x_3,2>
>>> -196<t_x_3,4> -196<t_x_2,3> -196<t_x_2,4> +196<t_x_1,2> +196<t_x_1,3>
>>> +1<t_y_163> +392 <= 1e+20
>>>
>>> I'd appreciate any help! Also, is there any way so that I can print all
>>> the current rows in the LP? My idea was to print all rows in the LP
>>> before SCIP adds the same row the second time, so that I can check that
>>> indeed the row was added the first time.
>>>
>>> Thanks,
>>> Matheus
>>>
>>> _______________________________________________
>>> Scip mailing list
>>> Scip at zib.de <mailto:Scip at zib.de>
>>> https://listserv.zib.de/mailman/listinfo/scip <https://listserv.zib.de/mailman/listinfo/scip>
>>>
>> _______________________________________________
>> Scip mailing list
>> Scip at zib.de <mailto:Scip at zib.de>
>> https://listserv.zib.de/mailman/listinfo/scip <https://listserv.zib.de/mailman/listinfo/scip>
>> _______________________________________________
>> Scip mailing list
>> Scip at zib.de
>> https://listserv.zib.de/mailman/listinfo/scip
> 
> 
> 
> _______________________________________________
> Scip mailing list
> Scip at zib.de
> https://listserv.zib.de/mailman/listinfo/scip
> 


More information about the Scip mailing list