EnergySystemsModellingLab / MUSE_2.0

Welcome to the MUSE 2.0 repository
GNU General Public License v3.0
1 stars 0 forks source link

Pass data to HiGHS solver more efficiently #46

Open alexdewar opened 3 weeks ago

alexdewar commented 3 weeks ago

We use the Rust highs crate in order to interface with the underlying C++-based HiGHS solver.

The problem is that we are currently copying data every time we add a row/column. Unfortunately, it seems that there is no way to modify the data in the internal model object in situ, either in the Rust bindings or the underlying C/C++ library (see here). This is a non-issue with the toy problem we have at present, but the real problem will likely involve millions of variables, at which point the overhead of copying that data will become considerable.

It might be possible with the HiGHS C API to change the underlying data, but if so I've missed it. If it comes to it, we may need to submit a PR to the upstream project to add this functionality, but hopefully it won't come to this. The alternative is using a different solver that does support this.