Question & Answer
Question
How can I generate a histogram of coefficients in problem data vectors?
Answer
When diagnosing ill conditioning, you often needs to examine the problem data to identify the source of the trouble. While examining the problem statistics in the CPLEX Interactive Optimizer with the datacheck parameter turned on often suffices, you might need more details in some cases.
This sample application
provides a histogram of the coefficient ranges for the objective (linear and quadratic), right hand side, bounds, and constraint matrix in a model. To run it, just specify the name of the MPS, LP, or SAV file on the command line. Output consists of a count of the number of coefficients in each range based on consecutive powers of 10. For example, consider the following output.
NZ Range Count [10^-1,10^0]: 17 [10^0,10^1]: 66
This indicates the constraint matrix has 83 nonzeroes, 17 of which are in the range [.1,1], and 66 are in the range [1,10].
Signs of potential ill conditioning or numerical instability in the model include
these:
- presence of very large numbers in the ranges;
- presence of very small numbers in the ranges;
- large ratio of greatest to least number.
Historical Number
cplex/Sample/184
Was this topic helpful?
Document Information
Modified date:
16 June 2018
UID
swg21400100