How to control duality gap in cplex

525 views
Skip to first unread message

Mojtaba Khanabadi

unread,
Apr 14, 2015, 11:53:13 AM4/14/15
to yal...@googlegroups.com
Hi Johan.

I have a question. I am working on unit commitment problem. I just wanted to know whether there is any way to control the duality gap in MIQP problems. I need to speed up the solution process and I don not care about the accuracy in my case. I am using CPLEX 12.3. Personally, I used to use GAMS and it was very easy on this software to control the duality gap buy using the following command:

optCA: Absolute optimality criterion. This attribute specifies an absolute termination tolerance for use in solving all mixed-integer models. 

optCR: Relative optimality criterion. This attribute specifies a relative termination tolerance for use in solving all mixed-integer models. 

I used the following command, unfortunately none of them worked for me!

ops = sdpsettings;

ops.cplex.mip.tolerances.mipgap=0.5;
ops.cplex.mip.tolerances.absmipgap=0.5;


and even in this format:

ops = sdpsettings('cplex.mip.tolerances.mipgap','0.5');


Thanks alot Johan

Johan Löfberg

unread,
Apr 14, 2015, 2:53:54 PM4/14/15
to yal...@googlegroups.com
1. Are you actually using the ops variable in the call to optimize?

2. Why are you using such an old cplex version?

3. 12.5 and 12.6.0 had a bug which caused cplex to completely ignore any options in matlab. Could be that it was the same in 12.3

Mojtaba Khanabadi

unread,
Apr 15, 2015, 11:03:55 AM4/15/15
to yal...@googlegroups.com
Thanks Johan for your comments. 

1. Yes, I have included ops variable using the following command:

solvesdp(Constraints,Objective,ops).

However, I did not see any change in solution process.

2. My supervisor have provided me this version of the cplex. that's why I am using the old version.




Johan Löfberg

unread,
Apr 15, 2015, 2:59:00 PM4/15/15
to yal...@googlegroups.com
Tell your supervisor to install 12.6.1 which fixes this bug

Mojtaba Khanabadi

unread,
Jul 27, 2016, 9:53:09 AM7/27/16
to YALMIP
Hi Johan,

Finally, I got CPLEX 12.6.3. I would appreciate if you could let me know which command can control the Relative optimality criterion in YALMIP. 

thanks a lot.

Johan Löfberg

unread,
Jul 27, 2016, 2:19:11 PM7/27/16
to YALMIP
Depends on the model. Just browse the options, perhaps something here
>> ops = sdpsettings;
>> ops.cplex.mip.tolerances

ans = 

           absmipgap: 1.0000e-06
         integrality: 1.0000e-05
         lowercutoff: -1.0000e+75
              mipgap: 1.0000e-04
       objdifference: 0
    relobjdifference: 0
         uppercutoff: 1.0000e+75


Reply all
Reply to author
Forward
0 new messages