Juniper.jl
Juniper.jl copied to clipboard
Juniper (Julia/JuMP) has the difficulty in convergence during MIP FP iterations
I am using Juniper in Julia/JuMP to solve a feasibility problem, whose constraints are linear. The FP iterations seem to be going on forever, having the difficulty in convergence. I am looking for help for a way to get the best feasible solution out of it.
My setting is below.
using Juniper
optimizer = Juniper.Optimizer
nl_solver= optimizer_with_attributes(Ipopt.Optimizer,"print_level" => 0) mip_solver = optimizer_with_attributes(GLPK.Optimizer)
model = Model(optimizer_with_attributes( optimizer, "nl_solver"=>nl_solver, "mip_solver"=>mip_solver))
set_optimizer_attribute(model, "mip_gap", 0.0001)
set_time_limit_sec(model, 200)
set_optimizer_attribute(model, "branch_strategy", :StrongPseudoCost)
set_optimizer_attribute(model, "traverse_strategy", :DFS)
optimize!(model)
The .nl file is here Juniper_problem1.nl.txt
The .lp file is here
Hi, thanks for opening the issue. A few questions:
- Can you save the model as a mathoptformat file?
- have you tried HiGHS as a MIP solver ?
- normally there should be a limit of 60seconds for the feasibility pump. Can be that GLPK is taking longer and we can't stop it though.
- have you tried running it without the feasibility pump?
Hi @Wikunia
Thanks for your prompt reply.
- Can you pass me the syntax to save the model in Julia/JuMP to a mathoptformat file?
- I just tried HiGHS as a MIP solver: mip_solver = optimizer_with_attributes(HiGHS.Optimizer, "output_flag" => true). It was successful!
- FP took 61 seconds with No integral solution found. Please see output here Juniper_output.docx
- What is the syntax to set it up without feasibility pump?
Guanghui
- If I remember correctly it should work like this https://github.com/jump-dev/MathOptInterface.jl/blob/a3609e5a29c4514054b11ecfff306ea6f64dd366/docs/src/submodules/FileFormats/overview.md#write-to-file
- Great
- You might want to increase the length of the feasibility pump in this case https://lanl-ansi.github.io/Juniper.jl/stable/options/#Feasibility-Pump
- See 3 for a way to disable it.
Seems like it's hard to find a feasible solution though so the feasibility pump would be nice if it works to have a starting solution. It seems a bit strange on first sight that the best bound stays constant though I haven't looked at your model. Do you have maybe smaller problems of the same kind to test on?
Can you pass me the syntax to save the model in Julia/JuMP to a mathoptformat file?
write_to_file(model, "model.mof.json")
@odow Hi Oscar: Your line of code works. Please see the attached json file. model.mof.json.txt
@Wikunia Hi Ole: I tried to disable feasibility pump with GLPK as the mip solver.
set_optimizer_attribute(model, "feasibility_pump", false)
and also tried to increase feasibility pump time from default 60 seconds to 120 seconds.
set_optimizer_attribute(model, "feasibility_pump_time_limit", 120)
Both didn't solve the problem. HiGHS as mip solvers works for this feasibility problem. But if I add the linear or nonlinear objective function back, it fails.
I reduced to smaller size problems, Juniper didn't show this type of issues.