The model has variables that assume automatically 0-1 values. When we throw the model into intlinprog it solves much faster than when solving as an LP (using linprog).
I am not using Matlab extensively (mainly for translating prototype algorithms into "real" code -- sometimes suffering from what can be called "write-only" Matlab code).
So I was thinking: the MIP solver starts with an LP (solving the root). So how can this happen? An exotic reason can be: when using binary variables instead of continuous variables, additional reductions can be applied in the presolve. This sounds somewhat far-fetched however.
Luckily the reason was much more straightforward. In older versions of linprog, the default LP solver is an interior point code which is much slower. Adding more logging showed:
Sometimes good old Simplex is not so bad. Or. may be. it is actually the presolve that makes a difference (I don't see in the log of the interior point LP any mention of doing a presolve).
Note: newer versions of Matlab have different behavior (the default LP solver is now dual Simplex).
- Matlab Optimization Toolbox Release Notes. https://www.mathworks.com/help/optim/release-notes.html