[Scip] [SCIP] adding constraints during pricing

Stefan Heinz heinz at zib.de
Sat Apr 28 21:36:02 MEST 2012


Hi Daniel,

I see the issue. What happens if you replaces "stat->nnodes <= 1" with TRUE?

Stefan

On 04/27/2012 10:32 AM, Daniel Karch wrote:
> Hi,
>
> I have the same problem. In my pricer, I first create two variables and add
> them to the problem
> with SCIPaddPricedVar.
> Then, I create the linear constraints using these new variables with the
> flags
> initial, separate, enforce, check, propagate set to TRUE.
> SCIP does not seem to take the new constraints into account at all.
> I have stepped into SCIPaddCons with gdb, until it arrives at the following:
>
> in cons.c, l. 1334:
> /* add constraint to the initconss array if the constraint is initial and
> added to the focus node */
> if( focusnode&&  cons->initial )
> {
>     SCIP_CALL( conshdlrAddInitcons(conshdlr, set, cons) );
> }
>
> Here, focusnode is FALSE. The function conshdlrActivateCons where this
> occurs is called in the function SCIPconsActivate,
> which in turn is called like this:
>
> SCIP_CALL( SCIPconsActivate(cons, set, stat, -1, (stat->nnodes<= 1)),
>
> and focusnode is set to FALSE because (stat->nnodes<= 1) is not satisfied.
> When this happens, we are *not in the root node* anymore.
> Does this mean that I can add linear constraints only in the root node?
> This confuses me ... I thought this was what the 'local' flag is for.
>
> I would appreciate if you could give me a hint as to how I should proceed.
>
> Best regards,
>
>    Daniel
>
>
>
> 2012/3/31 Stefan Heinz<heinz at zib.de>
>
>> Hi,
>>
>> when you create the new linear constraints did you set the initial flag
>> to TRUE (this is the first Boolean of the ten)?
>>
>>
>> http://scip.zib.de/doc/html/cons__linear_8h.html#aa7aed137a4130b35b168812414413481
>>
>> Doing that should put the new constraints into the LP before it is
>> solved again. The magic happens in the method SCIPpriceLoop()
>>
>> http://scip.zib.de/doc/html_devel/solve_8c_source.html#l01625
>>
>> in line 01755.
>>
>> Best Stefan
>>
>> On 03/30/2012 11:33 AM, Hélène Toussaint wrote:
>>> Hi,
>>>
>>> I have a BCP code. When I generate a new variable in the redcost
>>> function of the pricer I must generate also several constraints in
>>> which this new variable appears. To generate and add these constraints
>>> I use SCIPcreateConsLinear and SCIPaddCons.
>>>
>>> My problem is that some of these constraints are not taken into
>>> account: before branching I use SCIPvarGetLPSol to see the current lp
>>> solution and this solution does not always satisfy all the constraints
>>> added in the pricer.
>>>
>>> How to tell SCIP to take into account my new constraints ? I'd like
>>> the current lp solution be updated every time a new constraint is
>>> added (even before generate a new variable since it changes the dual
>>> costs).
>>>
>>> Best,
>>> Hélène
>>>
>>>
>>>
>>>
>>> _______________________________________________
>>> Scip mailing list
>>> Scip at zib.de
>>> http://listserv.zib.de/mailman/listinfo/scip
>> _______________________________________________
>> Scip mailing list
>> Scip at zib.de
>> http://listserv.zib.de/mailman/listinfo/scip
>>



More information about the Scip mailing list