无法在 CPLEX 和 MATLAB 上找到二次规划的相同解
我正在尝试使用 MATLAB(使用quadprog 函数)和 CPLEX 解决以下二次问题。问题是 MATLAB 和 CPLEX 提供了可行的解决方案,但两个解决方案并不匹配。事实上,CPLEX 声称获得的解决方案是最优的,而从客观角度来看,使用 MATLAB 获得的解决方案更好。
Minimize obj= 0.5*(1100*x^2 + 509*y^2 + 33*z^2 + 1060*x*y + 252*y*z + 260*z*x)- 60*x- 36*y - 11*z
Subject to:
-x-y+z <= 10
-x+y-z <= 10
-x+y+z <= 10
x-y-z <= 10
x-y+z <= 10
x+y-z <= 10
x+y+z <= 10
-x-y-z <= 10
x,y and z are real numbers.
In matlab, I got: obj=-3, x=0.0436, y=-0.2670, z=1.1830
In CPLEX, I got: obj=-2.07, x=0.028, y=0.000, z=0.222
我不明白为什么。
我尝试使用 MATLAB 和 CPLEX 解决该问题,但解决方案不匹配。
I'm trying to solve the following quadratic problem with MATLAB (using quadprog function) and CPLEX. The problem is that MATLAB and CPLEX provided feasible solutions but both solutions didn't match. In fact, CPLEX claims that the obtained solution is optimal while the solution obtained with MATLAB is better in terms of objective.
Minimize obj= 0.5*(1100*x^2 + 509*y^2 + 33*z^2 + 1060*x*y + 252*y*z + 260*z*x)- 60*x- 36*y - 11*z
Subject to:
-x-y+z <= 10
-x+y-z <= 10
-x+y+z <= 10
x-y-z <= 10
x-y+z <= 10
x+y-z <= 10
x+y+z <= 10
-x-y-z <= 10
x,y and z are real numbers.
In matlab, I got: obj=-3, x=0.0436, y=-0.2670, z=1.1830
In CPLEX, I got: obj=-2.07, x=0.028, y=0.000, z=0.222
I don't understand why.
I tried to solve the problem with MATLAB and CPLEX but the solutions didn't match.
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
您尝试过哪个 cplex 版本?
编写
我在 OPL CPLEX 中
并得到了 obj -3 ,并且使用 docplex python 我也得到了相同的结果
which cplex version have you tried ?
I wrote
in OPL CPLEX and got obj -3
and with docplex python I also get the same