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
13 changes: 13 additions & 0 deletions src/algorithms/DominguezRios.jl
Original file line number Diff line number Diff line change
Expand Up @@ -148,6 +148,10 @@ function _update!(
return
end

_isapprox(::Nothing, ::_DominguezRiosBox) = false

_isapprox(A::_DominguezRiosBox, B::_DominguezRiosBox) = A.l ≈ B.l && A.u ≈ B.u

function minimize_multiobjective!(algorithm::DominguezRios, model::Optimizer)
@assert MOI.get(model.inner, MOI.ObjectiveSense()) == MOI.MIN_SENSE
n = MOI.output_dimension(model.f)
Expand Down Expand Up @@ -190,13 +194,22 @@ function minimize_multiobjective!(algorithm::DominguezRios, model::Optimizer)
solutions = SolutionPoint[]
k = 0
status = MOI.OPTIMAL
B_prev = Vector{Union{Nothing,_DominguezRiosBox}}(nothing, n)
while any(!isempty(l) for l in L)
if (ret = _check_premature_termination(model)) !== nothing
status = ret
break
end
i, k = _select_next_box(L, k)
B = L[k][i]
# We check for the repeated search of similar boxes in the same
# optimization direction. If the same box was searched before, we delete
# it from the list of boxes.
if _isapprox(B_prev[k], B)
deleteat!(L[k], i)
continue
end
B_prev[k] = B
# We're going to scale `w` here by `scale` instead of the usual
# `1 / max(...)`. It will show up in a few places bbelow.
w = scale ./ max.(1, B.u - yI)
Expand Down
19 changes: 19 additions & 0 deletions test/algorithms/DominguezRios.jl
Original file line number Diff line number Diff line change
Expand Up @@ -152,6 +152,25 @@ function test_vector_of_variables_objective()
return
end

function test_lp()
model = MOI.instantiate(; with_bridge_type = Float64) do
return MOA.Optimizer(HiGHS.Optimizer)
end
MOI.set(model, MOA.Algorithm(), MOA.DominguezRios())
MOI.set(model, MOI.Silent(), true)
x = MOI.add_variables(model, 2)
MOI.add_constraint(model, x[1], MOI.GreaterThan(0.0))
MOI.add_constraint(model, x[2], MOI.Interval(0.0, 3.0))
MOI.add_constraint(model, 3.0 * x[1] - 1.0 * x[2], MOI.LessThan(6.0))
MOI.set(model, MOI.ObjectiveSense(), MOI.MIN_SENSE)
f = MOI.Utilities.vectorize([3.0 1.0; -1.0 -2.0] * x)
MOI.set(model, MOI.ObjectiveFunction{typeof(f)}(), f)
MOI.optimize!(model)
@test MOI.get(model, MOI.TerminationStatus()) == MOI.OPTIMAL
@test MOI.get(model, MOI.ResultCount()) > 1
return
end

end # module TestDominguezRios

TestDominguezRios.run_tests()
Loading