[Scip] How to get all transformed and presolved variables?

Tobias Achterberg achterberg at zib.de
Tue Mar 23 15:59:50 MET 2010


Martin Bergner wrote:
> I want to collect some statistics on my problem just after presolving
> has been finished. That means that I want to explicitly work with the
> presolved problem.
>
> I therefore implemented an empty presolver and try to do most of the
> work in the scip_exitpre method. I basically want to assign some
> variable data to transformed and presolved variables where I can collect
> some statistics.
>
> When I either call SCIPgetVars or SCIPgetOrigVars followed by
> SCIPgetTransformedVars, I do not get all variables. When looping over
> all constraints and the variables in the constraints, I get additional
> variables which have not been found by either one of the two methods
> mentioned above.
>
> After some debugging, I realized that the variables are presolved
> variables, the name being t_*_bin or t_*_neg or some combination. That
> somehow seems to make sense, as the two methods above only return
> transformed variables but the problematic variables are not only
> transformed but aggregated.
>
> Is it possible to have access to these variables besides looking at all
> constraints and inspecting the variables for each constraint? Or
> alternatively: How do I get all the variables and constraints from the
> presolved problem?

The SCIPget*Vars() methods only return the *active* variables of the problem. Thus, 
variables that are aggregated or variables that are negations of other variables will not 
be included in the arrays.

Do you really want to have the aggregated variables as well? If so, the methods of choice 
will be SCIPgetFixedVars() and SCIPgetNFixedVars(). Note that these methods always return 
NULL and 0 for the original problem, i.e., if you are still in the SCIP_STAGE_PROBLEM stage.



Tobias


More information about the Scip mailing list