[SCIP] How could I access the new constraints created by SCIPbranchVar() ?

Stephen J. Maher s.maher3 at lancaster.ac.uk
Thu Aug 30 12:00:10 CEST 2018


Hi Myroslav,

This would not be possible. You will need to create a new constraint for 
each branching decision.

Cheers,

Steve

On 29/08/18 12:33, myroslav wrote:
> Dear Steve,
> 
> 
> Is it possible to add the same constraint to two different nodes in the 
> branching tree? For example, if we want to add the same branching 
> decision in different nodes(so that one is not in the subtree of the 
> other) of the tree? Or every time I make a branching decision I have to 
> create a new constraint for it?
> 
> 
> Thanks for your help!
> 
> Myroslav
> 
> 
> On 29/08/2018 12:48, Stephen J. Maher wrote:
>> Hi Myroslav,
>>
>> You don't need to store the constraint at the node, but only check 
>> whether it is active. The constraint is stored at the node internally 
>> when you call SCIPaddConsNode. When you are in your pricing, call 
>> SCIPconsIsActive with your bound constraints to check which 
>> constraints are active at the current node.
>>
>> Cheers,
>>
>> Steve
>>
>> On 29/08/18 11:15, myroslav wrote:
>>> Dear Steve,
>>>
>>>
>>> thanks for your answer!
>>>
>>> I wondered, how I could store such a constraint at a node. I guess I 
>>> not only need to store the branching constraint created at a node but 
>>> also all the other constraints on the path to the root in this node.
>>>
>>> What would be a proper way of doing it, should I use SCIP_NODEDATA 
>>> data structure or is there a more elegant approach?
>>>
>>>
>>> Thanks,
>>>
>>> Myroslav
>>>
>>>
>>> On 29/08/2018 09:24, Stephen J. Maher wrote:
>>>> Hi Myroslav,
>>>>
>>>> If you want to branch by imposing a bound of specific variables, 
>>>> then I would suggest that you explicitly add a linear constraint 
>>>> that imposes this bound. In this way, you are able to store the 
>>>> constraint and then retrieve the corresponding dual when performing 
>>>> variable pricing.
>>>>
>>>> The process would be as follows:
>>>>
>>>> - Create a child by calling SCIPcreateChild.
>>>> - Create the linear constraint by calling SCIPcreateConsBasicLinear 
>>>> with the appropriate LHS and RHS. At this point you can also provide 
>>>> the variable to impose the bound. Otherwise, you need to call 
>>>> SCIPaddCoefLinear.
>>>> - Add the newly created constraint to the newly created child node 
>>>> by calling SCIPaddConsNode
>>>> - Store the newly created constraint in probdata or vardata.
>>>> - Repeat these steps for the other children of this node.
>>>>
>>>> Cheers,
>>>>
>>>> Steve
>>>>
>>>> On 21/08/18 16:16, myroslav wrote:
>>>>> I guess I need to access constraints corresponding to the 
>>>>> variable's bounds and then use SCIPgetDualsolVarbound() method to 
>>>>> get the dual value  but I could not figure out how to get 
>>>>> constraints corresponding to the variable's bounds.
>>>>>
>>>>> Sincerely,
>>>>>
>>>>> Myroslav
>>>>>
>>>>>
>>>>> On 21/08/2018 16:40, myroslav wrote:
>>>>>> Dear SCIP community,
>>>>>>
>>>>>>
>>>>>> I am trying to implement a simple branch-and-price algorithm. In 
>>>>>> the branching callback SCIP_DECL_BRANCHEXECLP I am using 
>>>>>> SCIPbranchVar() method to perform branching on one of the LP 
>>>>>> candidates obtained by the method SCIPgetLPBranchCands(). When 
>>>>>> branching on a variable in this way a new constraint is added in 
>>>>>> one of the two (the up-branch or the down-branch) branches and I 
>>>>>> should modify my pricing problem accordingly. How could I access 
>>>>>> the new constraints created by SCIPbranchVar() so that I could use 
>>>>>> them to get their dual variables when solving the pricing problem?
>>>>>>
>>>>>>
>>>>>> Thanks,
>>>>>>
>>>>>> Myroslav
>>>>>>
>>>>>> _______________________________________________
>>>>>> 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
>>>> _______________________________________________
>>>> Scip mailing list
>>>> Scip at zib.de
>>>> https://listserv.zib.de/mailman/listinfo/scip
>>>
>>
> 


More information about the Scip mailing list