IBM Support

Histogram of coefficients in problem data vectors

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

ilohistogram.cpp

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.

[{"Product":{"code":"SSSA5P","label":"IBM ILOG CPLEX Optimization Studio"},"Business Unit":{"code":"BU059","label":"IBM Software w\/o TPS"},"Component":"Debugging","Platform":[{"code":"PF025","label":"Platform Independent"}],"Version":"9.2;9.1.3;9.1.2;9.1;9.0;8.1;8.0;7.5;7.1;7.0;6.6;12.3;12.2;12.1;12.0;11.2.1;11.2;11.1.1;11.1;11.0.1;11.0;10.3;10.2.1;10.2;10.1.1;10.1;10.0","Edition":"All Editions","Line of Business":{"code":"LOB10","label":"Data and AI"}},{"Product":{"code":"SSSA5P","label":"IBM ILOG CPLEX Optimization Studio"},"Business Unit":{"code":"BU059","label":"IBM Software w\/o TPS"},"Component":"General","Platform":[{"code":"PF002","label":"AIX"},{"code":"PF010","label":"HP-UX"},{"code":"PF016","label":"Linux"},{"code":"PF027","label":"Solaris"},{"code":"PF033","label":"Windows"},{"code":"PF017","label":"Mac OS"}],"Version":"12.2","Edition":"All Editions","Line of Business":{"code":"LOB10","label":"Data and AI"}}]

Historical Number

cplex/Sample/184

Document Information

Modified date:
16 June 2018

UID

swg21400100