필터 지우기
필터 지우기

but in cplex optimizer

조회 수: 4 (최근 30일)
Standardtrickyness
Standardtrickyness 2015년 10월 18일
편집: Torsten 2015년 10월 20일
Something really weird is going on in the cplex optimizer.
When I run
Trial>> w2 = cplexmilp(-f,D,b2,[],[],[],[],[],[],[],ctype);
Trial>> f2'*w2
ans =
0.4998
Trial>> w2 = cplexmilp(-f2,D,b2,[],[],[],[],[],[],[],ctype);
Trial>> f2'*w2
ans =
9.1000e-04
When I use a different objective function f it gives me a better solution for f2.
  댓글 수: 1
Torsten
Torsten 2015년 10월 19일
Did you check cplexmilp's exitflag in both cases ?
Best wishes
Torsten.

댓글을 달려면 로그인하십시오.

답변 (2개)

Steven Lord
Steven Lord 2015년 10월 18일
It looks like you're comparing apples and oranges. In your first call, your first input is f but you're computing f2'*w2. In your second call, you're using f2 both as the input and in the computation of the quantity you're using for comparison.
  댓글 수: 1
Standardtrickyness
Standardtrickyness 2015년 10월 18일
My point is that somehow minimizing -f*w2 gives a lower value of -f2*w2 than minimizing -f2*w2 directly this is clearly a bug in cplex.

댓글을 달려면 로그인하십시오.


Walter Roberson
Walter Roberson 2015년 10월 19일
Mathworks has no built-in CPLEX .
Bugs (if they are bugs) in CPLEX are not under the control of Mathworks.
However, I have no reason to believe the output is an error. Consider that provided all constraints where met, I could pass copies of -inf in as the objective function; the output could well be -inf and the multiplication of that with w2 would produce -inf, a smaller value than what you got so far. If you put in different column vectors then you get different outputs, and that is to be expected.
  댓글 수: 5
Walter Roberson
Walter Roberson 2015년 10월 20일
cplexmilp is, I would remind you, a function that is not provided by Mathworks and is not part of the File Exchange. We do not even know what the parameters mean unless you describe them.
For example it would be entirely possible (and common!) in constrained optimization for there to be a linear constraint that did not treat the elements of the vector equally, such that for the w2 produced for -f2 does not match the same boundaries implied by -f . For example f and f2 might have 0s in different places, and those values might be multiplied by vector components towards a constrained sum; with the 0s being present, a result that is valid or meaningful for -f might not be valid for -f2 because the 0s implied that different components should be ignored.
Torsten
Torsten 2015년 10월 20일
편집: Torsten 2015년 10월 20일
I must admit I don't understand your reasoning.
The call
w2 = cplexmilp(-f2,D,b2,[],[],[],[],[],[],[],ctype);
should give a vector w2 such that
f2'*w <= f2'*w2
for all feasable vectors w.
But
w1 = cplexmilp(-f,D,b2,[],[],[],[],[],[],[],ctype);
with a different objective function f (which does not matter in this case), but with the same constraints, gives a vector w1 with
f2'*w1 > f2'*w2
which should not be possible.
As already mentionned, I suggest that the OP checks the exitflags of cplexmilp in both cases.
Or maybe there are local maxima because of integer programming.
Best wishes
Torsten.

댓글을 달려면 로그인하십시오.

카테고리

Help CenterFile Exchange에서 Introduction to Installation and Licensing에 대해 자세히 알아보기

Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!

Translated by