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

Test with Alpine #195

Open
wants to merge 2 commits into
base: master
Choose a base branch
from
Open

Test with Alpine #195

wants to merge 2 commits into from

Conversation

joaquimg
Copy link
Owner

@joaquimg joaquimg commented Feb 27, 2023

Running Alpine with Ipopt+HiGHS.

Most cases fail.

1 - Many seem sem to be trying to add a quadratic constraint to HiGHS:

 Constraints of type MathOptInterface.ScalarQuadraticFunction{Float64}-in-MathOptInterface.GreaterThan{Float64} are not supported by the solver.

  If you expected the solver to support your problem, you may have an error in your formulation. Otherwise, consider using a different solver.

  The list of available solvers, along with the problem types they support, is available at https://jump.dev/JuMP.jl/stable/installation/#Supported-solvers.
  Stacktrace:
    [1] error(s::String)
      @ Base .\error.jl:35
    [2] _moi_add_constraint(model::MathOptInterface.Utilities.CachingOptimizer{MathOptInterface.Bridges.LazyBridgeOptimizer{HiGHS.Optimizer}, MathOptInterface.Utilities.UniversalFallback{MathOptInterface.Utilities.Model{Float64}}}, f::MathOptInterface.ScalarQuadraticFunction{Float64}, s::MathOptInterface.GreaterThan{Float64})

I would expect that quadratic constraints are forwarded to Ipopt as non-linear constraints.

2 - Another common error is:

  Result index of attribute MathOptInterface.ObjectiveValue(1) out of bounds. There are currently 0 solution(s) in the model.
  Stacktrace:
    [1] check_result_index_bounds
      @ C:\Users\joaquimgarcia\.julia\packages\MathOptInterface\NCblk\src\attributes.jl:207 [inlined]
    [2] get
      @ C:\Users\joaquimgarcia\.julia\packages\HiGHS\QRk9O\src\MOI_wrapper.jl:1880 [inlined]
    [3] get(b::MathOptInterface.Bridges.LazyBridgeOptimizer{HiGHS.Optimizer}, attr::MathOptInterface.Bridges.ObjectiveFunctionValue{MathOptInterface.ScalarAffineFunction{Float64}})
      @ MathOptInterface.Bridges C:\Users\joaquimgarcia\.julia\packages\MathOptInterface\NCblk\src\Bridges\bridge_optimizer.jl:993
    [4] get(model::MathOptInterface.Bridges.LazyBridgeOptimizer{HiGHS.Optimizer}, attr::MathOptInterface.Bridges.ObjectiveFunctionValue{MathOptInterface.VariableIndex}, #unused#::MathOptInterface.Bridges.Objective.FunctionizeBridge{Float64})
      @ MathOptInterface.Bridges.Objective C:\Users\joaquimgarcia\.julia\packages\MathOptInterface\NCblk\src\Bridges\Objective\bridges\functionize.jl:96
    [5] get(b::MathOptInterface.Bridges.LazyBridgeOptimizer{HiGHS.Optimizer}, attr::MathOptInterface.Bridges.ObjectiveFunctionValue{MathOptInterface.VariableIndex})
      @ MathOptInterface.Bridges C:\Users\joaquimgarcia\.julia\packages\MathOptInterface\NCblk\src\Bridges\bridge_optimizer.jl:991
    [6] get(b::MathOptInterface.Bridges.LazyBridgeOptimizer{HiGHS.Optimizer}, attr::MathOptInterface.ObjectiveValue)
      @ MathOptInterface.Bridges C:\Users\joaquimgarcia\.julia\packages\MathOptInterface\NCblk\src\Bridges\bridge_optimizer.jl:1000
    [7] _get_model_attribute(model::MathOptInterface.Utilities.CachingOptimizer{MathOptInterface.Bridges.LazyBridgeOptimizer{HiGHS.Optimizer}, MathOptInterface.Utilities.UniversalFallback{MathOptInterface.Utilities.Model{Float64}}}, attr::MathOptInterface.ObjectiveValue)
      @ MathOptInterface.Utilities C:\Users\joaquimgarcia\.julia\packages\MathOptInterface\NCblk\src\Utilities\cachingoptimizer.jl:828
    [8] get
      @ C:\Users\joaquimgarcia\.julia\packages\MathOptInterface\NCblk\src\Utilities\cachingoptimizer.jl:876 [inlined]
    [9] _moi_get_result(model::MathOptInterface.Utilities.CachingOptimizer{MathOptInterface.Bridges.LazyBridgeOptimizer{HiGHS.Optimizer}, MathOptInterface.Utilities.UniversalFallback{MathOptInterface.Utilities.Model{Float64}}}, args::MathOptInterface.ObjectiveValue)
      @ JuMP C:\Users\joaquimgarcia\.julia\packages\JuMP\bofhg\src\optimizer_interface.jl:680
   [10] get(model::Model, attr::MathOptInterface.ObjectiveValue)
      @ JuMP C:\Users\joaquimgarcia\.julia\packages\JuMP\bofhg\src\optimizer_interface.jl:700
   [11] objective_value(model::Model; result::Int64)
      @ JuMP C:\Users\joaquimgarcia\.julia\packages\JuMP\bofhg\src\objective.jl:54
   [12] objective_value
      @ C:\Users\joaquimgarcia\.julia\packages\JuMP\bofhg\src\objective.jl:50 [inlined]
   [13] solve_obbt_model(m::Alpine.Optimizer; kwargs::Base.Pairs{Symbol, Union{}, Tuple{}, NamedTuple{(), Tuple{}}})
      @ Alpine C:\Users\joaquimgarcia\.julia\packages\Alpine\85o9X\src\presolve.jl:357

Seems that Alpine is not handling some HiGHS fails well. Possibly due unbounded variables?

cc @harshangrjn @odow

@harshangrjn
Copy link

harshangrjn commented Feb 27, 2023

If the problem has convex quadratic constraints, then using Pavito + Highs should work (Alpine's tests have a few examples). Ipopt is used only for feasibility. Unbounded variables shouldn't be an issue as Alpine automatically applies large bounds on them and then tries to tighten their bounds. If you still have issues, share a working example where you can reproduce the issue.

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

Successfully merging this pull request may close these issues.

2 participants