Help with incumbent
回答済みHello everybody.
Is there any command to know how much time did Gurobi spend finding the first feasible solution for a MILP?
Thank you very much.
Alejandro
0
-
正式なコメント
This post is more than three years old. Some information may not be up to date. For current information, please check the Gurobi Documentation or Knowledge Base. If you need more help, please create a new post in the community forum, or try Gurobot, our chatbot interface offering instant, expert-level support. -
Hi Alejandro,
There is no built-in method or attribute to get this information, but it can be obtained with callbacks.
One example code might looks something like
import gurobipy as gp
from gurobipy import GRB
def mycallback(model,where):
if where == GRB.Callback.MIP:
solcnt = model.cbGet(GRB.Callback.MIP_SOLCNT)
if solcnt == 1:
runtime = model.cbGet(GRB.Callback.RUNTIME)
print("Found first incumbent after %f seconds."%(runtime))
m = gp.read("myLP.lp")
m.optimize(mycallback)Best regards,
Jaromił0 -
Thank you!
0
投稿コメントは受け付けていません。
コメント
3件のコメント