Mosek maximum number of iterations

871 views
Skip to first unread message

David Tena

unread,
Mar 23, 2015, 5:23:01 AM3/23/15
to yal...@googlegroups.com
Hello. I want to limit the maximum number of iterations done by Yalmip using mosek. I have seen mosek has parameters to do this kind of things in different cases, like MSK_IPAR_BI_MAX_ITERATIONS, MSK_IPAR_SIM_MAX_ITERATIONS, MSK_IPAR_NONCONVEX_MAX_ITERATIONS, etc. but I don't know how to set them through Yalmip. I will appreciate any help. Thanks.

Joachim Dahl

unread,
Mar 23, 2015, 7:23:06 AM3/23/15
to yal...@googlegroups.com
Normally, it should not be necessary to change the default parameters in MOSEK.   Can you provide reproducible code to generate your problem?

David Tena

unread,
Mar 23, 2015, 12:19:02 PM3/23/15
to yal...@googlegroups.com
I just need to stop calculations after a few time because it is a large problem and solve time is long (some minutes), and I need to solve the problem repeatedly (let's say every 30 seconds), so I prefer to stop the calculations even if it has not reached the global optimum (if the solution is feasible). To do that my idea is to limit the maximum number of iterations.

Erling Andersen

unread,
Mar 24, 2015, 2:13:14 AM3/24/15
to yal...@googlegroups.com
If you are using the interior-point algorithm in MOSEK then the solution will most likely not be feasible. The note http://docs.mosek.com/whitepapers/homolo.pdf explains why that is the case.

If you have an LP then the primal simplex may give you a feasible solution if stopped prematurely.

David Tena

unread,
Mar 24, 2015, 3:56:39 AM3/24/15
to yal...@googlegroups.com
Johan has send me an e-mail:

"Replying per email as I am in China where google groups is blocked

ops = sdpsettings('mosek.MSK_IPAR_BI_MAX_ITERATIONS',2342342)
http://users.isy.liu.se/johanl/yalmip/pmwiki.php?n=Commands.Sdpsettings"

In case this is useful for anyone. I have finally solved modifying other parameters related with execution time like 'MSK_DPAR_MIO_MAX_TIME', and I am gonna try also with 'MSK_DPAR_MIO_TOL_ABS_GAP', which changes optimality tolerance. You can see all mosek parameters here: http://docs.mosek.com/7.0/toolbox/Parameters.html.

Thank you all for your help.

liuju

unread,
Jul 4, 2020, 3:15:06 AM7/4/20
to YALMIP
Hello, I see your advice, and it's very helpful for my work. I also want to modify the maximum  time limit in mosek according to your suggestions, but I still encounter the error 'Unrecognized property name 'MSK_DPAR_OPTIMIZER_MAX_TIME'. My setting is 'ops=sdpsettings('solver','mosek','MSK_DPAR_OPTIMIZER_MAX_TIME', -1).' Could you give me some advice?

Mark L. Stone

unread,
Jul 4, 2020, 6:57:01 AM7/4/20
to YALMIP
mosek.

must precede the parameter name.
ops=sdpsettings('solver','mosek','mosek.MSK_DPAR_OPTIMIZER_MAX_TIME', -1)

liuju

unread,
Jul 4, 2020, 7:56:26 AM7/4/20
to YALMIP
thank you sincerely
Reply all
Reply to author
Forward
0 new messages