Read .lp file into JuMP model in direct mode

I think that this will work, at least it worked in my computer locally with HiGHS.

model = direct_model(Gurobi.Optimizer())
lp = read_from_file("model.lp")
MOI.copy_to(backend(model), lp)
optimize!(model)

Other possibility is to call MOI.optimize! directly

model = direct_model(Gurobi.Optimizer())
lp = read_from_file("model.lp")
MOI.optimize!(backend(model), lp)
1 Like