Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
15 changes: 15 additions & 0 deletions src/eago_optimizer/domain_reduction.jl
Original file line number Diff line number Diff line change
Expand Up @@ -416,6 +416,7 @@ function fbbt! end

function fbbt!(m::GlobalOptimizer, f::AffineFunctionIneq)

fbbt_tolerance = _fbbt_tolerance(m)
# Compute full sum
lower_bounds = m._lower_fbbt_buffer
upper_bounds = m._upper_fbbt_buffer
Expand Down Expand Up @@ -444,9 +445,15 @@ function fbbt!(m::GlobalOptimizer, f::AffineFunctionIneq)
if aik > 0.0
(xh < xL) && return false
(xh > xL) && (@inbounds upper_bounds[i] = min(xh, xU))
if abs(upper_bounds[i] - lower_bounds[i]) <= fbbt_tolerance
@inbounds upper_bounds[i] = lower_bounds[i]
end
elseif aik < 0.0
(xh > xU) && return false
(xh < xU) && (@inbounds lower_bounds[i] = max(xh, xL))
if abs(upper_bounds[i] - lower_bounds[i]) <= fbbt_tolerance
@inbounds lower_bounds[i] = upper_bounds[i]
end
else
temp_sum -= min(aik_xL, aik_xU)
continue
Expand All @@ -460,6 +467,8 @@ function fbbt!(m::GlobalOptimizer, f::AffineFunctionIneq)
end

function fbbt!(m::GlobalOptimizer, f::AffineFunctionEq)

fbbt_tolerance = _fbbt_tolerance(m)
# Compute full sum
lower_bounds = m._lower_fbbt_buffer
upper_bounds = m._upper_fbbt_buffer
Expand Down Expand Up @@ -495,11 +504,17 @@ function fbbt!(m::GlobalOptimizer, f::AffineFunctionEq)
(xh_leq > xL) && (@inbounds upper_bounds[i] = min(xh_leq, xU))
(xh_geq > xU) && return false
(xh_geq < xU) && (@inbounds lower_bounds[i] = max(xh_geq, xL))
if abs(upper_bounds[i] - lower_bounds[i]) <= fbbt_tolerance
@inbounds lower_bounds[i] = upper_bounds[i]
end
elseif aik < 0.0
(xh_leq > xU) && return false
(xh_leq < xU) && (@inbounds lower_bounds[i] = max(xh_leq, xL))
(xh_geq < xL) && return false
(xh_geq > xL) && (@inbounds upper_bounds[i] = min(xh_geq, xU))
if abs(upper_bounds[i] - lower_bounds[i]) <= fbbt_tolerance
@inbounds lower_bounds[i] = upper_bounds[i]
end
else
temp_sum_leq -= min(aik_xL, aik_xU)
temp_sum_geq -= max(aik_xL, aik_xU)
Expand Down
17 changes: 10 additions & 7 deletions src/eago_optimizer/types/global_optimizer.jl
Original file line number Diff line number Diff line change
Expand Up @@ -163,11 +163,11 @@ Base.@kwdef mutable struct EAGOParameters
obbt_depth::Int = 6
"Number of repetitions of OBBT to perform in preprocessing (default = 3)"
obbt_repetitions::Int = 3
"Turn on aggresive OBBT (default = true)"
"Turn on aggressive OBBT (default = true)"
obbt_aggressive_on::Bool = true
"Maximum iteration to perform aggresive OBBT (default = 2)"
"Maximum iteration to perform aggressive OBBT (default = 2)"
obbt_aggressive_max_iteration::Int = 2
"Minimum dimension to perform aggresive OBBT (default = 2)"
"Minimum dimension to perform aggressive OBBT (default = 2)"
obbt_aggressive_min_dimension::Int = 2
"Tolerance to consider bounds equal (default = 1E-10)"
obbt_tolerance::Float64 = 1E-10
Expand All @@ -177,6 +177,8 @@ Base.@kwdef mutable struct EAGOParameters
fbbt_lp_depth::Int = 1000
"Number of repetitions of linear FBBT to perform in preprocessing (default = 3)"
fbbt_lp_repetitions::Int = 3
"Tolerance to consider bounds equal (default = 1E-8)"
fbbt_tolerance::Float64 = 1E-8

# Duality-Based Bound Tightening (DBBT) options
"Depth in B&B tree above which duality-based bound tightening should be disabled (default = 1E10)"
Expand All @@ -196,10 +198,10 @@ Base.@kwdef mutable struct EAGOParameters
"Outer-round computed subgradient bounds by this amount (default = 1E-10)"
subgrad_tol::Float64 = 1E-10
"Select the type of relaxation to use for the bilinear term (multiplication): 0 corresponds to
a standard McCormick arithmetic approach. Settings 1-3 augment the standard McCormick relaxation
with implied apriori relaxations: (1) corresponds to a subgradient-based apriori relaxation approach; (2)
corresponds to an affine arithmetic-based apriori approach; and (3) corresponds to a enumerative apriori
relaxation-based approach (default = 0)"
a standard McCormick arithmetic approach. Settings 1-3 augment the standard McCormick relaxation
with implied a priori relaxations: (1) corresponds to a subgradient-based a priori relaxation approach; (2)
corresponds to an affine arithmetic-based a priori approach; and (3) corresponds to a enumerative a priori
relaxation-based approach (default = 0)"
mul_relax_style::Int = 0

# Tolerance to add cuts and max number of cuts
Expand Down Expand Up @@ -914,6 +916,7 @@ end

@inline _fbbt_lp_depth(m::GlobalOptimizer) = m._parameters.fbbt_lp_depth
@inline _fbbt_lp_repetitions(m::GlobalOptimizer) = m._parameters.fbbt_lp_repetitions
@inline _fbbt_tolerance(m::GlobalOptimizer) = m._parameters.fbbt_tolerance

@inline _obbt_depth(m::GlobalOptimizer) = m._parameters.obbt_depth
@inline _obbt_repetitions(m::GlobalOptimizer) = m._parameters.obbt_repetitions
Expand Down
Loading