[Scip] Deleting a SCIP variable

E. van der Veen E.van.der.Veen.7 at student.rug.nl
Fri Aug 8 20:43:31 MEST 2008


Does anyone know how I should/could delete variables in 
SCIP?
I'm trying to do a Branch-and-Price implementation with 
SCIP, however, I have some difficulties deleting created 
(priced) variables. During the branching process it is 
quite possible some of the variables/columns created in 
parent nodes are no longer valid in the child nodes, due 
to branching decisions (see * below for an explanation of 
this), and hence I think it is best to remove these 
variables from the SCIP instance, to keep the SCIP 
instance as small as possible. Furthermore, when these 
variables are not removed they are possibly included in 
the solution where this is not allowed.

During the creation of the variable I made the variables 
removable, by setting the property 'removable' to 'true'. 
To delete the variable I tried using the function 
SCIPdelVar(). When I checked whether the variable is 
deleted with SCIPvarIsDeleted() it does return 'true'. 
However, when I look at the solution obtained the variable 
is still present in the objective function and also in the 
constraints. The latter I kind of expected, because this 
is mentioned in the comment of the SCIPdelVar() function. 
However, I do not understand why the variable still 
appears in the objective function.
Is there another way of deleting variables, should I use 
another function instead of SCIPdelVar() (I searched for 
another SCIP function which could possibly do the job, but 
was unable to find one). Or am I overlooking something 
with using the SCIPdelVar() function?

Thanks in advance for any help you can provide.
Best regards,
Egbert van der Veen

--

* Suppose we have a rostering problem and Variables 
represent shifts. Suppose somewhere in the branching 
process it is decided that shifts are not allowed to last 
longer than 8 hours. Then all previously created shifts 
which violate this condition should not be used anymore 
(in this node). When these shifts (i.e. variables 
corresponding to them) are not deleted from the model you 
can end up with a solution in which they are used, which 
you of course do not want.


More information about the Scip mailing list