0

I am trying to solve an optimization problem in pyomo by using gurobipy. Given the size of the problem, I would like to set a time limit of 100 seconds as a termination criterion. Although I specified it in the solver options, as follows, it seems to be completely ignored.

opt = SolverFactory("gurobi", solver_io="python", maxTimeLimit=100)
results = opt.solve(model)
Mike
  • 375
  • 1
  • 4
  • 14

1 Answers1

1

Gurobi's time limit name is TimeLimit, not maxTimeLimit. The time limit is an option that is defined at solve time, not as part of the instantiation of the solver. This is because you may want to solve the same model for a specified amount of time and then resolve for a different amount of time:

opt.solve(model, options={'TimeLimit': 100})
opt.solve(model, options={'TimeLimit': 1000})

See this Gurobi documentation page for the names of the parameters.

ruaridhw
  • 2,305
  • 8
  • 22