Skip to main content

How to use MIPSOL_SOL in gurobipy callback to write solutions meeting certain criteria

Answered

Comments

1 comment

  • Riley Clement
    Gurobi Staff Gurobi Staff

    Hi Taner,

    I don't think Model.write can be used in this way to write a solution from within the callback.

    Can I suggest casting the solution values to a numpy array and then using numpy.save.

    As of Gurobi v11, any callable python object can be used as the callback argument to Model.optimize, so the lambda approach should be unnecessary unless you are using an older version of Gurobi.  See tsp.py

    - Riley

    0

Please sign in to leave a comment.