Dual of models by CPLEX

心不动则不痛 提交于 2019-12-12 04:06:41

问题


I have an essential problem. I use Cplex in C++ and I try to implement my optimization programs by it; however, I have an essential problem.

I want to find dual of my program. How can I find some constructs in Cplex for C++ that do it?


回答1:


I'm not entirely sure if this is what you're asking for, but the presolve dual setting (quoting the documentation):

Decides whether CPLEX presolve should pass the primal or dual linear programming problem to the linear programming optimization algorithm.

With the C++ API, this can be set, like so:

cplex.setParam(IloCplex::Param::Preprocessing::Dual, 1);

Somewhat related is the DUA file 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.)

If, on the other hand, you want to query dual values after solving a model, you can use the getDuals method.



来源:https://stackoverflow.com/questions/45561059/dual-of-models-by-cplex

标签
易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!