yalmip / YALMIP

MATLAB toolbox for optimization modeling
https://yalmip.github.io/
Other
463 stars 134 forks source link

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

Closed pierre-haessig closed 3 months ago

pierre-haessig commented 3 months ago

Since Matlab R2023a (see Summer 2023 discussions https://github.com/yalmip/YALMIP/discussions/1318 and https://github.com/yalmip/YALMIP/discussions/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:

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)