Skip to content

Commit 0e80722

Browse files
authored
[TambyVanderpooten] relax the tolerances used to compare objectives (#196)
1 parent f5db69d commit 0e80722

1 file changed

Lines changed: 22 additions & 4 deletions

File tree

src/algorithms/TambyVanderpooten.jl

Lines changed: 22 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -32,6 +32,24 @@ This algorithm is restricted to problems with:
3232
"""
3333
struct TambyVanderpooten <: AbstractAlgorithm end
3434

35+
"""
36+
const _TAMBY_VANDERPOOTEN_ATOL = 1e-3
37+
38+
This constant is important.
39+
40+
When we have a solution, we need to decide if the `Y` vector is at the edge of
41+
one of the bounds. The paper assumes exact arithmetic. Solvers have tolerances.
42+
43+
In theory the algorithm works only for problems with integer-valued objectives.
44+
So we could make this as big as `0.5` or something. We previously used `1e-6`,
45+
but this caused problems when the solver's feasibility tolerance meant that the
46+
objective value was something like `1234.00005`.
47+
48+
In future, we could consider how to rewrite the algorithm to make it more robust
49+
to numerical issues like this.
50+
"""
51+
const _TAMBY_VANDERPOOTEN_ATOL = 1e-3
52+
3553
# This is Algorithm 1 from the paper.
3654
function _update_search_region(
3755
U_N::Dict{Vector{Float64},Vector{Vector{Vector{Float64}}}},
@@ -110,7 +128,7 @@ function _select_search_zone(
110128
)
111129
k_star, u_star, v_star = 1, yN, -Inf
112130
for k in 1:length(yI), u in keys(U_N)
113-
if !isapprox(u[k], yN[k]; atol = 1e-6)
131+
if !isapprox(u[k], yN[k]; atol = _TAMBY_VANDERPOOTEN_ATOL)
114132
v = _h(k, u, yI)
115133
if v > v_star
116134
k_star, u_star, v_star = k, u, v
@@ -240,7 +258,7 @@ function _minimize_multiobjective!(
240258
push!(V[k], (u, Y))
241259
# We want `if !(Y in U_N[u][k])` but this tests exact equality. We
242260
# want an approximate comparison.
243-
if all(!isapprox(Y; atol = 1e-6), U_N[u][k])
261+
if all(!isapprox(Y; atol = _TAMBY_VANDERPOOTEN_ATOL), U_N[u][k])
244262
_update_search_region(U_N, Y, yN)
245263
solutions[Y] = X
246264
end
@@ -270,7 +288,7 @@ end
270288

271289
function _clean_search_region_inner(u′, U_N, yI, V, k)
272290
for (u′_k, yI_k) in zip(u′, yI)
273-
if isapprox(u′_k, yI_k; atol = 1e-6)
291+
if isapprox(u′_k, yI_k; atol = _TAMBY_VANDERPOOTEN_ATOL)
274292
return true
275293
end
276294
end
@@ -285,7 +303,7 @@ function _clean_search_region_inner(u′, U_N, yI, V, k)
285303
end
286304

287305
function _comparison_line_16(u′, u, y_k, k)
288-
if !(y_k[k], u′[k]; atol = 1e-6)
306+
if !(y_k[k], u′[k]; atol = _TAMBY_VANDERPOOTEN_ATOL)
289307
return false
290308
end
291309
for (i, (u′_i, u_i)) in enumerate(zip(u′, u))

0 commit comments

Comments
 (0)