How to introspect solver configuation parameters?
AnsweredI am investigating a few things about different Python APIs for Gurobi (the couple of ortools APIs and gurobipy) and would like to figure out why I am seeing some differences. For example I am seeing Gurobipy solve certain problems that are not solved via ortools. It's all Gurobi underneath so this doesn't really make sense, unless some configuration parameters are somehow different. I am not changing any of them myself, but maybe the APIs are? Anyway, I would just like to know how they are configured, by getting some report of what all the configurable parameter values are. But, I can't find any way to do this.
-
Hi Ben,
OR-Tools indeed uses a different parameter configuration than Gurobi. OR-Tools in Python at least changes OptimalityTol, IntFeasTol, and FeasTol to 1e-7, which can increase the computation time. You should also be aware that OR-Tools may process some constraints (e.g., nonlinear constraints) differently and potentially less efficiently than Gurobi.
You can set Gurobi's parameters in OR-Tools via the following command:
str = "# Parameter settings \n ResultFile model.prm" self.solver.SetSolverSpecificParametersAsString(str)This example should change the parameters in such a way that Gurobi also writes a file model.prm to the execution directory containing all Gurobi non-default parameter settings.
0
Please sign in to leave a comment.
Comments
1 comment