如何使用java从Cplex导出双模型? [英] How can I export dual model from Cplex using java?

查看:193
本文介绍了如何使用java从Cplex导出双模型?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我知道我们可以使用exportmodel从java中导出cplex中的模型公式。但我们可以对双重表述做同样的事情吗?

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

谢谢。

推荐答案

使用互动,您可以导出到 DUA 文件格式(请注意,使用Java API中的 exportModel 方法无法实现)。以下是相关信息:

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:


格式,受MPS约定的约束,写出当前在内存中的问题的双重表述,以便MPS文件之后可以回读,然后可以明确优化双重配方。此文件格式现在基本上已过时,因为您可以在Interactive Optimizer中使用命令 set presolve dual 来告诉CPLEX自动解决LP的双重公式。 (您不必再告诉CPLEX将双重公式写入DUA文件,然后告诉CPLEX重新读取文件并解决它。)

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文件,如下所示:

So, you can export to one of the supported file formats in the Java API (e.g., .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."

这篇关于如何使用java从Cplex导出双模型?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆