Skip to content

Commit

Permalink
[docs] fix benders_decomposition.jl
Browse files Browse the repository at this point in the history
  • Loading branch information
odow authored Oct 4, 2023
1 parent df022a5 commit 5d7cc17
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions docs/src/tutorials/algorithms/benders_decomposition.jl
Original file line number Diff line number Diff line change
Expand Up @@ -239,7 +239,7 @@ y_optimal = optimal_ret.y
lazy_model = Model(GLPK.Optimizer)
@variable(lazy_model, x[1:dim_x] >= 0, Int)
@variable(lazy_model, θ >= M)
@objective(lazy_model, Min, θ)
@objective(lazy_model, Min, c_1' * x + θ)
print(lazy_model)

# What differs is that we write a callback function instead of a loop:
Expand All @@ -266,7 +266,7 @@ function my_callback(cb_data)
return
end
cut = @build_constraint>= ret.obj + -ret.π' * A_1 * (x .- x_k))
MOI.submit(model, MOI.LazyConstraint(cb_data), cut)
MOI.submit(lazy_model, MOI.LazyConstraint(cb_data), cut)
return
end

Expand Down

0 comments on commit 5d7cc17

Please sign in to comment.