SOS2 in convex piecewise linear constraint
回答済みHello!
In my model, I use a convex piecewise linear function in a constraint with mod.addGenConstrPWL. Due to the function's convexity, the SOS2 constraints are not needed, and I would like my model to be solved without the SOS2 constraints as I predict that the computation time will be smaller without these extra constraints that are not necessary. How can I avoid the inclusion of the SOS2 constraints when I use mod.addGenConstrPWL?
Further, are there benefits in using Gurobis mod.addGenConstrPWL compared to modelling the piecewise linear constraints "by hand"?
Happy for any insights :)
-
Hi Christin,
How can I avoid the inclusion of the SOS2 constraints when I use mod.addGenConstrPWL?
Currently, there is no way to avoid the introduction of the SOS2 constraint as it is added by default. You are right that due to the convexity of the PWL function, it would not be needed. This case is on our radar and part of the future roadmap. For now, if you know that your PWL constraint is convex, you should implement it "by hand".
Further, are there benefits in using Gurobis mod.addGenConstrPWL compared to modelling the piecewise linear constraints "by hand"?
The main benefit is the convenience factor. There are also other smaller benefits like possible better presolve reductions but these rarely have a huge impact on the solution process. In general, you could implement the PWL function yourself and the solver behavior should be more or less the same.
Best regards,
Jaromił0
サインインしてコメントを残してください。
コメント
1件のコメント