write level for MST, SOL files

Sets a level of detail for CPLEX to write a file in MST or SOL format.

Purpose

Write level for MST, SOL files

API Parameter Name Name prior to V12.6.0
C CPXPARAM_Output_WriteLevel CPX_PARAM_WRITELEVEL
C++ IloCplex::Param::Output::WriteLevel WriteLevel (int)
Java IloCplex.Param.Output.WriteLevel WriteLevel (int)
.NET Cplex.Param.Output.WriteLevel WriteLevel (int)
OPL not available not available
Python parameters.output.writelevel output.writelevel
MATLAB Cplex.Param.output.writelevel output.writelevel
Interactive output writelevel output writelevel
Identifier 1114 1114

Description

Sets the level of detail for CPLEX to write a solution to a file in SOL format or a MIP start to a file in MST format. CPLEX writes information about a MIP start to a formatted file of type MST with the file extension .mst. CPLEX writes information about a solution to a formatted file of type SOL with the file extension .sol. CPLEX records the write level at which it created a file in that file, so that the file can be read back accurately later.

The default setting of this parameter is 0 (zero) AUTO; that is, let CPLEX decide the level of detail. CPLEX behaves differently, depending on whether the format is SOL or MST and on whether it is writing a solution or MIP start. For SOL files, AUTO resembles level 1 (one): CPLEX writes all variables and their respective values to the file. For MST files, AUTO resembles level 2: CPLEX writes discrete variables and their respective values to the file.

When the value of this parameter is 1 (one), CPLEX writes all variables, both discrete and continuous, with their values.

When the value of this parameter is 2, CPLEX writes values for discrete variables only.

When the value of this parameter is 3, CPLEX writes values of nonzero variables only.

When the value of this parameter is 4, CPLEX writes values of nonzero discrete variables only.

Treatment of nonzeros

With respect to levels 3 and 4, where nonzero values are significant, CPLEX considers a value nonzero if the absolute value is strictly less than 1e-16. In the case of SOL files, CPLEX applies this test to primal and dual variable values, that is, both x and pi variable values. In the case of MST files, CPLEX applies this test only to x values.

Restrictions due to reduced file size

Levels 3 and 4 reduce the size of files, of course. However, this reduced file entails restrictions and may create surprising results when the file is re-used. Levels 3 and 4 are not equivalent to levels 1 and 2. Indeed, if a MIP start does not contain a value for a variable expected at level 3 or 4, then this variable will be fixed to 0 (zero) when that MIP start file is processed. Specifically, at level 3, if the MIP start does not specify a value for a variable of any type, or at level 4, if the MIP start does not specify a value for a discrete variable, such a variable will be fixed to 0 (zero). Consequently, the same MIP start written at level 1 or 2 may produce satisfactory solutions, but the reduced MIP start file, written at level 3 or 4, perhaps does not lead to solutions. This surprising situation arises typically in the case of model changes with the addition of new variables.

Table 1. Values
Value Symbol Meaning
0 AUTO Automatic: let CPLEX decide
1 CPX_WRITELEVEL_ALLVARS CPLEX writes all variables and their values
2 CPX_WRITELEVEL_DISCRETEVARS CPLEX writes only discrete variables and their values
3 CPX_WRITELEVEL_NONZEROVARS CPLEX writes only nonzero variables and their values
4 CPX_WRITELEVEL_NONZERODISCRETEVARS CPLEX writes only nonzero discrete variables and their values