Skip to content
Merged
Show file tree
Hide file tree
Changes from 11 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
12 changes: 12 additions & 0 deletions src/algorithms/DominguezRios.jl
Original file line number Diff line number Diff line change
Expand Up @@ -190,13 +190,25 @@ function minimize_multiobjective!(algorithm::DominguezRios, model::Optimizer)
solutions = SolutionPoint[]
k = 0
status = MOI.OPTIMAL
B_prevs = Vector{Union{Nothing,_DominguezRiosBox}}(nothing, n)
iter = 0
while any(!isempty(l) for l in L)
iter += 1
if (ret = _check_premature_termination(model)) !== nothing
status = ret
break
end
i, k = _select_next_box(L, k)
B = L[k][i]
if iter > n
if !isnothing(B_prevs[k])
if (B_prevs[k].l ≈ B.l) && (B_prevs[k].u ≈ B.u)
deleteat!(L[k], i)
continue
end
end
end
B_prevs[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