Skip to content

Commit 124da84

Browse files
committed
Fixed ideal points for KS and TV and the selection and update procedure for the search region of TV
1 parent dabce8d commit 124da84

File tree

2 files changed

+23
-25
lines changed

2 files changed

+23
-25
lines changed

src/algorithms/KirlikSayin.jl

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -111,7 +111,7 @@ function optimize_multiobjective!(algorithm::KirlikSayin, model::Optimizer)
111111
return status, nothing
112112
end
113113
_, Y = _compute_point(model, variables, f_i)
114-
yI[i] = Y + 1
114+
yI[i] = Y
115115
model.ideal_point[i] = Y
116116
MOI.set(
117117
model.inner,
@@ -125,7 +125,7 @@ function optimize_multiobjective!(algorithm::KirlikSayin, model::Optimizer)
125125
return status, nothing
126126
end
127127
_, Y = _compute_point(model, variables, f_i)
128-
yN[i] = Y
128+
yN[i] = Y + 1
129129
end
130130
# Reset the sense after modifying it.
131131
MOI.set(model.inner, MOI.ObjectiveSense(), sense)

src/algorithms/TambyVanderpooten.jl

Lines changed: 21 additions & 23 deletions
Original file line numberDiff line numberDiff line change
@@ -26,23 +26,21 @@ reformulation is solved using one of the defining points as a starting solution.
2626
struct TambyVanderpooten <: AbstractAlgorithm end
2727

2828
function _update_search_region(
29-
U_N::Dict{Vector{Float64},Vector{Vector{Vector{Float64}}}},
30-
y::Vector{Float64},
31-
yN::Vector{Float64},
29+
U_N::Dict{Vector{Float64}, Vector{Vector{Vector{Float64}}}},
30+
y::Vector{Float64},
31+
yN::Vector{Float64},
3232
)
33-
bounds_to_remove = Vector{Float64}[]
3433
p = length(y)
34+
bounds_to_remove = Vector{Float64}[]
35+
bounds_to_add = Dict{Vector{Float64}, Vector{Vector{Vector{Float64}}}}()
3536
for u in keys(U_N)
3637
if all(y .< u)
3738
push!(bounds_to_remove, u)
3839
for l in 1:p
3940
u_l = _get_child(u, y, l)
40-
N = [
41-
k != l ? [yi for yi in U_N[u][k] if yi[l] < y[l]] : [y]
42-
for k in 1:p
43-
]
44-
if all(!isempty(N[k]) for k in 1:p if u_l[k] yN[k])
45-
U_N[u_l] = N
41+
N = [k == l ? [y] : [yi for yi in U_N[u][k] if yi[l] < y[l]] for k in 1:p]
42+
if all(!isempty(N[k]) for k in 1:p if k != l && u_l[k] != yN[k])
43+
bounds_to_add[u_l] = N
4644
end
4745
end
4846
else
@@ -53,9 +51,10 @@ function _update_search_region(
5351
end
5452
end
5553
end
56-
for bound_to_remove in bounds_to_remove
57-
delete!(U_N, bound_to_remove)
54+
for u in bounds_to_remove
55+
delete!(U_N, u)
5856
end
57+
merge!(U_N, bounds_to_add)
5958
return
6059
end
6160

@@ -66,14 +65,14 @@ end
6665

6766
function _select_search_zone(
6867
U_N::Dict{Vector{Float64},Vector{Vector{Vector{Float64}}}},
69-
yI::Vector{Float64},
68+
yI::Vector{Float64},
69+
yN::Vector{Float64},
7070
)
71-
i, j =
72-
argmax([
73-
prod(_project(u, k) - _project(yI, k)) for k in 1:length(yI),
74-
u in keys(U_N)
75-
]).I
76-
return i, collect(keys(U_N))[j]
71+
upper_bounds = collect(keys(U_N))
72+
p = length(yI)
73+
hvs = [u[k] == yN[k] ? 0. : prod(_project(u, k) .- _project(yI, k)) for k in 1:p, u in upper_bounds]
74+
k_star, j_star = argmax(hvs).I
75+
return k_star, upper_bounds[j_star]
7776
end
7877

7978
function optimize_multiobjective!(
@@ -100,7 +99,6 @@ function optimize_multiobjective!(
10099
warm_start_supported = true
101100
end
102101
solutions = Dict{Vector{Float64},Dict{MOI.VariableIndex,Float64}}()
103-
YN = Vector{Float64}[]
104102
variables = MOI.get(model.inner, MOI.ListOfVariableIndices())
105103
n = MOI.output_dimension(model.f)
106104
yI, yN = zeros(n), zeros(n)
@@ -114,7 +112,7 @@ function optimize_multiobjective!(
114112
return status, nothing
115113
end
116114
_, Y = _compute_point(model, variables, f_i)
117-
yI[i] = Y + 1
115+
yI[i] = Y
118116
model.ideal_point[i] = Y
119117
MOI.set(model.inner, MOI.ObjectiveSense(), MOI.MAX_SENSE)
120118
MOI.optimize!(model.inner)
@@ -124,7 +122,7 @@ function optimize_multiobjective!(
124122
return status, nothing
125123
end
126124
_, Y = _compute_point(model, variables, f_i)
127-
yN[i] = Y
125+
yN[i] = Y + 1
128126
end
129127
MOI.set(model.inner, MOI.ObjectiveSense(), MOI.MIN_SENSE)
130128
U_N = Dict{Vector{Float64},Vector{Vector{Vector{Float64}}}}()
@@ -136,7 +134,7 @@ function optimize_multiobjective!(
136134
status = MOI.TIME_LIMIT
137135
break
138136
end
139-
k, u = _select_search_zone(U_N, yI)
137+
k, u = _select_search_zone(U_N, yI, yN)
140138
MOI.set(
141139
model.inner,
142140
MOI.ObjectiveFunction{typeof(scalars[k])}(),

0 commit comments

Comments
 (0)