How to derive the dual formulation with JuMP?

Hi all,

The dual formulation is useful for many things (robust reformulation, column generation, and so many others). Is there a way in JuMP to generate the dual of a model? (Not getting the dual values for each constraint, but the exact dual model, with the transposed constraint matrix, the dual variables, etc.)

Also, once you have the dual model, how easy would it be to incorporate it into another model? That could be something really useful (for instance, with robust reformulation, you dualise the uncertainty set, and inject it in the master problem: https://github.com/IainNZ/JuMPeR.jl/blob/master/src/uncsets_basic_reform.jl).

(If none of it is available, would you accept a PR to include it into JuMP, or should it rather be an extension?)

Thanks in advance!

There is a GSOC student working on this: https://github.com/guilhermebodin/Dualization.jl

1 Like

Nice, thanks for the link!

Hey @dourouc05 ! The code is mainly under construction but if you can get the backend of the model the function dualize builds the dual model, it returns the dualized model and some “maps” indicating what is the dual variable linked to a primal constraint. You might find some examples on the tests folder.

I’ve had a look at your package, and even started using it (well, seeing how it behaves, for now). It may be under construction, but it feels at least already quite useful!

2 Likes

Nice! If you have some features in mind let me know

For now, just one bug :stuck_out_tongue:, but I’ll sure let you know if I find anything that I’m missing (I’m not really using nonlinear stuff right now, which however seems like a strong point of your package!).