0
votes

I'm trying to solve a big quadratic optimization problem using CPLEX (cplexqp) in matlab. Unfortunately by H matrix (or Q matrix as some sources call it) is non-convex in nature and thus I want to set the optimality target from 0 (default) to 3 to tell CPLEX to not terminate when finding out Q is non-convex. However, I'm not sure how to do this. I tried to read the manuals and instructions and they all just said set optimality target = 2 or 3 without any actual examples or general command on how to do it. I tried to do it in options but got an error that CPLEX doesn't recognize 'optimalitytarget'.

options = cplexoptimset('Display','on','TolFun',0.0000001,'TolRLPFun',0.0000001,'MaxNodes',50000,'MaxIter',50000, 'optimalitytarget',3);

I also tried:

Cplex = cplexoptimset('cplex')
Cplex.Param.optimalitytarget = 3;

without any sucess. I know it the API is Cplex.Param.optimalitytarget but I cannot seem to figure out where to set this.

Sorry if this is a trivial or dumb question. I feel like this is one of the things that's very simple and either you do know or you don't know and I don't know how to do it. Any help or advice on going about this is greatly appreciated.

2
Which cplex version do you use ? (Optimality target: new name for former solution target parameter) - Alex Fleischer
I'm using version 12.7. - user496181

2 Answers

1
votes

You can find examples of using CPLEX from within MATLAB in the distribution. They are located in [installPath]/cplex/examples/src/matlab.

You mentioned that you are using cplexqp, which is the toolbox API. Looking at https://www.ibm.com/support/knowledgecenter/es/SSSA5P_12.7.0/ilog.odms.cplex.help/CPLEX/MATLAB/topics/gs_param.html, I suspect that the issue with your second example is with your using Param. That structure relates to the Cplex Class API, not the toolbox API. I suppose that the following would work better:

options = cplexoptimset('cplex'); 
options.optimalitytarget=3; 
0
votes

Model = cplex.Cplex("filename.mps") Model.parameters.optimalitytarget.set(float(3))

This worked for me!