Originally posted by: SystemAdmin
Hi Billy,
just use the .sav format instead of the .lp format. This is a binary file format (i.e., it is not human readable), and it stores the problem data exactly bit by bit. So you are not implicitly reordering columns and rows, and you are also not losing any precision in the floating point numbers (which you do with .lp and .mps formats).
The order of rows and columns makes a difference in the solver's runtime, but it has a pretty random effect. Therefore, there is no algorithm to find a "best" order for a given model. The reason why the order affects the performance is subtle: many decisions in CPLEX are heuristics that rely on results of floating point calculations. For example, the variable selection for branching is something like this:
double bestscore = 0.0;
int bestj = -1;
for (j = 0; j < cols; j++) {
double score = calcBranchScore (j);
if ( score > bestscore ) {
bestj = j;
bestscore = score;
}
}
It happens very often that variables look identical to such a score function and calcBrancScore(j) returns the same value for multiple columns j. Thus, in this loop one would choose the
first column j with maximal score. As a consequence, the order of the column affects the branching choice. And if only a single branching is different, then the number of nodes that need to be processed can change dramatically.
Tobias
#CPLEXOptimizers#DecisionOptimization