Skip to content

Commit f3cf90c

Browse files
committed
Update
1 parent 0d4ba59 commit f3cf90c

File tree

1 file changed

+14
-9
lines changed

1 file changed

+14
-9
lines changed

src/algorithms/DominguezRios.jl

Lines changed: 14 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -148,6 +148,10 @@ function _update!(
148148
return
149149
end
150150

151+
_isapprox(::Nothing, ::_DominguezRiosBox) = false
152+
153+
_isapprox(A::_DominguezRiosBox, B::_DominguezRiosBox) = A.l B.l && A.u B.u
154+
151155
function minimize_multiobjective!(algorithm::DominguezRios, model::Optimizer)
152156
@assert MOI.get(model.inner, MOI.ObjectiveSense()) == MOI.MIN_SENSE
153157
n = MOI.output_dimension(model.f)
@@ -190,7 +194,7 @@ function minimize_multiobjective!(algorithm::DominguezRios, model::Optimizer)
190194
solutions = SolutionPoint[]
191195
k = 0
192196
status = MOI.OPTIMAL
193-
B_prevs = Vector{Union{Nothing,_DominguezRiosBox}}(nothing, n)
197+
B_prev = Vector{Union{Nothing,_DominguezRiosBox}}(nothing, n)
194198
iter = 0
195199
while any(!isempty(l) for l in L)
196200
iter += 1
@@ -200,15 +204,16 @@ function minimize_multiobjective!(algorithm::DominguezRios, model::Optimizer)
200204
end
201205
i, k = _select_next_box(L, k)
202206
B = L[k][i]
203-
if iter > n
204-
if !isnothing(B_prevs[k])
205-
if (B_prevs[k].l B.l) && (B_prevs[k].u B.u)
206-
deleteat!(L[k], i)
207-
continue
208-
end
209-
end
207+
# We check for the repeated search of similar boxes
208+
# in the same optimization direction. We wait for n
209+
# iterations so that every direction has at least
210+
# one box. If the same box were search before, we
211+
# delete it from the list of boxes.
212+
if _isapprox(B_prev[k], B)
213+
deleteat!(L[k], i)
214+
continue
210215
end
211-
B_prevs[k] = B
216+
B_prev[k] = B
212217
# We're going to scale `w` here by `scale` instead of the usual
213218
# `1 / max(...)`. It will show up in a few places bbelow.
214219
w = scale ./ max.(1, B.u - yI)

0 commit comments

Comments
 (0)