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

IntegerToZeroOneBridge not working? (Alpine) #2517

Closed
LebedevRI opened this issue Jun 23, 2024 · 2 comments
Closed

IntegerToZeroOneBridge not working? (Alpine) #2517

LebedevRI opened this issue Jun 23, 2024 · 2 comments

Comments

@LebedevRI
Copy link

LebedevRI commented Jun 23, 2024

using JuMP
import HiGHS
import Alpine
import Ipopt
import SCIP

function main()
    model = Model(
        optimizer_with_attributes(
            Alpine.Optimizer,
            "nlp_solver"   => optimizer_with_attributes(Ipopt.Optimizer, "print_level" => 0),
            "mip_solver"   => optimizer_with_attributes(HiGHS.Optimizer, "output_flag" => false),
            "minlp_solver" => optimizer_with_attributes(SCIP.Optimizer,  "display/verblevel" => 0),
            "time_limit" => 10.0,
        ),
    )

    @variable(model, 0 <= X <= 2, Int)

    print(model)
    optimize!(model)
    solution_summary(model)
    @assert is_solved_and_feasible(model)
    @show value.(NumHardWires)
end

main()

currently yields

Alpine does not support MINLPs with generic integer (non-binary) variables yet!

Stacktrace:
  [1] error(s::String)
    @ Base ./error.jl:35
  [2] load!(m::Alpine.Optimizer)
    @ Alpine ~/.julia/packages/Alpine/2DP5q/src/main_algorithm.jl:100
  [3] optimize!(m::Alpine.Optimizer)
    @ Alpine ~/.julia/packages/Alpine/2DP5q/src/main_algorithm.jl:151
  [4] optimize!
    @ ~/.julia/packages/MathOptInterface/2CULs/src/Bridges/bridge_optimizer.jl:380 [inlined]
  [5] optimize!
    @ ~/.julia/packages/MathOptInterface/2CULs/src/MathOptInterface.jl:85 [inlined]
  [6] optimize!(m::MathOptInterface.Utilities.CachingOptimizer{MathOptInterface.Bridges.LazyBridgeOptimizer{Alpine.Optimizer}, MathOptInterface.Utilities.UniversalFallback{MathOptInterface.Utilities.Model{Float64}}})
    @ MathOptInterface.Utilities ~/.julia/packages/MathOptInterface/2CULs/src/Utilities/cachingoptimizer.jl:316
  [7] optimize!(model::Model; ignore_optimize_hook::Bool, _differentiation_backend::MathOptInterface.Nonlinear.SparseReverseMode, kwargs::@Kwargs{})
    @ JuMP ~/.julia/packages/JuMP/7rBNn/src/optimizer_interface.jl:595
  [8] optimize!
    @ ~/.julia/packages/JuMP/7rBNn/src/optimizer_interface.jl:546 [inlined]
  [9] main()
    @ Main ./In[10]:21
 [10] top-level scope
    @ In[10]:27

I thought #2205 was intended to resolve that, but apparently something is going wrong?

Refs. lanl-ansi/Alpine.jl#233

@odow
Copy link
Member

odow commented Jun 23, 2024

The issue is that Alpine says "yes, I support integer variables" so that it can throw a nicer error:
https://github.com/lanl-ansi/Alpine.jl/blob/a1849ddf464a9a567eeb9bb7c9707c77bbccbf88/src/MOI_wrapper/MOI_wrapper.jl#L325-L331

Things will probably work if we remove that line.

Closing because this is not a bug in MOI. I'll open an issue in Alpine.jl: lanl-ansi/Alpine.jl#244

@LebedevRI
Copy link
Author

@odow thank you! I wasn't quite sure where i should post this issue.

LebedevRI added a commit to LebedevRI/Alpine.jl that referenced this issue Jun 27, 2024
LebedevRI added a commit to LebedevRI/Alpine.jl that referenced this issue Aug 14, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Development

No branches or pull requests

2 participants