Scaling issue
Dear All, while solving a problem I got this message

Optimal solution found, but with infeasibilities after unscaling.
Simplex iterations after crossover:  2205

Objective :      189480.108883

I checked the internet, and it says one useful remedy is to turn scaling off, then invoke the appropriate simplex method for which the basis remains feasible.
Please kindly let me know if this is the remedy and if so, in which file this scaling option is available and I can turn it off. Please let me know how can I tackle this in VEDA
Hi Anjana,

This issue often occurs when the right hand side of a constraint is smaller than the feasibility tolerance of the solver, or the coefficient of a variable cannot be calculated within the precision of the CPU (e.g. coefficients such as 1/3,  0.1, 0.01, etc. can cause accuracy problems and numerical instability see .  So, one remedy is to avoid having coefficients of variables that can result accuracy problems, if possible. 

Regarding the constraint tolerances: By default, the CPLEX solver satisfies a constraint with a precision of 1e-06. This is controlled via the cplex option "eprhs"  (see ). The following can be used to mitigate this effect, by assuming that you know how to set the CPLEX options in the cplex.opt file (otherwise, please look first here

1. Use the option datacheck=2 (see to get from CPLEX a report regarding equations with right hand sides less than eprhs, as well as coefficients of variables that can cause numerical instability. The report is displayed in the command prompt, just after the CPLEX solver starts, by solving the model as usual.

2. Use the above information to alter the input data in the model, so that to ensure that right hand sides are lower than the eprhs tolerance, e.g. in the order of 1e-05. Also, use the report to correct variable coefficients that can cause accuracy issues. Repeat steps 1 and 2 until you get only a few messages from CPLEX regarding the violation of tolerances and problematic variable coefficients.

3. If the problem still persists, then increase the eprhs tolerance,e.g. 1e-09. This will risk that the solver reports the problem as infeasible, which is not so bad since it will indicate the constraint(s) that cannot be satisfied. To identify the constraint in an infeasible problem, you can use the option feasopt ( This would also require to set in advance the GAMS statement, OPTION SOLPRINT=ON;  in the beginning of the run template file. The infeasible constraints are then reported in the .lst file (please look here if you do not know how to find in the .lst file infeasible constraints , the infeasible EQU constraints will be indicated by an INFES on the right side of the report) 

4. By using the feasopt and the identified constraints try to modify the data of the model so that to make it feasible, by repeating steps 3 and 4.

5. If the problem still persists, then you may instruct CPLEX to solve the model with higher accuracy, if possible. This would need to use the options: scaind 1 (see, numericalemphasis 1 (see, and increase the Markowitz pivot tolerance epmrk to a value higher than 0.01, e.g. 0.9 (see All these three options, scaind, numericalemphasis and epmrk, can also be used simultaneously. However, they tend to increase the solution time.

6. Other options, but applicable only when one uses the CPLEX/Barrier algorithm for solving the model, is to change the number of the dense columns reported during the solution phase of the model. If too many columns are eliminated then the Barrier solver can run into numerical instabilities. To control the number of the dense columns you may alter the option barcolnz (see One can also try to change the Barrier algorithm, via the option baralg (see , or change the starting point heuristic via barstartalg (see You may also look at this presentation regarding the use and effect of some Barrier options 

I hope the above help a bit. The remedy needs quite a lot of trial and error, depending on the severity of the problem. The above steps can also be applied when one gets the message "Solution available but not proven optimal due to numerical difficulties". 

For more information on numerical difficulties and possible ways to deal with them, you may also find at: and in .

Forum Jump:

Users browsing this thread: 1 Guest(s)