Skip to main content

PWL constraints efficiency

Answered

Comments

3 comments

  • Jaromił Najman
    Gurobi Staff Gurobi Staff

    It highly depends on the complexity of the PWL functions you use. In general, one can say that using PWL formulations to approximate nonlinear makes the final MIP problem harder. Thus, it is expected that when you add multiple hundreds of PWL constraints, that the model gets harder and harder to solve. Note that each breakpoint adds at least one binary variable to the model.

    Are you approximating some specific functions? Do these functions have a common structure which you might exploit?

    Best regards, 
    Jaromił

    0
  • Andre Pistoletov
    Gurobi-versary
    First Question
    First Comment

    Hi Jaromił Najman. Thank you for the reply!

    In general all PWL constraints are divided between 1-5 functions. These functions look like so:

     

    0
  • Jaromił Najman
    Gurobi Staff Gurobi Staff

    Hi Andre,

    The upper functions are nonconvex functions explaining the increase in complexity. From a modeling point of view, you could try using less breakpoints on the right side of the functions where they tend to be flat. Reducing the number of breakpoints might results in a performance boost.

    The lower functions look like they could be modeled via concave quadratic functions. You could use quadratic terms instead of a PWL approximation which might again improve performance.

    In general, you could pick a smaller version of your model which takes ~5 - 10 minutes to solve and use Gurobi's automatic tuning tool to find parameters which might improve performance. I would run the tuner for 1 - 2 days and see whether it was able to find some parameters to improve your model's performance.

    Best regards, 
    Jaromił

    0

Please sign in to leave a comment.