lanl-ansi / Alpine.jl

A Julia/JuMP-based Global Optimization Solver for Non-convex Programs
https://lanl-ansi.github.io/Alpine.jl/latest/
Other
244 stars 39 forks source link

Exception while doing optimize ==> ErrorException("type Optimizer has no field objective_value") #163

Closed manojcen closed 3 years ago

manojcen commented 3 years ago

Describe the bug A clear and concise description of what the bug is. Simple examples which reproduce the bug will be helpful.

running the solver with following parameters

IPOPT = optimizer_with_attributes(Ipopt.Optimizer, MOI.Silent() => true, "sb" => "yes") CBC = optimizer_with_attributes(Cbc.Optimizer, MOI.Silent() => true,"logLevel" => 0) JUNIPER = optimizer_with_attributes(Juniper.Optimizer)#, MOI.Silent() => true, "mip_solver" => CBC, "nl_solver" => IPOPT) PAVITO = optimizer_with_attributes(Main.Pavito.Optimizer, MOI.Silent() => true,"mip_solver" => CBC, "cont_solver" => IPOPT, "mip_solver_drives" => false) relgapc =0.001 test_sol = optimizer_with_attributes(Main.Alpine.Optimizer, "nlp_solver" => IPOPT, "minlp_solver" =>PAVITO, "mip_solver" =>CBC,

"relgap" => relgapc,

     "disc_var_pick" => 1,
    "disc_uniform_rate" => 3 ,
    "disc_add_partition_method" =>"adaptive",
    "disc_ratio"=>2,
#   "bilinear_mccormick" =>false,
  "presolve_bp" => true,
    "presolve_time_limit" =>200,
    "presolve_bt_relax" => true,
    "presolve_bt" =>  true,
     "max_iter" => 100000,
    "loglevel" => 1,
    "disc_ratio_branch" =>true,
    "disc_consecutive_forbid" =>1
    )

getting the error mentioned in subject at presolve.jl temp_bounds[var_idx][tell_side[sense]] = tell_round[sense](JuMP.objective_value(m.model_mip)/get_option(m, :presolve_bt_output_tol))*get_option(m, :presolve_bt_output_tol) # Objective truncation for numerical issues

the PKg status with latest Alpine and Pavito

[c52e3926] Atom v0.12.16 [6e4b80f9] BenchmarkTools v0.5.0 [336ed68f] CSV v0.7.3 ⚲ [9961bab8] Cbc v0.7.1 ⚲ [e2554f3b] Clp v0.8.3 [a93c6f00] DataFrames v0.21.4 ⚲ [60bf3e95] GLPK v0.13.0 [e8aa6df9] GLPK_jll v4.64.0+0 [cd3eb016] HTTP v0.8.16 ⚲ [7073ff75] IJulia v1.21.2 ⚲ [b6b21f68] Ipopt v0.6.5 [682c06a0] JSON v0.21.1 [4076af6c] JuMP v0.21.4 [2ddba703] Juniper v0.6.5 ⚲ [e5e0dc1b] Juno v0.8.2 [b8f27783] MathOptInterface v0.9.17 [8dfed614] Test

harshangrjn commented 3 years ago

@manojcen Is the problem you are trying to solve an NLP or an MINLP? If it's a small one, would you mind sharing it here?

manojcen commented 3 years ago

Hi Harsha,

I am using it for MINLP. I am getting output for this settings IPOPT = optimizer_with_attributes(Ipopt.Optimizer, MOI.Silent() => true)#, "sb" => "yes") CBC = optimizer_with_attributes(Cbc.Optimizer, MOI.Silent() => true) JUNIPER = optimizer_with_attributes(Juniper.Optimizer)#, MOI.Silent() => true, "mip_solver" => CBC, "nl_solver" => IPOPT)

PAVITO = optimizer_with_attributes(Pavito.Optimizer, "mip_solver" => CBC, "cont_solver" => IPOPT, "mip_solver_drives" => true)

 PAVITO = optimizer_with_attributes(Pavito.Optimizer, "mip_solver" => XX, "cont_solver" => IPOPT, "mip_solver_drives" => true)

relgapc =0.001 test_sol = optimizer_with_attributes(Alpine.Optimizer, "nlp_solver" => IPOPT, "minlp_solver" =>PAVITO, "mip_solver" => CBC, "relgap" => relgapc, "disc_var_pick" => 0, "disc_uniform_rate" => 10 , "disc_add_partition_method" =>"uniform", "disc_ratio"=>160, "presolve_bp" => true, "presolve_time_limit" =>200, "presolve_bt" => true, # false "max_iter" => 10000, "loglevel" => 100 ) but the solution is showing a gap of 43.3% after 10000 generation. I wants to try other options. The model is big and can't share it

PROBLEM STATISTICS Objective sense = Max

Variables = 355

Bin-Int Variables = 63

Constraints = 312

NL Constraints = 60

Linear Constraints = 252

Detected convex constraints = 0

Detected nonlinear terms = 0

Variables involved in nonlinear terms = 0

Potential variables for partitioning = 0

SUB-SOLVERS USED BY ALPINE MINLP local solver = Pavito MIP solver = Cbc ALPINE CONFIGURATION Maximum iterations = 10000 Relative optimality gap criteria = 0.1000% Potential variables chosen for partitioning = All Discretization ratio = 160 Bound-tightening (OBBT) presolve = true OBBT maximum iterations = 10 PRESOLVE Doing local search

MINLP has a nonlinear objective, 355 variables (63 integer), 60 nonlinear constraints, 0 quadratic constraints.

Thanks

harshangrjn commented 3 years ago

I tested and here are a few things you can try. Firstly, I am not able to reproduce the same error you are observing probably because I am testing on a different MINLP. Here is the MINLP for your reference. In this case, turning off presolve_bt_relax seems to fix the issue and solves it to optimality (though the issue without turning it off is a different one). Also, I am using Juniper as the MINLP solver, because Pavito only solves convex MINLPs. Let me know if this fixes your issue.

harshangrjn commented 3 years ago

Closing this issue as I don't observe this on my side. Feel free to re-open if necessary.