but in cplex optimizer
3 views (last 30 days)
Show older comments
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
Answers (2)
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.
Walter Roberson
on 19 Oct 2015
Mathworks has no built-in CPLEX .
You appear to be using http://www-01.ibm.com/support/knowledgecenter/SSSA5P_12.2.0/ilog.odms.cplex.help/Content/Optimization/Documentation/CPLEX/_pubskel/CPLEX1127.html
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
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
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.
See Also
Categories
Find more on Introduction to Installation and Licensing in Help Center and File Exchange
Products
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!