Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Juniper (Julia/JuMP) has the difficulty in convergence during MIP FP iterations #253

Open
guanghuidatafuelx opened this issue Nov 2, 2022 · 5 comments

Comments

@guanghuidatafuelx
Copy link

guanghuidatafuelx commented Nov 2, 2022

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

Juniper_model1.lp.txt

@guanghuidatafuelx guanghuidatafuelx changed the title Juniper (Julia/JuMP) has the difficult in convergence in MIP FP iterations Juniper (Julia/JuMP) has the difficulty in convergence in MIP FP iterations Nov 2, 2022
@guanghuidatafuelx guanghuidatafuelx changed the title Juniper (Julia/JuMP) has the difficulty in convergence in MIP FP iterations Juniper (Julia/JuMP) has the difficulty in convergence during MIP FP iterations Nov 2, 2022
@Wikunia
Copy link
Member

Wikunia commented Nov 2, 2022

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?

@guanghuidatafuelx
Copy link
Author

Hi @Wikunia

Thanks for your prompt reply.

  1. Can you pass me the syntax to save the model in Julia/JuMP to a mathoptformat file?
  2. I just tried HiGHS as a MIP solver: mip_solver = optimizer_with_attributes(HiGHS.Optimizer, "output_flag" => true). It was successful!
  3. FP took 61 seconds with No integral solution found. Please see output here
    Juniper_output.docx
  4. What is the syntax to set it up without feasibility pump?

Guanghui

@Wikunia
Copy link
Member

Wikunia commented Nov 2, 2022

  1. 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
  2. Great
  3. 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
  4. 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?

@odow
Copy link
Collaborator

odow commented Nov 2, 2022

Can you pass me the syntax to save the model in Julia/JuMP to a mathoptformat file?

write_to_file(model, "model.mof.json")

@guanghuidatafuelx
Copy link
Author

guanghuidatafuelx commented Nov 2, 2022

@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.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants