[SCIP] Re-solving problems with constraint change?

Hailu, Dawit Abiy dawit.hailu at uni-hamburg.de
Fri Oct 29 07:25:59 CEST 2021


Dear Geri,

I hope you have gotten your answer by now, but if you haven't, I would like to give you some more tips.

  1.  Yes there are few ways to update the coefficient of variables in scip.

  *    One is to add a number to the coefficient, "SCIP_CALL(SCIPaddVarObj(scip,var,value))"
  *    Another is to replace the coefficient, "SCIP_CALL(SCIPchgVarObj(scip,var,new_weight))"

2. But I would like you to also be aware that SCIP has different stages and transferring problems and freeing those transforms is a big deal. Otherwise, even if you are able to change the weight once, you won't be able to do it again.

Though it will depend on your code, here is one example. Let's say you're in a loop. The following step worked for me:

for i=1,2,...
      add a value to your coefficient
      transform the problem
      solve it
      free the transform
      transform the problem again before the start of the new loop
      change the variable to the original if you want to
      free the transform

These is a bit complicated, but it just shows you that you can experiment on your code and that there is a way.

Hope it was helpful,

Best regards,
Dawit

________________________________
Von: Scip <scip-bounces at zib.de> im Auftrag von Geri K <gkovacsds at gmail.com>
Gesendet: Mittwoch, 27. Oktober 2021 15:23
An: scip at zib.de
Betreff: [SCIP] Re-solving problems with constraint change?

Dear All,
is it possible with the SCIP C API to call solving again with changed
constraint linear coefficients?
So it would be probably faster than re-creating the whole problem.
I would not change the constraint variables included, only their
coefficients.
I could not find an example or api documentation for this, is it possible
and if yes, what calls are needed?
Thank you,
Geri
_______________________________________________
Scip mailing list
Scip at zib.de
https://listserv.zib.de/mailman/listinfo/scip
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://listserv.zib.de/pipermail/scip/attachments/20211029/8823cf4d/attachment.html>


More information about the Scip mailing list