EAGO unbounded variables

Hello!

I want to run the following code:

function bivariate(solver, type)
    try
        #choose which solver you want to use
        m = Model(solver.Optimizer)

        #function we want to Optimize
        f(x1,x2) = -x1 -x2
        
        #Variables in the optimization model
        @variable(m, x1)
        @variable(m, x2)

        #use piecewiselinear to solve the probem and set method to the type of formulation you want to test
        #Logarithmic or MC
        z = piecewiselinear(m, 
        x1,
        x2,
        #start: step: stop
        0: 0.5: 1,
        0: 0.5: 1,
        (x1, x2) -> (-x1 - x2);
        method = type,
        )

        #constraints of the model 
        @constraint(m, (x1)^2 + (x2)^2 <= 1)
        @constraint(m, 0 <= x1 <= 2)
        @constraint(m, 0 <= x2 <= 2)

        #objective of the model 
        @objective(m, Min, z) 
        
        #optimize the model 
        optimize!(m)

        value_x1 = value.(x1)
        value_x2 = value.(x2)

        return true, value_x1, value_x2

    catch exeption 
        println(exeption.msg)
        value_x1 = "-"
        value_x2 = "-"
        return exeption.msg, value_x1, value_x2
    end
end

Whenever I select EAGO as solver, I get the following warning:

┌ Warning: At least one branching variable is unbounded. This will interfere with EAGO's global
│ optimization routine and may cause unexpected results. Bounds have been automatically
│ generated at +/- 1e10 for all unbounded variables, but tighter user-defined bounds are
│ highly recommended. To disable this warning and the automatic generation of bounds, use
│ the option `unbounded_check = false`.
└ @ EAGO C:\Users\kikiv\.julia\packages\E

However, I cannot find where there would be unbounded variables. Does pieceweiselinear introduce these?

Kind regards,
Kiki

Hi @kiki_Van_Elsen, welcome to the forum :smile:

Instead of:

        @variable(m, x1)
        @variable(m, x2)
        @constraint(m, 0 <= x1 <= 2)
        @constraint(m, 0 <= x2 <= 2)

do

        @variable(m, 0 <= x1 <= 2)
        @variable(m, 0 <= x2 <= 2)

Your version is equivalent to

        @variable(m, -Inf <= x1 <= Inf)
        @variable(m, -Inf <= x2 <= Inf)
        @constraint(m, 0 <= 1.0 * x1 + 0.0 <= 2)
        @constraint(m, 0 <= 1.0 * x2 + 0.0 <= 2)

JuMP adds variable bounds only if you specify them in @variable. We don’t interpret @constraint(model, x >= 0) as a variable bound, but as the linear constraint 1 x + 0 \ge 0.

Having said that, depending on the method you choose, piecewiselinear might also add unbounded variables.

Thank you so much!

I now no longer get a warning for the method :MC.
Do you perhaps know why I still get the warning for the Logarithmic method? I do not immediately see what kind of unbounded variable is added there.

I’m not sure. I don’t know the details of the formulation inside PiecewiseLinearOpt.

Note that this is just a warning. You’re probably fine to ignore it.