MOSEK Options#
ampl: option solver mosek; # change the solver
ampl: option mosek_options 'option1=value1 option2=value2'; # specify options
ampl: solve; # solve the problem
Solver options obtained with $ mosek -=
.
MOSEK Optimizer Options for AMPL
--------------------------------
To set these options, assign a string specifying their values to the AMPL
option "mosek_options". For example:
ampl: option mosek_options 'threads=3';
'' Options:
acc:_all
Solver acceptance level for all constraints and expressions. Value
meaning: as described in the specific acc:... options.
Can be useful to disable all reformulations (acc:_all=2), or force
linearization (acc:_all=0.)
acc:expcone
Solver acceptance level for 'ExponentialConeConstraint' as flat
constraint, default 2:
0 - Not accepted natively, automatic redefinition will be attempted
1 - Accepted but automatic redefinition will be used where possible
2 - Accepted natively and preferred
acc:indeq (acc:indlineq)
Solver acceptance level for 'IndicatorConstraintLinEQ' as flat
constraint, default 2:
0 - Not accepted natively, automatic redefinition will be attempted
1 - Accepted but automatic redefinition will be used where possible
2 - Accepted natively and preferred
acc:indge (acc:indlinge)
Solver acceptance level for 'IndicatorConstraintLinGE' as flat
constraint, default 2:
0 - Not accepted natively, automatic redefinition will be attempted
1 - Accepted but automatic redefinition will be used where possible
2 - Accepted natively and preferred
acc:indle (acc:indlinle)
Solver acceptance level for 'IndicatorConstraintLinLE' as flat
constraint, default 2:
0 - Not accepted natively, automatic redefinition will be attempted
1 - Accepted but automatic redefinition will be used where possible
2 - Accepted natively and preferred
acc:lineq
Solver acceptance level for 'LinConEQ' as flat constraint, default 2:
0 - Not accepted natively, automatic redefinition will be attempted
1 - Accepted but automatic redefinition will be used where possible
2 - Accepted natively and preferred
acc:linge
Solver acceptance level for 'LinConGE' as flat constraint, default 2:
0 - Not accepted natively, automatic redefinition will be attempted
1 - Accepted but automatic redefinition will be used where possible
2 - Accepted natively and preferred
acc:linle
Solver acceptance level for 'LinConLE' as flat constraint, default 2:
0 - Not accepted natively, automatic redefinition will be attempted
1 - Accepted but automatic redefinition will be used where possible
2 - Accepted natively and preferred
acc:linrange (acc:linrng)
Solver acceptance level for 'LinConRange' as flat constraint, default 2:
0 - Not accepted natively, automatic redefinition will be attempted
1 - Accepted but automatic redefinition will be used where possible
2 - Accepted natively and preferred
acc:quadcone
Solver acceptance level for 'QuadraticConeConstraint' as flat
constraint, default 2:
0 - Not accepted natively, automatic redefinition will be attempted
1 - Accepted but automatic redefinition will be used where possible
2 - Accepted natively and preferred
acc:quadeq
Solver acceptance level for 'QuadConEQ' as flat constraint, default 2:
0 - Not accepted natively, automatic redefinition will be attempted
1 - Accepted but automatic redefinition will be used where possible
2 - Accepted natively and preferred
acc:quadge
Solver acceptance level for 'QuadConGE' as flat constraint, default 2:
0 - Not accepted natively, automatic redefinition will be attempted
1 - Accepted but automatic redefinition will be used where possible
2 - Accepted natively and preferred
acc:quadle
Solver acceptance level for 'QuadConLE' as flat constraint, default 2:
0 - Not accepted natively, automatic redefinition will be attempted
1 - Accepted but automatic redefinition will be used where possible
2 - Accepted natively and preferred
acc:quadrange (acc:quadrng)
Solver acceptance level for 'QuadConRange' as flat constraint, default
2:
0 - Not accepted natively, automatic redefinition will be attempted
1 - Accepted but automatic redefinition will be used where possible
2 - Accepted natively and preferred
acc:rotatedquadcone
Solver acceptance level for 'RotatedQuadraticConeConstraint' as flat
constraint, default 2:
0 - Not accepted natively, automatic redefinition will be attempted
1 - Accepted but automatic redefinition will be used where possible
2 - Accepted natively and preferred
alg:basis (basis)
Whether to use or return a basis:
0 - No
1 - Use incoming basis (if provided)
2 - Return final basis
3 - Both (1 + 2 = default)
alg:method (method, lpmethod, simplex)
Which algorithm to use for non-MIP problems or for the root node of MIP
problems:
0 - Optimizer for conic constraints
1 - Dual simplex
2 - Automatic (default)
3 - Free simplex
4 - Interior-point method
5 - Mixed-integer optimizer
6 - Primal simplex
alg:rays (rays)
Whether to return suffix .unbdd (unbounded ray) if the objective is
unbounded or suffix .dunbdd (Farkas dual) if the constraints are
infeasible:
0 - Neither
1 - Just .unbdd
2 - Just .dunbdd
3 - Both (default)
alg:relax (relax)
0*/1: Whether to relax integrality of variables.
alg:sens (sens, solnsens, sensitivity)
Whether to return suffixes for solution sensitivities, i.e., ranges of
values for which the optimal basis remains optimal (note that the
variable and objective values can change):
0 - No (default)
1 - Yes: suffixes returned on variables are
.sensobjlo = smallest objective coefficients
.down = same as .sensobjlo
.sensobj = current objective coefficients
.current = same as .sensobj
.sensobjhi = greatest objective coefficients
.up = same as .sensobjhi
.senslblo = smallest variable lower bounds
.senslbhi = greatest variable lower bounds
.sensublo = smallest variable upper bounds
.sensubhi = greatest variable upper bounds;
suffixes for all constraints are
.senslblo = smallest constraint lower bounds
.senslbhi = greatest constraint lower bounds
.sensublo = smallest constraint upper bounds
.sensubhi = greatest constraint upper bounds;
suffixes for one-sided constraints only:
.sensrhslo = smallest right-hand side values
.down = same as .sensrhslo
.sensrhshi = greatest right-hand side values.
.up = same as .sensrhshi.
The suffixes correspond to the AMPL solver model, command 'solexpand'.
For easiest interpretation, disable AMPL presolve, 'option presolve 0;'
alg:start (warmstart)
Whether to use incoming primal (and dual, for LP) variable values in a
warmstart:
0 - No
1 - Yes (for LP: if there is no incoming alg:basis) (default)
2 - Yes (for LP: ignoring the incoming alg:basis, if any.)
bar:basis (bar:crossover, crossover)
Whether the interior-point optimizer also computes an optimal basis:
0 - Never
1 - Always (default)
2 - If no error detected
3 - If primal and dual feasible
cvt:bigM (cvt:bigm, cvt:mip:bigM, cvt:mip:bigm)
Default value of big-M for linearization of logical constraints. Not
used by default. Use with care (prefer tight bounds). Should be smaller
than (1.0 / [integrality tolerance])
cvt:dvelim (dvelim)
Eliminate AMPL defined variables by substitution into linear, quadratic,
and polynomial expressions:
0 - Do not eliminate, always instantiate the variables.
1 - Eliminate only those used 1x. This can increase model density but
greatly simplifies some models.
2 - Always substitute where possible, even if the variable needs to be
instantiated for use in other places. Can introduce redundancy, but
seems best for some models (default.)
See also cvt:pre:unnest, as well as AMPL options linelim and substout.
cvt:expcones (expcones)
0/1*: Recognize exponential cones.
cvt:mip:eps (cvt:cmp:eps, cmp:eps)
Tolerance for strict comparison of continuous variables for MIP. Applies
to <, >, and != operators. Also applies to negation of conditional
comparisons: b==1 <==> x<=5 means that with b==0, x>=5+eps. Default:
1e-4.
cvt:multoutcard (multoutcard)
Up to which (estimated) QP matrix cardinality should a product of 2
linear expressions be multiplied out. Default 1e9.
Can speed up model input, but prone to numerical issues.
cvt:names (names, modelnames)
Whether to read or generate variable / constraint / objective names:
0 - No names
1 - (Default) Only provide names if at least one of .col / .row name
files was written by AMPL (AMPL: `option [<solver>_]auxfiles rc;`)
2 - Read names from AMPL, but create generic names if not provided
3 - Create generic names.
cvt:plapprox:domain (plapprox:domain, plapproxdomain)
For piecewise-linear approximated functions, both arguments and result
are bounded to +-[pladomain]. Default 1e6.
cvt:plapprox:reltol (plapprox:reltol, plapproxreltol)
Relative tolerance for piecewise-linear approximation. Default 0.01.
cvt:pre:all
0/1*: Set to 0 to disable most presolve in the flat converter.
cvt:pre:ctx2count (ctx2count)
Propagate exact context into atleast/atmost/exactly, count and numberof
expressions, vs mixed. Bitwise OR of the following values:
1 - atleast/atmost/exactly, count
2 - numberof with constant total
4 - numberof with variable total.
Default 0, see #267.
cvt:pre:ctx2ineq (ctx2ineq)
0/1*: Propagate exact context into conditional inequalities, vs mixed.
See #267.
cvt:pre:eqbinary
0/1*: Preprocess reified equality comparison with a binary variable.
cvt:pre:eqresult
0/1*: Preprocess reified equality comparison's decidable cases.
cvt:pre:ineqresult
0/1*: Preprocess reified inequality comparison's decidable cases.
cvt:pre:ineqrhs
0/1*: Preprocess reified inequality comparison's right-hand sides.
cvt:pre:unnest (cvt:unnest, cvt:pre:inline, cvt:inline)
Inline nested expressions. Bitwise OR of the following values:
1 - Ands and Ors
2 - Linear subexpressions
4 - Quadratic subexpressions.
See also option cvt:dvelim concerning only the input model. Default 7.
cvt:prod (cvt:pre:prod)
Product preprocessing flags. Sum of a subset of the following bits:
1 - Quadratize higher-order products in the following order: integer
terms first, then real-valued ones; in each group, smaller-range terms
first.
2 - Logicalize products of 2 binary terms. Logicalizing means that the
product is converted to a conjunction. If the solver does not support it
natively (see acc:and), the conjunction is linearized.
4 - Logicalize products of >=3 binary terms.
Default: 7.
Bits 2 or 4 imply bit 1.
cvt:qp2passes (cvt:qp2pass, qp2passes, qp2pass)
Parse sums of QP expressions in 2 passes. Usually faster. Default 1.
cvt:quadcon (passquadcon)
Convenience option. Set to 0 to disable quadratic constraints. Synonym
for acc:quad..=0. Currently this disables out-multiplication of
quadratic terms, then they are linearized.
cvt:quadobj (passquadobj)
0/1*: Pass quadratic objective terms to the solver. When 0, if the
solver accepts quadratic constraints, such a constraint will be created
with those, otherwise linearly approximated.
cvt:socp (socpmode, socp)
Second-Order Cone recognition mode:
0 - Do not recognize SOCP forms
1 - Recognize from non-quadratic expressions only (sqrt, abs)
2 - Recognize from quadratic and non-quadratic SOCP forms. Helpful if
the solver does not recognize non-standard forms
Recognized SOCP forms can be further converted to (SOCP-standardized)
quadratic constraints, see cvt:socp2qc. Default: 2.
cvt:socp2qc (socp2qcmode, socp2qc)
Mode to convert recognized SOCP forms to SOCP-standardized quadratic
constraints:
0 - Do not convert
1 - Convert if no other cone types found, and not all original
quadratics could be recognized as SOC, in particular if the
objective is quadratic
2 - Always convert
Such conversion can be necessary if the solver does not accept a mix of
conic and quadratic constraints/objectives. Default: 1.
cvt:sos (sos)
0/1*: Whether to honor declared suffixes .sosno and .ref describing SOS
sets. Each distinct nonzero .sosno value designates an SOS set, of type
1 for positive .sosno values and of type 2 for negative values. The .ref
suffix contains corresponding reference values used to order the
variables.
cvt:sos2 (sos2)
0*/1: Whether to honor SOS2 constraints for nonconvex piecewise-linear
terms, using suffixes .sos and .sosref provided by AMPL. Currently under
rework.
cvt:uenc:negctx:max (uenc:negctx:max, uenc:negctx)
If cvt:uenc:ratio applies, max number of constants in comparisons
x==const in negative context (equivalently, x!=const in positive
context) to skip UEnc(x). Default 1.
cvt:uenc:ratio (uenc:ratio)
Min ratio (ub-lb)/Nvalues to skip unary encoding for a variable x, where
Nvalues is the number of constants used in conditional comparisons
x==const. Instead, indicator constraints (or big-Ms) are used, if
uenc:negctx also applies. Default 0.
lim:sol (sollimit, solutionlimit)
Limit the number of feasible MIP solutions found, causing early
termination if exceeded; default -1 (no limit).
lim:time (timelim, timelimit)
Limit on solve time (in seconds; default: no limit).
mip:bestbound (bestbound, return_bound)
Whether to return suffix .bestbound for the best known MIP dual bound on
the objective value:
0 - No (default)
1 - Yes.
The suffix is on the objective and problem and is -Infinity for
minimization problems and +Infinity for maximization problems if there
are no integer variables or if a dual bound is not available.
mip:conic:outapprox (conicoutapprox)
0*/1: If this option is turned on outer approximation is used when
solving relaxations of conic problems; otherwise interior point is used.
mip:constructsol (mipconstructsol)
Sets MSK_IPAR_MIO_CONSTRUCT_SOL. If set to MSK_ON and all integer
variables have been given a value for which a feasible mixed integer
solution exists, then MOSEK generates an initial solution to the mixed
integer problem by fixing all integer values and solving the remaining
problem.Default = OFF
mip:feaspump (feaspump)
MIP feasibility pump.
-1 - Automatic (default)
0 - The Feasibility Pump is disabled
1 - The Feasibility Pump is enabled with an effort to improve solution
quality
2 - The Feasibility Pump is enabled with an effort to reach
feasibility early
mip:feastol (feastol)
MIP feasibility tolerance.
mip:gap (mipgap)
Max. relative MIP optimality gap (default 1e-4).
mip:gapabs (mipgapabs)
Max. absolute MIP optimality gap (default 0.0).
mip:heurlevel (heurlevel)
MIP heuristic level to find an initial good feasible solution.
-1: automatic (default);
0: not used;
positive, larger - more effort (3-5 recommended).
mip:inttol (inttol)
MIP integrality tolerance.
mip:relgapconst (miorelgapconst)
This value is used to compute the relative gap for the solution to an
integer optimization problem.Default = 1.0e-10
mip:return_gap (return_mipgap)
Whether to return mipgap suffixes or include mipgap values (|objectve -
.bestbound|) in the solve_message: sum of
1 - Return .relmipgap suffix (relative to |obj|)
2 - Return .absmipgap suffix (absolute mipgap)
4 - Suppress mipgap values in solve_message.
Default = 0. The suffixes are on the objective and problem. Returned
suffix values are +Infinity if no integer-feasible solution has been
found, in which case no mipgap values are reported in the solve_message.
mip:round (round)
Whether to round integer variables to integral values before returning
the solution, and whether to report that the solver returned noninteger
values for integer values: sum of
1 ==> Round nonintegral integer variables
2 ==> Modify solve_result
4 ==> Modify solve_message
Default = 0. Modifications that were or would be made are reported in
solve_result and solve_message only if the maximum deviation from
integrality exceeded mip:round_reptol.
mip:round_reptol (round_reptol)
Tolerance for reporting rounding of integer variables to integer values;
see "mip:round". Default = 1e-9.
mip:varselection (varselection)
Controls the variable selection strategy employed by the mixed-integer
optimizer:
0 - Automatic (default)
1 - Pseudocost variable selection
2 - Strong branching selection
obj:multi (multiobj)
Whether to use multi-objective optimization:
0 - Single objective, see option obj:no (default)
1 - Multi-objective, solver's native handling if available
2 - Multi-objective, force emulation
When obj:multi>0 and several objectives are present, suffixes
.objpriority, .objweight, .objreltol, and .objabstol on the objectives
are relevant. Objectives with greater .objpriority values (integer
values) have higher priority. Objectives with the same .objpriority are
weighted by .objweight, according to the option obj:multi:weight.
Objectives with positive .objabstol or .objreltol are allowed to be
degraded by lower priority objectives by amounts not exceeding the
.objabstol (absolute) and .objreltol (relative) limits.
Note that with solver's native handling (when obj:multi=1 and
supported), some solvers might have special rules for the tolerances,
especially for LP, and not allow quadratic objectives. See the solver
documentation.
obj:multi:weight (multiobjweight, obj:multi:weights, multiobjweights)
How to interpret each objective's weight sign:
1 - relative to the sense of the 1st objective
2 - relative to its own sense (default)
With the 1st option (legacy behaviour), negative .objweight for
objective i would make objective i's sense the opposite of the model's
1st objective. Otherwise, it would make objective i's sense the opposite
to its sense defined in the model.
obj:no (objno)
Objective to optimize:
0 - None
1 - First (default, if available)
2 - Second (if available), etc.
pre:aggregate (aggregate)
Whether to use aggregation in presolve:
0 - No
1 - Yes (default)
pre:dualray_analysis (dualrayanalysis)
Controls the amount of dual ray analysis employed by the mixed-integer
optimizer:
-1 - Automatic (default)
0 - Disabled
1 - Low amount of analyis
2 - Higher amount of analysis
pre:folding (folding, foldinguse)
Whether to use folding in presolve (for MIP problems use
pre:mipfolding):
0 - Disabled
1 - The solver decides on the usage and amount of folding
2 - If only the interior-point solution is requested then the solver
decides; if the basic solution is requested then folding is disabled
(default)
3 - Full folding is always performed regardless of workload
pre:mipfolding (mipfolding, miosimmetrylevel)
Controls the amount of symmetry detection by the mixed-integer optimizer
in presolve:
-1 - Automatic
0 - Disabled
1 - Low amount
2 - Medium amount
3 - High amount
4 - Extremely high amount
pre:passes (prepasses)
Limit on the number of presolve passes; a negative value implies MOSEK
decides:
-1 - Automatic choice (default)
n>=0 - At most n passes.
pre:scale (scale)
Whether to use scaling in presolve. Applies to both simplex and interior
point method:
0 - Mosek chooses scaling heuristic (default)
1 - No scaling.
pre:solve (presolve)
MIP presolve:
0 - Do not use presolve
1 - Use presolve
2 - Automatic (default)
sol:chk:fail (chk:fail, checkfail)
Fail on MP solution check violations, with solve result 150.
sol:chk:feastol (sol:chk:eps, chk:eps, chk:feastol)
Absolute tolerance to check objective values, variable and constraint
bounds. Default 1e-6.
sol:chk:feastolrel (sol:chk:epsrel, chk:epsrel, chk:feastolrel)
Relative tolerance to check objective values, variable and constraint
bounds. Default 1e-6.
sol:chk:infeas (chk:infeas, checkinfeas)
Check even infeasible solution condidates, whenever solver reports them.
sol:chk:inttol (sol:chk:inteps, sol:inteps, chk:inttol)
Solution checking tolerance for variables' integrality. Default 1e-5.
sol:chk:mode (solcheck, checkmode, chk:mode)
Solution checking mode. Sum of a subset of the following bits:
1 - Check variable bounds and integrality.
2 - Check original model constraints, as well as any non-linear
expression values reported by the solver.
4 - Check intermediate auxiliary constraints (i.e., those which were
reformulated further).
8 - Check final auxiliary constraints sent to solver.
16 - Check objective values.
32, 64, 128, 256, 512 - similar, but non-linear expressions are
recomputed (vs using their values reported by the solver.)
*Experimental.* This is an idealistic check, because it does not
consider possible tolerances applied by the solver when computing
expression values.
Default: 1+2+512.
sol:chk:prec (chk:prec, chk:precision)
AMPL solution_precision option when checking: number of significant
digits.
sol:chk:round (chk:round, chk:rnd)
AMPL solution_round option when checking: round to this number of
decimals after comma (before comma if negative.)
sol:report_uncertain (report_uncertain_sol)
0/1*: whether to report objective value(s) in solve_message when
solve_result is '?' (unknown).
tech:debug (debug)
0*/1: whether to assist testing & debugging, e.g., by outputting
auxiliary information (mostly via suffixes).
tech:logfile (logfile)
Log file name. Note that if outlev is set to 0, there will be no output
written.
tech:optionfile (optionfile, option:file)
Name of an AMPL solver option file to read (surrounded by 'single' or
"double" quotes if the name contains blanks). Lines that start with #
are ignored. Otherwise, each nonempty line should contain "name=value",
e.g., "lim:iter=500".
tech:optionnative (optionnative, optnative, tech:param)
General way to specify values of both documented and undocumented Mosek
parameters; value should be a quoted string (delimited by ' or ")
containing a parameter name, a space, and the value to be assigned to
the parameter. Can appear more than once. Cannot be used to query
current parameter values.
tech:optionnativeread (optionnativeread, tech:param:read, param:read)
Name of Mosek parameter file (surrounded by 'single' or "double" quotes
if the name contains blanks) to be read. File format:
BEGIN MOSEK
MSK_DPAR_MIO_MAX_TIME 3
END MOSEK
Parameter descriptions:
docs.mosek.com/latest/cmdtools/param-groups.html.
tech:optionnativewrite (optionnativewrite, tech:param:write, param:write)
Name of Mosek parameter file (surrounded by 'single' or "double" quotes
if the name contains blanks) to be written.
tech:outlev (outlev)
0*/1: Whether to write mosek log lines to stdout and to the logfile.
tech:outlev_mp (outlev_mp)
0*/1: whether to print MP model information.
tech:seed (seed)
Random number seed (default 42), used for randomization in the
mixed-integer optimizer, may influence the solution path.
tech:threads (threads)
Controls the number of threads employed by the optimizer. Default 0 ==>
number of threads used will be equal to the number of cores detected on
the machine.
tech:timing (timing, tech:report_times, report_times)
0*/1/2: Whether to print and return timings for the run, all times are
wall times. If set to 1, return the solution times in the problem
suffixes 'time_solver', 'time_setup' and 'time', 'time'=
time_solver+time_setup+time_output is a measure of the total time spent
in the solver driver. If set to 2, return more granular times, including
'time_read', 'time_conversion' and 'time_output'.
tech:version (version)
Single-word phrase: report version details before solving the problem.
tech:wantsol (wantsol)
In a stand-alone invocation (no "-AMPL" on the command line), what
solution information to write. Sum of
1 - Write ".sol" file
2 - Primal variables to stdout
4 - Dual variables to stdout
8 - Suppress solution message.
tech:writegraph (cvt:writegraph, writegraph, exportgraph)
File to export conversion graph. Format: JSON Lines.
tech:writemodel (tech:writeprob, writeprob, writemodel, tech:exportfile)
Specifies files where to export the model before solving (repeat the
option for several files.) File name extensions can be ".lp[.7z]",
".mps", etc.
To write a model during iterative solve (e.g., with obj:multi=2), use
tech:writemodel:index.
tech:writemodel:index (tech:writeprob:index, writeprobindex, writemodelindex)
During iterative solve (e.g., with obj:multi=2), the iteration before
which to write solver model. 0 means before iteration is initialized;
positive value - before solving that iteration. Default 0.
tech:writemodelonly (justwriteprob, justwritemodel)
Specifies files where to export the model, no solving (option can be
repeated.) File extensions can be ".dlp", ".mps", etc.