this is a function which returns user specified CPLEX control parameters. It is not necessary to use a file like this if you want to use CPLEX default control parameters. It is intended to be a template for individual users to save with their own problem specific settings for CPLEX.
0001 function cpxControl=CPLEXParamSet 0002 %this is a function which returns user specified CPLEX control 0003 %parameters. It is not necessary to use a file like this if you want to use 0004 %CPLEX default control parameters. It is intended to be a template for 0005 %individual users to save with their own problem specific settings for 0006 %CPLEX. 0007 0008 % %e.g. 0009 % (1) Paddy saves this file as CPLEXParamSetPaddyLPJob1 0010 % (2) Paddy edits CPLEXParamSetPaddyLPJob1 in a problem specific way 0011 % (3) Paddy then passes the name of this file to solveCobraLP_CPLEX using something like: 0012 % [solution,LPProblem]=solveCobraLP_CPLEX(LPProblem,[],[],[],'CPLEXParamSetPaddyLPJob1'); 0013 0014 % CPLEX consists of 4 different LP solvers which can be used to solve sysbio LP problems 0015 % you can control which of the solvers, e.g. simplex or interior point solve using the 0016 % CPLEX control parameter cpxControl.LPMETHOD 0017 0018 %Ronan Fleming 10th June 2008 0019 0020 %SELECT CPLEX CONTROL PARAMETERS (alphabetical order) 0021 % Description: Preprocessing aggregator application limit. Invokes the aggregator to use substitution where 0022 % possible to reduce the number of rows and columns before the problem is solved. If set to a positive value, the 0023 % aggregator is applied the specified number of times or until no more reductions are possible. 0024 % -1 Automatic 0025 % 0 Do not use any aggregator 0026 % 1 Use aggregator 0027 % Default: -1 0028 cpxControl.AGGIND=-1; 0029 0030 %Description: Barrier column nonzeros. 0031 % Used in the recognition of dense columns. If columns in the presolved and aggregated problem exist with more 0032 % entries than this value, such columns are considered dense and are treated specially by the CPLEX Barrier 0033 % Optimizer to reduce their effect. If the problem contains fewer than 400 rows, dense column handling is NOT 0034 % initiated. 0035 cpxControl.BARCOLNZ=0; 0036 0037 % Convergence tolerance for LP and QP problems. 0038 % Sets the tolerance on complementarity for convergence. 0039 % The barrier algorithm terminates with an optimal solution if the relative complementarity is 0040 % smaller than this value. Changing this tolerance to a smaller value may result in greater numerical precision 0041 % of the solution, but also increases the chance of a convergence failure in the algorithm and consequently may 0042 % result in no solution at all. Therefore, caution is advised in deviating from the default setting. 0043 %Any positive number >= 1e?12 0044 %Default: 1e?8 0045 cpxControl.BAREPCOMP=1e-8; 0046 0047 % Barrier iteration limit. 0048 % Sets the number of Barrier iterations before termination. When set to 0, no Barrier iterations occur, but problem 0049 % ”setup” occurs and information about the setup is displayed (such as Cholesky factorization information). 0050 % 0 No Barrier iterations 0051 % or, any positive integer 0052 % Default: Large (varies by computer) 0053 cpxControl.BARITLIM=2000; %%% 0054 0055 % Barrier maximum correction limit. 0056 % Sets the maximum number of centering corrections done on each iteration. An explicit value greater than 0 0057 % may improve the numerical performance of the algorithm at the expense of computation time. 0058 % -1 Automatically determined 0059 % 0 None 0060 % or, any positive integer 0061 cpxControl.BARMAXCOR=-1; 0062 0063 % Barrier objective range. 0064 % Sets the maximum absolute value of the objective function. The barrier algorithm looks at this limit to detect 0065 % unbounded problems. 0066 %Any positive number default 1e21 0067 cpxControl.BAROBJRNG=1e21; 0068 0069 % Coefficient reduction setting. 0070 % Determines how coefficient reduction is used. Coefficient reduction improves the objective value of the initial 0071 % (and subsequent) LP relaxations solved during branch & cut by reducing the number of non-integral vertices. 0072 % 0 Do not use coefficient reduction 0073 % 1 Reduce only to integral coefficients 0074 % 2 Reduce all potential coefficients 0075 % Default: 2 0076 cpxControl.COEREDIND=2; 0077 0078 % Lower cutoff. 0079 % When the problem is a maximization problem, the LOWERCUTOFF parameter is used to cut off any nodes 0080 % that have an objective value below the lower cutoff value. On a continued mixed integer optimization, the 0081 % larger of these values and the updated cutoff found during optimization are used during the next mixed integer 0082 % optimization. A too-restrictive value for the LOWERCUTOFF parameter may result in no integer solutions 0083 % being found. 0084 cpxControl.CUTLO=-1e76; 0085 0086 % Data consistency checking indicator. 0087 % When set to 1 (On), extensive checking is performed on data in the array arguments, such as checking that 0088 % indices are within range, that there are no duplicate entries and that values are valid for the type of data or are 0089 % valid numbers. This is useful for debugging applications. 0090 % default =1 0091 cpxControl.DATACHECK=1; %%%% 0092 0093 0094 % Description: Markowitz tolerance. 0095 % Influences pivot selection during basis factorization. Increasing the Markowitz threshold may improve the 0096 % numerical properties of the solution. 0097 % Any number from 0.0001 to 0.99999 0098 % Default: 0.01 0099 cpxControl.EPMRK =0.01; 0100 0101 % Optimality tolerance. 0102 % Influences the reduced-cost tolerance for optimality. This parameter governs how closely CPLEX must approach 0103 % the theoretically optimal solution. 0104 % Any number from 10?9 to 10?1 0105 % Default: 10^-6 0106 cpxControl.EPOPT=1e-6; 0107 0108 % Perturbation constant. 0109 % Sets the amount by which CPLEX perturbs the upper and lower bounds on the variables when a problem is 0110 % perturbed. This parameter can be set to a smaller value if the default value creates too large a change in the 0111 % problem. 0112 % Any positive number 10?8 0113 % Default: 10?6 0114 cpxControl.EPPER=1e-6; 0115 0116 % FeasOpt tolerance. 0117 % Sets epsilon used to measure relaxation in FeasOpt. 0118 % Any positive number 0119 cpxControl.EPRELAX=1e-6; 0120 0121 % Feasibility tolerance. 0122 % The feasibility tolerance specifies the degree to which a problem’s basic variables may violate their bounds. 0123 % FEASIBILITY influences the selection of an optimal basis and can be reset to a higher value when a problem 0124 % is having difficulty maintaining feasibility during optimization. You may also wish to lower this tolerance after 0125 % finding an optimal solution if there is any doubt that the solution is truly optimal. If the feasibility tolerance is 0126 % set too low, CPLEX may falsely conclude that a problem is infeasible. If you encounter reports of infeasibility 0127 % during Phase II of the optimization, a small adjustment in the feasibility tolerance may improve performance. 0128 % Any number from 10?9 to 10?1 0129 % Default: 10?6 0130 cpxControl.EPRHS=1e-6; 0131 0132 %FeasOpt settings. 0133 % FeasOpt works in two phases. In its first phase, it attempts to minimize its relaxation of the infeasible model. 0134 % That is, it attempts to find a feasible solution that requires minimal change. In its second phase, it finds an 0135 % optimal solution among those that require only as much relaxation as it found necessary in the first phase. 0136 % 0 Minimize the sum of all required relaxations 0137 % in first phase only 0138 % 1 Minimize the sum of all required relaxations 0139 % in first phase and execute second phase to 0140 % find optimum among minimal relaxations 0141 % 2 Minimize the number of constraints and 0142 % bounds requiring relaxation in first phase 0143 % only 0144 % 3 Minimize the number of constraints and 0145 % bounds requiring relaxation in first phase and 0146 % execute second phase to find optimum among 0147 % minimal relaxations 0148 % 4 Minimize the sum of squares of required 0149 % relaxations in first phase only 0150 % 5 Minimize the sum of squares of required 0151 % relaxations in first phase and execute second 0152 % phase to find optimum among minimal relaxations 0153 % Default: 0 0154 cpxControl.FEASOPTMODE=0; 0155 0156 % Simplex maximum iteration limit. 0157 % Sets the maximum number of iterations to be performed before the algorithm terminates without reaching 0158 % optimality. 0159 % default = Large e.g. 5000 0160 cpxControl.ITLIM=5000; %%%Changed 0161 0162 % Method for linear optimization. 0163 % Determines which algorithm is used. Currently, the behavior of the Automatic setting is that CPLEX almost 0164 % always invokes the dual simplex method. The one exception is when solving the relaxation of an MILP model 0165 % when multiple threads have been requested. In this case, the Automatic setting will use the concurrent optimization 0166 % method. The Automatic setting may be expanded in the future so that CPLEX chooses the method 0167 % based on additional problem characteristics. 0168 % 0 Automatic 0169 % 1 Primal Simplex 0170 % 2 Dual Simplex 0171 % 3 Network Simplex (Does not work for almost all stoichiometric matrices) 0172 % 4 Barrier (Interior point method) 0173 % 5 Sifting 0174 % 6 Concurrent Dual, Barrier and Primal 0175 % Default: 0 0176 cpxControl.LPMETHOD=0; %%% was changed now default 0177 0178 % Numerical emphasis. 0179 % 0 Off: Do not emphasize extreme caution in 0180 % computation 0181 % 1 On: Emphasize extreme caution in computation 0182 % Default: Off 0183 cpxControl.NUMERICALEMPHASIS=0; %%% Changed 0184 0185 0186 % Polishing best solution. 0187 % Regulates the amount of time spent on polishing the best solution found. During solution polishing, CPLEX 0188 % applies its effort to improve the best feasible solution. Polishing can yield better solutions in some situations. 0189 % The default value of the polishing time parameter is 0 (zero); that is, spend no time polishing. 0190 % Any positive number in seconds 0191 % Default: 0 0192 cpxControl.POLISHTIME=0; %%% Changed 0193 0194 % Scale parameter. 0195 % Sets the method to be used for scaling the problem matrix. 0196 % -1 No scaling 0197 % 0 Equilibrium scaling method 0198 % 1 More aggressive scaling 0199 % Default: 0 0200 cpxControl.SCAIND=0; %%% 0201 0202 % Simplex iteration display information. 0203 % Determines how often CPLEX reports during simplex optimization. 0204 % 0 No iteration messages until solution 0205 % 1 Iteration info after each refactorization 0206 % 2 Iteration info for each iteration 0207 % Default: 1 0208 cpxControl.SIMDISPLAY=1; %%% 0209 0210 % Computation time reporting. 0211 % Determines how computation times are measured. 0212 % 1 CPU time 0213 % 2 Wall clock time (total physical time elapsed) 0214 % Default: 1 0215 cpxControl.CLOCKTYPE=1; %Changed 0216 0217 % Global time limit. 0218 % Sets the maximum time, in seconds, for computations before termination, as measured according to the setting 0219 % of the CLOCKTYPE parameter. The time limit applies to primal simplex, dual simplex, barrier, and mixed 0220 % integer optimizations, as well as infeasibility finder computations. (Network simplex and barrier crossover 0221 % operations are exceptions; these processes do not terminate if the time limit is exceeded.) The time limit 0222 % includes preprocessing time. For ‘hybrid’ optimizations (such as network optimization followed by dual or 0223 % primal simplex, barrier optimization followed by crossover), the 0224 % cumulative time applies. 0225 cpxControl.TILIM=600;%sec 0226