Reputation: 455
I am using Java API of CPLEX optimization software. After the solver finishes the optimization, it prints the solution and the parameters of the LP as well:
MIP Presolve eliminated 282 rows and 230 columns.
Aggregator did 14 substitutions
How to observe these eliminated rows and columns? Is there a built-in function in the API?
Upvotes: 0
Views: 453
Reputation: 4465
You can access the presolved/reduced model with the C API, but you cannot with the Java API or Concert in general. In the Java API there is the PresolveCallback, but this is not so friendly to use (i.e., it is invoked several times during a solve and you don't necessarily know which invocation is the one you want). It may be worth looking at quickly in case it suits your needs.
Another technique of obtaining this information would be to redirect the CPLEX log into your own stream (using the setOut method) and parse out lines that look like "MIP Presolve eliminated XXX rows and XXX columns". You can find examples of this here and here. This is more of a general java programming technique (not really CPLEX related), so I won't attempt to provide more code snippets for that here.
Upvotes: 1