[Scip] Fwd: Accessing dual variables and the number of fixed variables.

Jan Berling berlingjan at googlemail.com
Mon Mar 24 14:50:47 CET 2014


Dear SCIP mailing list,

thanks for the programming session at the Column Generation Spring School!

I have some problems accessing the dual variables and the number of
fixed variables in a constraint.

My SCIP 3.0.1 is built as a Matlab mex file. The variables and
constraints are generated and successfully linked. The input LP is
solved correctly. When some variables are fixed, the solution changes
accordingly.

The number of fixed variables of a constraint is allegedly always
zero. The dual variables are allegedly zero, too.

SCIPgetNVarsSetppc(scip, consFlights[n]);              // correct output
SCIPgetNFixedzerosSetppc(scip, consFlights[n]);   // outputs 0(*).
SCIPgetDualsolSetppc(scip,consFlights[n]);             // outputs 0(**).


(*) To fix the variables, following code is used:

#define vars(f,d) vars[(f)*MAX_DELAY + d]                 // to access
vars in 2D
SCIP_Bool infeasible;
SCIP_Bool fixed;
SCIP_ERR( SCIPfixVar(scip, vars(f,d), 0.0, &infeasible, &fixed),
"Error fixing variable" );

After SCIPfixVar(), the value of infeasible is 0 and fixed is 1. I'm
pretty sure, that the variables are fixed.

I tried to fix the variable before adding it to a constraint and
afterwards, SCIPgetNFixedzerosSetppc() still outputs zero.
SCIPgetNFixedonesSetppc() outputs zero too, even if there are some
variables fixed to 1.
I also used the functions before and after solve(scip), but they still
give only zeros as output...
How can I get the number of fixed variables? Is there anything I have
overlooked?


(**) Is it only possible to get the dual variables in the solving
stage for example in SCIP_STAGE_SOLVING?


Best regards
Jan


More information about the Scip mailing list