Wiki

Clone wiki

ArchEx / Solver options (CPLEX)

Certain parameters of the MILP solver can be configured by the user (for instance, optimality gap, timeout, verbose level etc.) Configuring them is useful for certain experiments/designs. For example, for debugging one might want to set the amount of information displayed to maximum. For testing it may be necessary to set a timeout or gap to make the solver terminate at a certain moment (e.g., to see if it is able to find any feasible solution within a predefined time).

Actual MILP solver (currently, IBM CPLEX) is configured and called by YALMIP. ArchEx calls YALMIP’s optimize(constraints, cost, options) command to start converting constraints and cost function to solver’s expected input format and starting the solver. In particular, options is an sdpsettings object that stores options for different solvers. Users can create their own sdpsettings objects and set the desired parameters. For example:

#!matlab

% create solver options structure via YALMIP command
options = sdpsettings;
 
% select IBM CPLEX as the solver
options.solver = 'cplex';

options.cplex.threads = 1;
options.cplex.mip.tolerances.mipgap = 0.005;
options.cplex.timelimit = 43200; % 12h
    
options.savesolverinput  = 1;
options.savesolveroutput = 1;
 
% maximum verbose
options.debug        = 1;
options.verbose      = 2;
options.showprogress = 1;
 
options.saveduals = 0;

When the problem object is created, user can type the following to run the solver with the options he configured:

prob.Solve(options)

The options object will be passed to YALMIP’s optimize(…) command. If the used does not specify any options as an argument, then a default set will be applied, depending on the solution strategy selected (“eager” or “lazy”).

Some predefined setups for CPLEX are stored in cplex_options.m file. Every parameter there has a comment that explains its purpose. Please refer to these comments for more information. For quickly creating a solver options object you can type

options = cplex_options(‘lazy’)

The latter will create the sdpsettings object and set the required parameters for the iterative (lazy) solution strategy.

You can modify the cplex_options.m file by adjusting existing options groups or creating new ones. Existing parameters can be known by typing

help sdpsettings

One can also check out YALMIP and/or CPLEX (or other solver’s) website to find more details about configurations. Also it is possible to create an sdpsettings object and go through its properties to find out more.

Updated