yalmip/YALMIP

linprog call error in Matlab 2023 due to extraneous x0 parameter (warm start)

Closed this issue · 2 comments

Since Matlab R2023a (see Summer 2023 discussions #1318 and #1324), solving a Linear Program with YALMIP using Matlab linprog solver fails. Error message is:

Error using linprog LINPROG(f,A,b,Aeq,beq,LB,UB,X0,OPTIONS) does not accept X0. Use LINPROG(f,A,b,Aeq,beq,LB,UB,OPTIONS) instead.)'

Indeed, recent versions of linprog don't accept an initial value (i.e. warm start) x0 parameter. However, browsing Internet Archive, it's true that it existed until 2017:

  • linprog R2016a: accepts x0 param, with note "linprog uses x0 for only the 'active-set' algorithm. For all other algorithms, linprog ignores x0."
  • linprog R2017a: no more x0 param

Perhaps some deprecation notice is to be found in the release notes, but I didn't search for this. Anyway, it appears that linprog continued after R2017a to silently accept the extraneous x0 parameter until R2022b included. Starting from R2023a it fails.

Remark: it also fails when choosing quadprog, since callquadprog falls back to linprog when quadratic matrix Q is 0.

Relevant files which needs to be fixed are:

How to reproduce

Here is a minimal LP example. I don't have a Matlab R2023+ version at hand to recheck that it fails, but I got a dozen of students to demonstrate the bug today!

x = sdpvar(1);
Constraints = 0 <= x;
Objective = x;

options = sdpsettings('solver', 'linprog');
optimize(Constraints, Objective, options)

options = sdpsettings('solver', 'quadprog');
optimize(Constraints, Objective, options)

Dear @johanlofberg, a colleague has just stumbled upon this issue. Thanks to your May 2024 commits, the problem is fixed. However, I believe there was no release since (latest is 2023-06-22). I advised him to use the Development release on the YALMIP download page, is that correct?

Correct