The params argument

As mentioned previously, the Gurobi optimizer provides a set of parameters that allow you to control many of the details of the optimization process. Factors like feasibility and optimality tolerances, choices of algorithms, strategies for exploring the MIP search tree, etc., can be controlled by modifying Gurobi parameters before beginning the optimization.

Parameter changes are specified using a struct variable having multiple fields, which is passed as an argument to the appropriate Gurobi function (e.g., gurobi). The name of each field must be the name of a Gurobi parameter, and the associated value should be the desired value of that parameter. You can find a complete list of the available Gurobi parameters here.

To create a struct that would set the Gurobi Method parameter to 2 and the ResultFile parameter to model.mps, you would do the following:

params.Method = 2;
params.ResultFile = 'model.mps';

We should say a bit more about the ResultFile parameter. If this parameter is set, the optimization model that is eventually passed to Gurobi will also be output to the specified file. The filename suffix should be one of .mps, .lp, .rew, or .rlp, to indicate the desired file format (see the file format section for details on Gurobi file formats).

Try Gurobi for Free

Choose the evaluation license that fits you best, and start working with our Expert Team for technical guidance and support.

Evaluation License
Get a free, full-featured license of the Gurobi Optimizer to experience the performance, support, benchmarking and tuning services we provide as part of our product offering.
Academic License
Gurobi supports the teaching and use of optimization within academic institutions. We offer free, full-featured copies of Gurobi for use in class, and for research.
Cloud Trial

Request free trial hours, so you can see how quickly and easily a model can be solved on the cloud.

Search