Skip to content

Commit

Permalink
Update stack_management.jl
Browse files Browse the repository at this point in the history
  • Loading branch information
DimitriAlston committed Nov 7, 2024
1 parent 8f10e3b commit 8c92cab
Showing 1 changed file with 5 additions and 6 deletions.
11 changes: 5 additions & 6 deletions src/eago_optimizer/optimize/nonconvex/stack_management.jl
Original file line number Diff line number Diff line change
Expand Up @@ -236,27 +236,26 @@ $(TYPEDSIGNATURES)
Check the optimization problem for unbounded branching variables, which would interfere
with EAGO's branch-and-bound routine since there are no well-defined branching rules
for cases where the interval bounds contain `-Inf` or `Inf`. If any branching variables
are missing bounds, add the missing bound at +/- 1E10 and warn the user.
are missing bounds, add the missing bound at +/- 1E6 and warn the user.
"""
function unbounded_check!(m::GlobalOptimizer)
if m._parameters.unbounded_check
unbounded_flag = false
wp = m._working_problem
epigraph_flag = _variable_num(FullVar(), m) != m._input_problem._variable_count
for i = 1:_variable_num(BranchVar(), m) - epigraph_flag #Not including epigraph reformulation variable
for i = 1:_variable_num(BranchVar(), m)
if !wp._variable_info[i].has_lower_bound
unbounded_flag = true
wp._variable_info[i] = VariableInfo(wp._variable_info[i], GT(-1E10))
wp._variable_info[i] = VariableInfo(wp._variable_info[i], GT(-1E6)) # Some solvers break if bounds are too large
end
if !wp._variable_info[i].has_upper_bound
unbounded_flag = true
wp._variable_info[i] = VariableInfo(wp._variable_info[i], LT(1E10))
wp._variable_info[i] = VariableInfo(wp._variable_info[i], LT(1E6)) # Some solvers break if bounds are too large
end
end
unbounded_flag && @warn("""
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
generated at +/- 1E6 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`.""")
end
Expand Down

0 comments on commit 8c92cab

Please sign in to comment.