Skip to content
Merged
Changes from 1 commit
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?

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

At this stage, this weight is not kept to be part of the "decomposition", so its range does not matter here. (1,..,1) is unlikely to ba an "extreme weight" since extreme weights verify w dot y^1 = w dot y^2 = ... (usually there is equality for d solutions if there are d objectives). This is really the same as the dichotomy method.

In the main loop, all extreme weights are obtained from the Polyhedron vertices enumerations, so they verify both the range and the equality. (and initial weights e.g. (1,0,..,0) verify this as well when there is one recorded solution)

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
Comment thread
odow marked this conversation as resolved.
Outdated
weight.tested = true
if !haskey(existing_sol, _round(sol.y; atol))
Expand Down
Loading