[SCIP] Obtaining Bound Constraints from variables

Ambros Gleixner gleixner at zib.de
Fri Sep 2 12:48:36 CEST 2022


Hi André,

Just to add a bit to Rolf's reply:

Yes, lazy bounds are the way to go.  I would not add explicit linear 
constraints for bounds, and I am not sure that you could even get the 
duals since these constraints should be converted into bounds during 
presolving.

If you want to have variable bounds explicitly in your model, then you 
can use the method SCIPgetVarRedcost() to get the dual multiplier for 
the bound constraints of the variable.  Depending on the sign it will 
correspond to upper or lower bound.

Best,
Ambros


Am 31.08.22 um 17:03 schrieb Rolf van der Hulst:
> Hi André,
> 
> Although I am not sure if there is a way to explicitly get the dual 
> solutions for the variables, I do have a workaround which would work for 
> you.
> 
> In many branch-and-price applications, the variable bounds are 
> implicitly satisfied. Thus, SCIP supports disabling them (e.g. 
> preventing them from entering the LP) by setting 'lazy bounds' through 
> the functions
> SCIPchgVarLbLazy() and SCIPchgVarUbLazy(). In debug mode, SCIP checks if 
> the variables satisfy these lazy bounds, but does not enforce them in 
> the LP. In release mode, they are equivalent to unbounded variables.
> 
> In your case, you can make the bounds on relevant variables lazy, and 
> then explicitly add the variable bound constraints to the master problem 
> as linear constraints (rather than implicitly during variable creation).
> Then, you can simply use the SCIPgetDualsolLinear() on these variable 
> bound constraints to get the dual solution.
> 
> There might be an easier way to do this, as it can be some work to add 
> all of the variable bounds explicitly as constraints.
> 
> Best,
> 
> Rolf
> 
> On 31-08-2022 15:48, André Mazal Krauss wrote:
>> Hello SCIP team,
>>
>> I'm currently working on a VRP-related application, using SCIP.  I'm 
>> using a Set Partioning formulation with Branch & Price, and my 
>> formulation is a minimization problem. I've started having issues with 
>> pricing of repeated variables and slow convergence. I suspect this is 
>> happening because I'm not correctly considering the duals of bound 
>> constraints on my pricing.
>>
>> My variables are all binary, so they should have implicit linear x > 0 
>> and x < 1 constraints, right? How can I collect these constraints, 
>> either during variable creation or later, so I can query their duals 
>> using SCIPgetDualsolLinear? I don't believe this will actually help 
>> solve the underlying issue, and I might have some reformulation to do, 
>> but having this would help me diagnose the problem better and make 
>> sure I understand it correctly.
>>
>> I have of course read the documentation but haven't found anything on 
>> bound constraints. Also, functions like SCIPgetNConss(scip) do not 
>> seem to account for these. I'd like to avoid creating them explicitly 
>> over the binary variables since this seems redundant and I'm not sure 
>> about how the solver would behave in this situation.
>>
>> Thanks in advance for your help,
>> André Mazal Krauss
> _______________________________________________
> Scip mailing list
> Scip at zib.de
> https://listserv.zib.de/mailman/listinfo/scip


More information about the Scip mailing list