CPLEX降低了MIP的成本?

问题描述 投票:2回答:1

我正在使用CPLEX解决MIP问题。解决之后,我希望降低成本。我知道MIP不存在降低成本的事实,所以我做了以下事情:

     int type = CPXgetprobtype(env, lp);
     if(CPXchgprobtype(env, lp, CPXPROB_FIXEDMILP)) abort();
     if(CPXlpopt(env,lp)) abort();
     int blabla; double blublu;
     if(CPXsolution (env, lp, &blabla , &blublu , x, pi, slack, dj)) abort();
     for (int i = 0; i < CPXgetnumcols(env,lp); i++) {
        printf("v%d = %f, ", i,dj[i]);
        if ((i+1) % 10 == 0) printf("\n");
     }
     if(CPXchgprobtype(env, lp, type)) abort();

当我打印数组dj时,它全是0。我也尝试使用CPXgetdj而不是CPXsolution,结果相同。

阅读this后,我相信我所做的是正确的。但它似乎没有用。我的问题有20000个变量,我尝试了一堆它们总是说0 ...

我有一个小的时间限制,所以它不能证明最优(但它确实找到了一个整数解决方案),我不确定这是否重要。

谢谢

optimization mathematical-optimization cplex integer-programming
1个回答
1
投票

考虑一般线性问题P,其中所有变量都固定在给定整数问题I的整数最优解的值处。设P为

enter image description here

其中带符号的bj是最优整数解中xj的值。 P的双重问题D是

enter image description here

可以找到成本的D(D)= z(P)= z(I)的D的最优解

enter image description here

因此降低了成本

enter image description here

© www.soinside.com 2019 - 2024. All rights reserved.