Usage of scipy.optimize.fmin_slsqp

You have a plain linear program, is that right ?

min: - prices . x
constrain: x >= 0, sum x = 4

so the second derivative matrix aka Hessian is exactly 0.
slsqp is trying to invert this --- not possible. Agreed, the error message could be better.
(The same will happen with other quadratic methods, in any package: they'll converge much faster on smooth functions, but crash on rough cliffs.)

See also why-cant-i-rig-scipys-constrained-optimization-for-integer-programming --
but LP should do the job (max 4), Integer programming is harder.


The SLSQP algorithm is a gradient-based optimizer, meaning it expects the derivatives of the objective and constraints to be continuous. From my understanding, it seems like you're trying to solve an integer programming problem (continuous values in the schedule list are not acceptable). You need an algorithm that selects appropriate values (0 or 1) for the independent variables, rather than trying to find the minimum of a continuous space of values. Unfortunately, I'm not sure that there are any in scipy that do that.