简体   繁体   中英

How can I export dual model from Cplex using java?

I know that we can export the model formulation from cplex in java using exportmodel. But can we do the same for dual formulation?

Thanks.

Using the interactive , you can export to the DUA file format (Note that this is not possible using the exportModel method in the Java API). Here is the pertinent information:

format, governed by MPS conventions, writes the dual formulation of a problem currently in memory so that the MPS file can later be read back in and the dual formulation can then be optimized explicitly. This file format is largely obsolete now since you can use the command set presolve dual in the Interactive Optimizer to tell CPLEX to solve the dual formulation of an LP automatically. (You no longer have to tell CPLEX to write the dual formulation to a DUA file and then tell CPLEX to read the file back in and solve it.)

So, you can export to one of the supported file formats in the Java API (eg, .sav, .mps, .lp), and then use the interactive to generate the .dua file, like so:

CPLEX> read file.lp
CPLEX> write file.dua

As mentioned above, you can also use the presolve dual setting to "pass the primal or dual linear programming problem to the linear programming optimization algorithm."

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM