Skip to content

Commit 5853d19

Browse files
committed
Update
1 parent 2ed12a0 commit 5853d19

File tree

1 file changed

+16
-23
lines changed

1 file changed

+16
-23
lines changed

src/algorithms/EpsilonConstraint.jl

Lines changed: 16 additions & 23 deletions
Original file line numberDiff line numberDiff line change
@@ -105,49 +105,42 @@ function minimize_multiobjective!(
105105
solutions = SolutionPoint[only(solution_1), only(solution_2)]
106106
f1, f2 = MOI.Utilities.eachscalar(f)
107107
MOI.set(inner, MOI.ObjectiveFunction{typeof(f2)}(), f2)
108-
# Add epsilon constraint
109-
variables = MOI.get(inner, MOI.ListOfVariableIndices())
110-
bound_1 = right - ε
111-
constant_1 = MOI.constant(f1, Float64)
112-
ci_1 = MOI.Utilities.normalize_and_add_constraint(
113-
inner,
114-
f1,
115-
MOI.LessThan(bound_1),
116-
)
117-
yN = max(solution_1[1].y[2], solution_2[1].y[2])
118-
constant_2 = MOI.constant(f2, Float64)
108+
# Add epsilon constraints
109+
u_1 = right
110+
c_1 = MOI.constant(f1, Float64)
111+
ci_1 =
112+
MOI.Utilities.normalize_and_add_constraint(inner, f1, MOI.LessThan(u_1))
113+
u_2 = max(solution_1[1].y[2], solution_2[1].y[2])
114+
c_2 = MOI.constant(f2, Float64)
119115
ci_2 =
120-
MOI.Utilities.normalize_and_add_constraint(inner, f2, MOI.LessThan(yN))
121-
bound_1 -= constant_1
116+
MOI.Utilities.normalize_and_add_constraint(inner, f2, MOI.LessThan(u_2))
117+
variables = MOI.get(inner, MOI.ListOfVariableIndices())
122118
status = MOI.OPTIMAL
123119
for _ in 3:n_points
124120
if (ret = _check_premature_termination(model)) !== nothing
125121
status = ret
126122
break
127123
end
128-
# First-stage solve: minimize f₂: f <= bound_1
124+
# First-stage solve: minimize f₂: f <= u₁ - ε
129125
MOI.set(inner, MOI.ObjectiveFunction{typeof(f2)}(), f2)
130-
MOI.set(inner, MOI.ConstraintSet(), ci_1, MOI.LessThan(bound_1))
131-
MOI.set(inner, MOI.ConstraintSet(), ci_2, MOI.LessThan(yN - constant_2))
126+
MOI.set(inner, MOI.ConstraintSet(), ci_1, MOI.LessThan(u_1 - c_1 - ε))
127+
MOI.set(inner, MOI.ConstraintSet(), ci_2, MOI.LessThan(u_2 - c_2))
132128
optimize_inner!(model)
133129
if !_is_scalar_status_optimal(model)
134130
break
135131
end
136132
# Second-stage solve: minimize f₁: f₂ <= f₂^*
137-
f_2_star = MOI.get(inner, MOI.ObjectiveValue())::Float64
133+
f_2_opt = MOI.get(inner, MOI.ObjectiveValue())::Float64
138134
MOI.set(inner, MOI.ObjectiveFunction{typeof(f1)}(), f1)
139-
bound_2 = f_2_star - constant_2
140-
MOI.set(inner, MOI.ConstraintSet(), ci_2, MOI.LessThan(bound_2))
135+
MOI.set(inner, MOI.ConstraintSet(), ci_2, MOI.LessThan(f_2_opt - c_2))
141136
optimize_inner!(model)
142137
if !_is_scalar_status_optimal(model)
143138
break
144139
end
145140
X, Y = _compute_point(model, variables, f)
146141
_log_subproblem_solve(model, Y)
147-
if isempty(solutions) || !(Y solutions[end].y)
148-
push!(solutions, SolutionPoint(X, Y))
149-
end
150-
bound_1 = min(Y[1] - constant_1 - ε, bound_1 - ε)
142+
push!(solutions, SolutionPoint(X, Y))
143+
u_1 = Y[1]
151144
end
152145
MOI.delete(inner, ci_1)
153146
MOI.delete(inner, ci_2)

0 commit comments

Comments
 (0)