fslaborg / flips

Fsharp LInear Programming System
https://flipslibrary.com/#/
MIT License
251 stars 32 forks source link

Add up-for-grabs issues #184

Open gsomix opened 2 years ago

gsomix commented 2 years ago

I love an idea behind the project and I sure there are plenty of engineering problems new contributors might help with. Could you please add (or label) up-for-grab issues? Thank you!

matthewcrews commented 2 years ago

I'll get on that. I've been considering a massive overhaul and I'll create a punch list of things to fix.

AtwoodTM commented 11 months ago

Hi @matthewcrews, I am loving the FLIPS library. I would like to extend the FLIPS library to use a quadratic programming solver for portfolio optimization within the investment management realm, similar to choosing "GRG nonlinear" for the solver in the Solver add-in for Excel. I would incorporate this by effectively wrapping the open source Accord .NET library and we would specify the solver... Any thoughts about this idea (like or dislike)?

matthewcrews commented 11 months ago

I do like this idea. As I mentioned above, Flips needs a massive overhaul. I wrote it before I had much experience with creating libraries and supporting them. There are several mistakes in it that cause far more allocation than should be required, and this becomes burdensome with large models. Flips also went 1.0 well before it should have. It should really be ~0.8 based on how people are versioning their libraries these days.

I have re-written Flips for an internal project at my company, and I have been letting it bake to ensure it's production worthy. I will then migrate these changes into the main branch.

I want to extend Flips to be able to model Quadratic Programs. I would like also to be able to differentiate between LP Models, MIP models, and Quadratic Models. Right now, both LP and MIP models become just a Model type, and only the solver you choose cares about the types of decision variables: Continuous vs. Binary vs. Integer. This can cause confusion on the output for the user because some solvers will take an Integer or Binary decision variable and just treat it as continuous. Google's GLOP solver is an example. This has caused problems with debugging solver output.

I would like the API to cleanly "promote" models from LP or Binary to a MIP and for the Solvers to output an LP Result, Binary Result, or MIP Result. This then provides extra guard rails for non-Mathematical Programming Experts to use the API correctly.

Adding Quadratic Expressions to the solver would open Flips up to being used in more scenarios, and I would like that. It does make the name a bit of a misnomer because Flips stand for F# LInear Programming System. The truth is that the Flips name has always been a misnomer since it supported MIPS models from the beginning.

Perhaps I'm overcomplicating it, though. I could just raise a warning when you are using an LP solver with a non-LP Model.

My dream is for Flips to be an easy-to-use library for mathematical modeling of optimization problems. I do think Quadratic Programming would be a worthwhile addition.

AtwoodTM commented 11 months ago

I would love to help out refactoring any way I can! I hope you also think about using the refactoring process as a set of videos with the Fast F# YouTube channel! Please let me and others know where we can contribute!