opencobra / optlang

optlang - sympy based mathematical programming language
http://optlang.readthedocs.org/
Apache License 2.0
244 stars 51 forks source link

Bi-level MILPs #18

Open zakandrewking opened 8 years ago

zakandrewking commented 8 years ago

To support bi-level MILPs like OptKnock, it would be nice to add a convenience method for taking the dual of a problem and combining it with the original problem.

See here for COBRApy implementation:

https://github.com/opencobra/cobrapy/blob/a57e4d6c58f99a948c78280e0db11138b7676881/cobra/design/design_algorithms.py#L175

Doing this in COBRApy, I would up with a bug that prevents me from implementing the 3-level optimization RobustKnock, and I gave up on it. Maybe OptLang provides a core library that will be easier to debug.

KristianJensen commented 8 years ago

Hi Zach

Thanks for your comment. I agree that it would make sense to have such a method in optlang as it's a common and useful procedure when working with optimisation problems. I've also run into this need myself trying to implement RobustKnock, but I haven't gotten around to implementing it yet.

We have a dualising method in cameo (which will be moved to optlang at some point, since that's where it really belongs) that we use to implement OptKnock, but it currently doesn't handle mixed integer problems, so it won't work for RobustKnock (without some extra work at least).

cdiener commented 7 years ago

Hi, I have that working for bi-level problems in a different code base using a slimmer dualizing method that is a bit faster than the optlang default. The major problem I have is how to deal with weak Pareto optimality in that case (many equally "good" optimal solutions). Also it is pretty slow for large models with a few thousand variables. Maybe scalarization or lexicographic methods might be a better fit in general...

But if you want I would be happy to contribute the solution to optlang.