coin-or / python-mip

Python-MIP: collection of Python tools for the modeling and solution of Mixed-Integer Linear programs
Eclipse Public License 2.0
530 stars 92 forks source link

Support for sparse algebra and bulk constraint addition #11

Open SanPen opened 5 years ago

SanPen commented 5 years ago

Hi,

I integrated and heavily modified PuLP for my program GridCal. Doing so, I made this module to handle sparse algebra. This way I can model algebraic equations (A @ b < c) with no for-loops in the program itself.

This feature is something these modelling frameworks often lack and they make models far more maintainable.

h-g-s commented 4 years ago

Hi, Sorry for taking so long to look at this. It would basically involve to add support for numpy matrices, is it ? Other people asked for it, so I think it would be useful. One downside is the inclusion of another dependency (numpy)...

SanPen commented 4 years ago

Hi,

I think you may avoid the scipy dependency if you just check for the parameters:

These 4 parameters define a CSC / CSR sparse matrix in scipy.

However numpy would be around and would be hard to avoid.