@@ -30,19 +30,20 @@ function _update_search_region(
30
30
y:: Vector{Float64} ,
31
31
yN:: Vector{Float64} ,
32
32
)
33
- bounds_to_remove = Vector{Float64}[]
34
33
p = length (y)
34
+ bounds_to_remove = Vector{Float64}[]
35
+ bounds_to_add = Dict{Vector{Float64},Vector{Vector{Vector{Float64}}}}()
35
36
for u in keys (U_N)
36
37
if all (y .< u)
37
38
push! (bounds_to_remove, u)
38
39
for l in 1 : p
39
40
u_l = _get_child (u, y, l)
40
41
N = [
41
- k != l ? [yi for yi in U_N[u][k] if yi[l] < y[l]] : [y ]
42
+ k == l ? [y] : [ yi for yi in U_N[u][k] if yi[l] < y[l]]
42
43
for k in 1 : p
43
44
]
44
- if all (! isempty (N[k]) for k in 1 : p if u_l[k] ≠ yN[k])
45
- U_N [u_l] = N
45
+ if all (! isempty (N[k]) for k in 1 : p if k != l && u_l[k] != yN[k])
46
+ bounds_to_add [u_l] = N
46
47
end
47
48
end
48
49
else
@@ -53,27 +54,31 @@ function _update_search_region(
53
54
end
54
55
end
55
56
end
56
- for bound_to_remove in bounds_to_remove
57
- delete! (U_N, bound_to_remove )
57
+ for u in bounds_to_remove
58
+ delete! (U_N, u )
58
59
end
60
+ merge! (U_N, bounds_to_add)
59
61
return
60
62
end
61
63
62
64
function _get_child (u:: Vector{Float64} , y:: Vector{Float64} , k:: Int )
63
65
@assert length (u) == length (y)
64
- return vcat (u[1 : k- 1 ], y[k], u[k+ 1 : length (y)])
66
+ return vcat (u[1 : ( k- 1 ) ], y[k], u[( k+ 1 ) : length (y)])
65
67
end
66
68
67
69
function _select_search_zone (
68
70
U_N:: Dict {Vector{Float64},Vector{Vector{Vector{Float64}}}},
69
71
yI:: Vector{Float64} ,
72
+ yN:: Vector{Float64} ,
70
73
)
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]
74
+ upper_bounds = collect (keys (U_N))
75
+ p = length (yI)
76
+ hvs = [
77
+ u[k] == yN[k] ? 0.0 : prod (_project (u, k) .- _project (yI, k)) for
78
+ k in 1 : p, u in upper_bounds
79
+ ]
80
+ k_star, j_star = argmax (hvs). I
81
+ return k_star, upper_bounds[j_star]
77
82
end
78
83
79
84
function optimize_multiobjective! (
@@ -100,7 +105,6 @@ function optimize_multiobjective!(
100
105
warm_start_supported = true
101
106
end
102
107
solutions = Dict {Vector{Float64},Dict{MOI.VariableIndex,Float64}} ()
103
- YN = Vector{Float64}[]
104
108
variables = MOI. get (model. inner, MOI. ListOfVariableIndices ())
105
109
n = MOI. output_dimension (model. f)
106
110
yI, yN = zeros (n), zeros (n)
@@ -114,7 +118,7 @@ function optimize_multiobjective!(
114
118
return status, nothing
115
119
end
116
120
_, Y = _compute_point (model, variables, f_i)
117
- yI[i] = Y + 1
121
+ yI[i] = Y
118
122
model. ideal_point[i] = Y
119
123
MOI. set (model. inner, MOI. ObjectiveSense (), MOI. MAX_SENSE)
120
124
MOI. optimize! (model. inner)
@@ -124,7 +128,7 @@ function optimize_multiobjective!(
124
128
return status, nothing
125
129
end
126
130
_, Y = _compute_point (model, variables, f_i)
127
- yN[i] = Y
131
+ yN[i] = Y + 1
128
132
end
129
133
MOI. set (model. inner, MOI. ObjectiveSense (), MOI. MIN_SENSE)
130
134
U_N = Dict{Vector{Float64},Vector{Vector{Vector{Float64}}}}()
@@ -136,7 +140,7 @@ function optimize_multiobjective!(
136
140
status = MOI. TIME_LIMIT
137
141
break
138
142
end
139
- k, u = _select_search_zone (U_N, yI)
143
+ k, u = _select_search_zone (U_N, yI, yN )
140
144
MOI. set (
141
145
model. inner,
142
146
MOI. ObjectiveFunction {typeof(scalars[k])} (),
0 commit comments