I want to know whether is there a way to use Juniper to solve optimization models generated by Pyomo. Pyomo can generate model file (problem.lp
or problem.nl
) which can be passed to some solvers. Does Juniper have such functionality?
Not to my knowledge. Reader/writers for various file formats are in progress at https://github.com/odow/MathOptFormat.jl. Once an NL reader is implemented, and once Juniper updates to MathOptInterface (MathOptInterface and upcoming breaking changes in JuMP 0.19), it will be possible.
I demo’d calling a Julia solver using nl files at ISMP 2015: Jupyter Notebook Viewer using AmplNLReader. (The code is not ready for serious use and is rendered obsolete by MathOptInterface.)
For continuous problems, you can use AmplNLReader.jl to open the problem and pass it to a solver like Ipopt using the function NLPtoMPB
from package NLPModelsJuMP.jl. This only works with MathProgBase
at the moment (though efforts to update NLPModelsJuMP to use MOI are appreciated).
MWE:
using MathProgBase, Ipopt, AmplNLReader, NLPModelsJuMP
nlp = AmplModel("dixmaane.jl")
mpb_model = NLPtoMPB(nlp, IpoptSolver())
MathProgBase.optimize!(mpb_model)
The file dixmaane.nl
can be download here.
However, none of this was tested for integer variables and it may require some tinkering.