Skip to main content

Obtain the current optimization result of Gurobi under jupyter-notebook

Answered

Comments

4 comments

  • Riley Clement
    Gurobi Staff Gurobi Staff

    Hi Di,

    Jupyter Notebooks have different implementations, depending on where they are hosted, but typically there should be an "interrupt" or "stop" button in the interface.


    If you use this then Gurobi will stop at the next available point (it may not be immediate).  You can then query the solution and objective value as per usual.

    - Riley

    0
  • Di Lv
    First Question
    First Comment

    Thank you very much! I have clicked the "interrupt" button, but it doesn't react for a while(about 5 minutes). And the jupyter is still running (with *) on the left. Is this normal?

    0
  • Marika Karbstein
    Gurobi Staff Gurobi Staff

    I have the same experience. And I did not find any solution for this.
    For me, the only option is to set termination parameters in the code when running Gurobi in Jupyter notebook, i.e., set TimeLimit and/or MIPGap.

    0
  • Riley Clement
    Gurobi Staff Gurobi Staff

    Note that this is not Gurobi specific - failure to reliably interrupt the Jupyter kernel is a long standing issue:
    https://github.com/ipython/ipython/issues/3400

    0

Please sign in to leave a comment.