[Scip] SCIPchgVarObj and SCIPaddObjoffset
Gerald Gamrath
gamrath at zib.de
Thu Feb 10 10:17:00 MET 2011
Hi Sebastian,
the stage of the subscip is independend of the stage of the main SCIP
instance. Thus, the subscip is in the creation stage until you start to
solve it by calling SCIPsolve(subscip).
However, you do not have to generate the whole pricing problem anew, you
can just call SCIPfreeTransform(subscip) to free the solving process
data and just keep the original problem. After that, you are again in
the problem creation stage of that SCIP instance and can change the
objective function.
The method SCIPaddObjoffset is meant to be used only in the presolving
stage, so you are not allowed to call it at the points you tried. I
don't know why this is the case, it would probabaly be possible to make
it available also in the problem creation stage.
However, I think there are two easy solutions for you: Either you create
an "obj" variable that is fixed to zero and gets the offset as objective
coefficient, or you just store the dual value of the convexity
constraint in your pricer and subtract it from your subscip's optimal
value afterwards.
Best,
Gerlad
Sebastian Ruther schrieb:
> Hello,
>
> in my branch and price algorithm I generate the pricing problem in
> scip_initsol while in scip_redcost I want to only update the objective
> function values of the pricing problem with the dual values from the
> master problem. Your examples always generate the whole pricing problem
> anew in each iteration - which is rather inefficient for non-small
> pricing problems.
> Now the problem of course is that in scip_redcost the subscip is in
> stage-solved so it won't let me do this. Actually, even though it is in
> scip_redocst the problem is in the creation stage until you execute
> SCIPsolve(subscip) so in the first run you are allowed to use
> SCIPchgVarObj (no problem), SCIPaddObjoffset though creates an error:
> ERROR: cannot call method <SCIPaddObjoffset > in problem creation stage
> ERROR: <-8> in function call
> In further iterations both trigger this error:
> ERROR: cannot call method <SCIPchgVarObj> in solving stage
> ERROR: <-8> in function call
>
> The convexity constraint of the master problem is unrelated to any
> pricing problem variable so it is simply a constant that is added to the
> pricing problem objective function. That's why I use SCIPaddObjoffset.
>
> What can I do?
>
> Thank you
> Sebastian
> _______________________________________________
> Scip mailing list
> Scip at zib.de
> http://listserv.zib.de/mailman/listinfo/scip
>
More information about the Scip
mailing list