Skip to main content

Trouble importing Nonlinear constraints to Gurobi models

Awaiting user input

Comments

3 comments

  • Ronald van der Velden
    Gurobi Staff Gurobi Staff

    Hi Harsh,

    Thanks for posting here! Where exactly does this error occur, can you share a code snippet? It seems to be on the JuMP side so I'm wondering if the error is Gurobi-related or not.

    Kind regards,
    Ronald

    0
  • Harsh Gangwar
    First Question
    First Comment

    Thanks Ronald, for the quick response.

    This error first occurred when I tried integrating Gurobi Optimizer with JuMP models via Gurobi.jl module.

    Later on, to circumvent the problem I tried to serialize my JuMP model to a different format and faced the same error. 

    I would agree that this problem might not be Gurobi related but would appreciate any insight you might have why all the Gurobi recognized formats (.mps, .rew, .lp) have the same limitation. I am able to work with .nl files with other solvers for the same JuMP model.

    Really appreciate your support.

    Sincerely,

    Harsh

     

    0
  • Ronald van der Velden
    Gurobi Staff Gurobi Staff

    Hi Harsh,

    Thanks a lot for the additional background info! Most likely, the reason is the following. Gurobi v11 supports univariate non-linear expressions. Trees of expressions (e.g. z = sin(y + exp(x))) can be constructed by building the expression in steps using multiple constraints. This will improve in a future Gurobi release.

    Because of this, I believe Gurobi.jl does not support non-linear types. One workaround is to use the C API directly as suggested here. Once the Gurobi API for non-linear expressions becomes more flexible, this will also open the door to third-party frameworks to integrate with Gurobi more easily for such expressions.

    Kind regards,
    Ronald

    0

Please sign in to leave a comment.