<div dir="ltr"><div><div><div>Hello Rolf, Ambros, <br><br></div>thanks for your responses. Using lazy upper bounds, as you've both pointed out, has helped a lot. Turns out the problem I was having was a consequence of this as also the fact that I was using the wrong sign for some of the duals. I believe I have sorted it out now.<br><br></div>Thanks again for your help! <br></div>André<br></div><br><div class="gmail_quote"><div dir="ltr" class="gmail_attr">Em sex., 2 de set. de 2022 às 07:51, Ambros Gleixner <<a href="mailto:gleixner@zib.de" target="_blank">gleixner@zib.de</a>> escreveu:<br></div><blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left:1px solid rgb(204,204,204);padding-left:1ex">Hi André,<br>
<br>
Just to add a bit to Rolf's reply:<br>
<br>
Yes, lazy bounds are the way to go.  I would not add explicit linear <br>
constraints for bounds, and I am not sure that you could even get the <br>
duals since these constraints should be converted into bounds during <br>
presolving.<br>
<br>
If you want to have variable bounds explicitly in your model, then you <br>
can use the method SCIPgetVarRedcost() to get the dual multiplier for <br>
the bound constraints of the variable.  Depending on the sign it will <br>
correspond to upper or lower bound.<br>
<br>
Best,<br>
Ambros<br>
<br>
<br>
Am 31.08.22 um 17:03 schrieb Rolf van der Hulst:<br>
> Hi André,<br>
> <br>
> Although I am not sure if there is a way to explicitly get the dual <br>
> solutions for the variables, I do have a workaround which would work for <br>
> you.<br>
> <br>
> In many branch-and-price applications, the variable bounds are <br>
> implicitly satisfied. Thus, SCIP supports disabling them (e.g. <br>
> preventing them from entering the LP) by setting 'lazy bounds' through <br>
> the functions<br>
> SCIPchgVarLbLazy() and SCIPchgVarUbLazy(). In debug mode, SCIP checks if <br>
> the variables satisfy these lazy bounds, but does not enforce them in <br>
> the LP. In release mode, they are equivalent to unbounded variables.<br>
> <br>
> In your case, you can make the bounds on relevant variables lazy, and <br>
> then explicitly add the variable bound constraints to the master problem <br>
> as linear constraints (rather than implicitly during variable creation).<br>
> Then, you can simply use the SCIPgetDualsolLinear() on these variable <br>
> bound constraints to get the dual solution.<br>
> <br>
> There might be an easier way to do this, as it can be some work to add <br>
> all of the variable bounds explicitly as constraints.<br>
> <br>
> Best,<br>
> <br>
> Rolf<br>
> <br>
> On 31-08-2022 15:48, André Mazal Krauss wrote:<br>
>> Hello SCIP team,<br>
>><br>
>> I'm currently working on a VRP-related application, using SCIP.  I'm <br>
>> using a Set Partioning formulation with Branch & Price, and my <br>
>> formulation is a minimization problem. I've started having issues with <br>
>> pricing of repeated variables and slow convergence. I suspect this is <br>
>> happening because I'm not correctly considering the duals of bound <br>
>> constraints on my pricing.<br>
>><br>
>> My variables are all binary, so they should have implicit linear x > 0 <br>
>> and x < 1 constraints, right? How can I collect these constraints, <br>
>> either during variable creation or later, so I can query their duals <br>
>> using SCIPgetDualsolLinear? I don't believe this will actually help <br>
>> solve the underlying issue, and I might have some reformulation to do, <br>
>> but having this would help me diagnose the problem better and make <br>
>> sure I understand it correctly.<br>
>><br>
>> I have of course read the documentation but haven't found anything on <br>
>> bound constraints. Also, functions like SCIPgetNConss(scip) do not <br>
>> seem to account for these. I'd like to avoid creating them explicitly <br>
>> over the binary variables since this seems redundant and I'm not sure <br>
>> about how the solver would behave in this situation.<br>
>><br>
>> Thanks in advance for your help,<br>
>> André Mazal Krauss<br>
> _______________________________________________<br>
> Scip mailing list<br>
> <a href="mailto:Scip@zib.de" target="_blank">Scip@zib.de</a><br>
> <a href="https://listserv.zib.de/mailman/listinfo/scip" rel="noreferrer" target="_blank">https://listserv.zib.de/mailman/listinfo/scip</a><br>
_______________________________________________<br>
Scip mailing list<br>
<a href="mailto:Scip@zib.de" target="_blank">Scip@zib.de</a><br>
<a href="https://listserv.zib.de/mailman/listinfo/scip" rel="noreferrer" target="_blank">https://listserv.zib.de/mailman/listinfo/scip</a><br>
</blockquote></div>