but in cplex optimizer

1 view (last 30 days)
Standardtrickyness
Standardtrickyness on 18 Oct 2015
Edited: Torsten on 20 Oct 2015
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 Comment
Torsten
Torsten on 19 Oct 2015
Did you check cplexmilp's exitflag in both cases ?
Best wishes
Torsten.

Sign in to comment.

Answers (2)

Steven Lord
Steven Lord on 18 Oct 2015
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 Comment
Standardtrickyness
Standardtrickyness on 18 Oct 2015
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.

Sign in to comment.


Walter Roberson
Walter Roberson on 19 Oct 2015
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 Comments
Walter Roberson
Walter Roberson on 20 Oct 2015
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 on 20 Oct 2015
Edited: Torsten on 20 Oct 2015
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.

Sign in to comment.

Categories

Find more on Introduction to Installation and Licensing in Help Center and File Exchange

Community Treasure Hunt

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

Start Hunting!