Skip to content

Commit

Permalink
[docs] fix a bug in the Benders tutorial
Browse files Browse the repository at this point in the history
  • Loading branch information
odow authored Oct 2, 2024
1 parent 0d515c8 commit 8540c7b
Showing 1 changed file with 2 additions and 3 deletions.
5 changes: 2 additions & 3 deletions docs/src/tutorials/algorithms/benders_decomposition.jl
Original file line number Diff line number Diff line change
Expand Up @@ -168,9 +168,8 @@ objective_value(model)

# and the optimal flows are:

function optimal_flows(x_sol)
flows = [(i, j) => value(x[i, j]) for i in 1:n for j in 1:n]
return filter!(flow -> last(flow) > 0, flows)
function optimal_flows(x)
return [(i, j) => x[i, j] for i in 1:n for j in 1:n if x[i, j] > 0]
end

monolithic_solution = optimal_flows(value.(y))
Expand Down

0 comments on commit 8540c7b

Please sign in to comment.