[SCIP] Return value from SCIPgetVarRedcost does not match objective function value of pricer

Marc Pfetsch pfetsch at mathematik.tu-darmstadt.de
Thu Feb 24 18:52:01 CET 2022


On 22/02/2022 20.23, Hewitt, Michael wrote:
> I am using column generation to solve a network optimization problem and adding variables to the master via a custom pricer.
> After I discover the column to add in my pricer, my code
> 1) calls SCIPcreateVar (initial set to true) to create the variable for that column
> 2) Sets the appropriate coefficient of each constraint that variable should participate in
> 	note that a) each constraint marked as modifiable when created and is the transformed constraint
> 3) calls SCIPaddPricedVar
> 
> Just to be certain, I then call SCIPgetVarRedcost to get the reduced cost of this variable and ensure it matches with what my pricer reports.
> It often does not.
> 
> Does this mean there is a problem? Or is it possible the dual variables when I call SCIPgetVarRedcost no longer reflect the current basis matrix?

 From what I see from the code with a quick glance, SCIPgetVarRedcost() 
should correctly compute the reduced cost for your new variable. To make 
sure, one would need to go through the calls with a debugger.

However, something being wrong in the implementation would not be too 
uncommon. One typical error is to forget about dual variables 
corresponding to bounds of primal variables or the signs of variables 
arsing from less or equal or greater or equal constraints.

Thus, these hints will probably not directly help you, but at least I 
wanted to provide some feedback to your questions.

Best

Marc


More information about the Scip mailing list