Skip to content
Open
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
10 changes: 4 additions & 6 deletions ext/Polyhedra/GeneralDichotomy.jl
Original file line number Diff line number Diff line change
Expand Up @@ -24,9 +24,8 @@ function MOA.minimize_multiobjective!(
# Storage we need for the algorithm.
weights, solutions = Weight[], MOA.SolutionPoint[]
n_obj = MOI.output_dimension(model.f)
# First, minimize the first objective to obtain a primal feasible point.
w = zeros(Float64, n_obj)
w[1] = 1.0
# First, minimize the combined objectives to obtain a primal feasible point.
w = ones(Float64, n_obj)

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
w = ones(Float64, n_obj)
w = fill(1 / n_obj, n_obj)

Does it matter?

status, solution = MOA._solve_weighted_sum(model, alg, w)
if solution === nothing
return status, nothing
Expand All @@ -40,7 +39,7 @@ function MOA.minimize_multiobjective!(
w[i] = 1.0
z = w' * solution.y
adj_bnd = Int[-j for j in 1:n_obj if j != i]
push!(weights, Weight(w, z, adj_bnd, [1], i == 1, false))
push!(weights, Weight(w, z, adj_bnd, [1], false, false))
end
# Prevent solution duplicates: existing_sol maps an rounded objective vector
# to its index in `solutions::Vector{MOA.SolutionPoint}`.
Expand All @@ -59,8 +58,7 @@ function MOA.minimize_multiobjective!(
end
status, sol = MOA._solve_weighted_sum(model, alg, weight.w)
if sol === nothing
# TODO(odow): what to do when this solve fails?
return status, solutions
return MOI.NUMERICAL_ERROR, solutions
end
weight.tested = true
if !haskey(existing_sol, _round(sol.y; atol))
Expand Down
Loading