[Scip] Adding constraints following completed pricing

Gerald Gamrath gamrath at zib.de
Thu Dec 6 12:53:13 MET 2012


Dear Rostilav, der Stephen,

you are right, by calling SCIPfreeTransform(), you can throw away the
complete solving data and get back to the original problem from before
you started solving. In particular, this means that all constraints and
variables are removed, that were created during the solving process.

@Rostilav: What kind of constraints does your event handler add during
the solving process and why? Shouldn't it add those again when solving
the problem again, if they are still needed? And if they are always
needed, why don't you add them at the beginning? Is it kind of a separation?
If you want to keep the constraints, one possibility would be to copy
the global problem via SCIPcopy(). However, the global problem in this
case is defined w.r.t. the current soulution process, e.g., some
constraints might be disabled or variable domains might be reduced
because of information SCIP collected about the current problem. These
reductions might not be valid anymore when you change the problem of the
copy afterwards, e.g., by changing objective coefficients. So you have
to be careful about that, too, and somehow reset everything to the
initial values. This is what is done when freeing the transformed
problem, but then you loose the constraints added during the solving
process for the same reason: SCIP does not know whether they are
globally valid or just valid because of other information found during
the solving process.

@Stephen: You also need to use SCIPfreeTransform(), which means that all
the solving data is thrown away. This is done because by changing the
problem, dual and especially primal bounds are changed and it might be
that some nodes were cut off that now need to be considered. There is
currently no way to keep the already created variables, what you could
do is store them in your pricer and then create them all when starting
to solve the modified problem.
Again, you can alternatively copy the global problem (don't forget to
set the flag that enables pricing). In your case, this might be a good
solution, because the constraints that contain priced variables should
be marked modifiable and thus were probably not changed during the
solving process, you just have to ensure that the variable's bounds are
reset.

Best,
Gerald

Am 06.12.2012 09:44, schrieb Rostislav Stanek:
> Hello Steve,
>
> I had the same problem. You can use
>
> SCIP_CALL_EXC(SCIPfreeTransform(scip));
>
> to get back to the starting point. Than you can add new constraints and 
> solve the problem again.
>
> But this works well only if no constraints had been added during the 
> solving process (e.g. by an event handler). I don't know how to solve it 
> in the other case - actually I am still looking for a solution (without 
> success).
>
> Best regards
>
> Rostislav
>
>
>
>
> Dne 6.12.2012 06:10, Stephen J Maher napsal(a):
>> Hi all,
>>
>> I am solving a problem using column generation and I would like modify
>> the problem once an optimal solution is found. I would like to add a set
>> of constraints to the problem and then solve this updated problem. The
>> problem will always remain feasible with the added constraints, but the
>> objective value will change.
>>
>> I am not too sure of the best way to implement this. Any help would be
>> appreciated.
>>
>> Thank you,
>>
>> Steve
> _______________________________________________
> Scip mailing list
> Scip at zib.de
> http://listserv.zib.de/mailman/listinfo/scip



More information about the Scip mailing list