如何使用 java 从 Cplex 导出双模型?
How can I export dual model from Cplex using java?
我知道我们可以使用 exportmodel 从 java 中的 cplex 导出模型公式。但是我们可以对双重公式做同样的事情吗?
谢谢。
使用interactive, you can export to the DUA文件格式(注意在JavaAPI中使用exportModel
方法是不可能的)。以下是相关信息:
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.)
因此,您可以导出为 Java API 中支持的文件格式之一(例如 .sav、.mps、.lp),然后使用交互式生成.dua 文件,像这样:
CPLEX> read file.lp
CPLEX> write file.dua
如上所述,您还可以使用presolve dual setting到"pass the primal or dual linear programming problem to the linear programming optimization algorithm."
我知道我们可以使用 exportmodel 从 java 中的 cplex 导出模型公式。但是我们可以对双重公式做同样的事情吗?
谢谢。
使用interactive, you can export to the DUA文件格式(注意在JavaAPI中使用exportModel
方法是不可能的)。以下是相关信息:
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.)
因此,您可以导出为 Java API 中支持的文件格式之一(例如 .sav、.mps、.lp),然后使用交互式生成.dua 文件,像这样:
CPLEX> read file.lp
CPLEX> write file.dua
如上所述,您还可以使用presolve dual setting到"pass the primal or dual linear programming problem to the linear programming optimization algorithm."