Is there a tool that reads any linear optimization problem (for example an .lp or .mps file), converts it to the dual problem and prints the dual problem?


2 Answers 2


I recommend having a look at the most recent developments around JuMP. They have developed two interesting packages this year:

  • MathOptFormat.jl, that allows to import/export optimization problem in MPS, LP, CBF, etc...
  • Dualization.jl, that allows to dualize automatically any optimization problem in conic form

You can find here a Julia script that takes as input a MPS file and output the dual problem in a LP file.

However, I get some problems with MathOptFormat, as this package is not yet able to import LP files... Still a work in progress I guess!

  • $\begingroup$ For me, the Julia script does not work (see my comment in the Gist). $\endgroup$
    – JaBe
    Commented Oct 14, 2019 at 17:40

The link includes an online converter from primal to dual linear programs. The downside is you need to input all the coefficients and variables into the pre-defined form on the webpage.

  • 3
    $\begingroup$ Here is another similar calculator: mathstools.com/section/main/… - but the one you posted seems much easier to use $\endgroup$
    – dxb
    Commented Oct 2, 2019 at 19:51
  • 1
    $\begingroup$ The link from the answer also accepts the problem pasted in a text format. Which text format is this? It's not lp or mps. $\endgroup$
    – JaBe
    Commented Oct 5, 2019 at 12:14

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.