Cplex Termination conditions - tolerances.mipgap

309 views
Skip to first unread message

martin tiann

unread,
Nov 8, 2016, 1:40:26 AM11/8/16
to YALMIP
Hi

I'm using Yalmip to relance Cplex in Matlab. For sdpsettings, I set as follows

ops = sdpsettings('solver','Cplex','debug',1,'verbose',2,'warning',1,'savesolveroutput',1);
ops.cplex = cplexoptimset('cplex');
ops.cplex.threads = 1;
ops.cplex.display = 'on';
ops.cplex.mip.tolerances.mipgap=0.01;

the last line means that I want the program stops if the gap < 1%.

But why does it still continue when the gap is smaller than 1%? The current output is as follows and it is still running without stop:

..........
 
 8074882 5126566  2238262.8814    64  2239514.9535  2222926.2794 44178901    0.74%
 8092640 5136204  2233635.8650    61  2239514.9535  2222938.0685 44282966    0.74%
 8110186 5145739  2235466.2256    59  2239514.9535  2222949.7864 44387435    0.74%
 8127790 5155339  2224251.1513    61  2239514.9535  2222961.7943 44490053    0.74%
 8145429 5164976  2233392.9471    60  2239514.9535  2222973.0167 44592341    0.74%
 8163116 5174722  2238890.6317    55  2239514.9535  2222985.1830 44696708    0.74%
 8180629 5184360  2239344.5243    58  2239514.9535  2222996.3768 44799424    0.74%
 8197919 5193788  2238855.3705    57  2239514.9535  2223007.7654 44899694    0.74%
 8215373 5203349  2227372.0360    63  2239514.9535  2223019.2252 45000027    0.74%
 8232914 5212717  2228102.2723    62  2239514.9535  2223030.2667 45103885    0.74%
Elapsed time = 13103.26 sec. (6898411.46 ticks, tree = 5183.52 MB, solutions = 49)
Nodefile size = 3136.14 MB (842.57 MB after compression)
 8250124 5222115  2231419.8003    64  2239514.9535  2223041.7730 45204340    0.74%
 8267763 5231890  2232194.7961    63  2239514.9535  2223052.7726 45306881    0.74%
 8285124 5241371  2223063.6081    62  2239514.9535  2223063.6092 45409167    0.73%
 8302685 5250944  2231727.1639    58  2239514.9535  2223075.2848 45511850    0.73%
 8320308 5260400  2223086.4992    64  2239514.9535  2223086.5043 45614531    0.73%
 8337643 5269835  2226729.8044    60  2239514.9535  2223097.6549 45714129    0.73%
 8355041 5279261  2227909.6002    61  2239514.9535  2223109.0074 45816878    0.73%
 8372621 5288835  2235898.8740    58  2239514.9535  2223120.4795 45919106    0.73%
 8389814 5298066  2237322.4046    59  2239514.9535  2223130.9701 46018498    0.73%
 8407153 5307308  2234486.5166    60  2239514.9535  2223142.6711 46119466    0.73%
Elapsed time = 13408.15 sec. (7051003.07 ticks, tree = 5275.59 MB, solutions = 49)
Nodefile size = 3227.68 MB (865.92 MB after compression)
 8424507 5316641  2232681.4910    57  2239514.9535  2223153.8115 46220278    0.73%
 8441929 5326160  2230017.4678    59  2239514.9535  2223164.4933 46321754    0.73%
 8459665 5335635  2231587.0641    62  2239514.9535  2223176.0356 46424792    0.73%
 8476901 5344980  2225719.2786    63  2239514.9535  2223186.7700 46525298    0.73%
 8494383 5354414  2236689.9093    59  2239514.9535  2223198.1755 46627773    0.73%
 8511606 5363615  2226014.1020    63  2239514.9535  2223209.4964 46727633    0.73%
 8529229 5373086  2232761.5381    55  2239514.9535  2223220.7194 46829496    0.73%
 8546621 5382349  2235926.1074    57  2239514.9535  2223231.9051 46930273    0.73%
 8563871 5391555  2225540.5725    61  2239514.9535  2223243.1875 47031632    0.73%
 8581503 5400985        cutoff        2239514.9535  2223254.2348 47134013    0.73%
Elapsed time = 13708.18 sec. (7203598.02 ticks, tree = 5366.66 MB, solutions = 49)
Nodefile size = 3319.23 MB (889.23 MB after compression)
 8599045 5410355        cutoff        2239514.9535  2223265.3213 47235995    0.73%
 8616130 5419531  2233977.6413    58  2239514.9535  2223276.2546 47335235    0.73%
 8633468 5428902  2225978.4023    62  2239514.9535  2223287.0593 47436936    0.72%
 8650828 5438234  2237683.1880    57  2239514.9535  2223298.0567 47538916    0.72%
 8668121 5447421  2238479.3580    55  2239514.9535  2223309.1882 47640733    0.72%
 8685571 5456851  2235827.4258    70  2239514.9535  2223319.8840 47743597    0.72%
 8703097 5466247  2229124.7584    64  2239514.9535  2223330.7730 47848204    0.72%
 8720665 5475592  2227199.9234    71  2239514.9535  2223341.9033 47950876    0.72%
 8737884 5484811  2231850.7802    60  2239514.9535  2223352.8366 48052864    0.72%

Johan Löfberg

unread,
Nov 8, 2016, 1:54:21 AM11/8/16
to YALMIP
First, I don't what happens when you manually create the cplex options structure and add it to the ops.cplex field. 

Maybe some other tolerance isn't met, and the logic is that all tolerances have to be fulfilled before terminating

And finally, cplex options logic is generally broken in many version of cplex matlab interface, so I would not be surprised if it simply doesn't accept the options changes.

Johan Löfberg

unread,
Nov 8, 2016, 1:55:00 AM11/8/16
to YALMIP
and fourth, it is not clear from the code if you actually use the options structure in the call to optimize

martin tiann

unread,
Nov 8, 2016, 6:08:49 AM11/8/16
to YALMIP
Hi,

Thanks for your answer!!Actually I have called the structure ops to optimize like
optimize(con,obj,ops);

I am using the Cplex version 12.6.0,doses it matter (because I've seen your previous answer saying that there will be some bugs on the cplex settings with old bersion )

Johan Löfberg

unread,
Nov 8, 2016, 6:16:51 AM11/8/16
to YALMIP
Message has been deleted

Mark L. Stone

unread,
Nov 8, 2016, 1:37:13 PM11/8/16
to YALMIP
Even though 12.6.0 MATLAB options is "broken", I believe you can successfully specify any option using the numerical Identifier:
2008 for absolute MIP gap
2009 for relative MIP gap

See the post by EdKlotz at https://www.ibm.com/developerworks/community/forums/html/topic?id=7dce2826-4858-4136-bbd4-a31fb7fadd90&ps=25
Reply all
Reply to author
Forward
0 new messages