lanl-ansi / Alpine.jl

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

Confused about the problems supported in Alpine #233

Closed Vaibhavdixit02 closed 1 year ago

Vaibhavdixit02 commented 1 year ago

Describe the bug

ERROR: 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/qayiX/src/main_algorithm.jl:100
 [3] optimize!(m::Alpine.Optimizer)
   @ Alpine ~/.julia/packages/Alpine/qayiX/src/main_algorithm.jl:151

I got this when trying to solve the https://github.com/lanl-ansi/Alpine.jl/blob/master/examples/MINLPs/integer.jl#L122 problem in the examples through the MOI interface (not the jump implementation there directly), am I doing something wrong?

harshangrjn commented 1 year ago

What you are observing is expected to be so. Alpine does not support integer variables at this point. In case you are still interested to solve an integer variable problem, any integer-valued variable can be reformulated as a problem with binary variables. For example, if x in {-2, -1, 0, 1, 2}, a set of additional binary variables z_i could be introduced with these additional constraints:

x = -2*z_1  - z_2 + z_3 + 2*z_4
z_1 + z_2 + z_3 + z_4 <= 1
z_i in {0,1},  i in [1:4]

With the above reformulation, you could use Alpine.

To reduce the confusion, will drop the integer.jl from examples folder.

Vaibhavdixit02 commented 1 year ago

Ah, that's an interesting point, though if it can't be done automatically it seems pretty cumbersome to do it manually. Do you think that can be something handled here?

I'll close this issue since the point is resolved

odow commented 1 year ago

We could have a bridge for the case that the variable bounds are also finite.

harshangrjn commented 1 year ago

Yes - at this point, a large bound is added for every unbounded variable, with a warning so that it could build the relaxations.