Skip to content

Commit afa5214

Browse files
authored
[docs] update column generation tutorial (#4074)
1 parent a0ed4c6 commit afa5214

File tree

1 file changed

+10
-9
lines changed

1 file changed

+10
-9
lines changed

docs/src/tutorials/algorithms/cutting_stock_column_generation.jl

Lines changed: 10 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -55,10 +55,10 @@ end
5555
function get_data()
5656
data = [
5757
75.0 38
58-
75.0 44
59-
75.0 30
60-
75.0 41
61-
75.0 36
58+
70.0 41
59+
68.4 34
60+
65.5 23
61+
59.6 18
6262
53.8 33
6363
53.0 36
6464
51.0 41
@@ -237,8 +237,9 @@ set_silent(model)
237237
optimize!(model)
238238
assert_is_solved_and_feasible(model)
239239
solution_summary(model)
240+
Test.@test isapprox(objective_value(model), 386; atol = 1e-6) #src
240241

241-
# This solution requires 421 rolls. This solution is sub-optimal because the
242+
# This solution requires 386 rolls. This solution is sub-optimal because the
242243
# model does not contain the full set of possible patterns.
243244

244245
# How do we find a new column that leads to an improved solution?
@@ -356,9 +357,9 @@ filter!(row -> row.rolls > 0, solution)
356357

357358
# Since we solved a linear program, some of our columns have fractional
358359
# solutions. We can create a integer feasible solution by rounding up the
359-
# orders. This requires 341 rolls:
360+
# orders. This requires 306 rolls:
360361

361-
Test.@test sum(ceil.(Int, solution.rolls)) == 341 #src
362+
Test.@test sum(ceil.(Int, solution.rolls)) == 306 #src
362363
sum(ceil.(Int, solution.rolls))
363364

364365
# Alternatively, we can re-introduce the integrality constraints and resolve the
@@ -372,9 +373,9 @@ solution = DataFrames.DataFrame([
372373
])
373374
filter!(row -> row.rolls > 0, solution)
374375

375-
# This now requires 334 rolls:
376+
# This now requires 299 rolls:
376377

377-
Test.@test isapprox(sum(solution.rolls), 334; atol = 1e-6) #src
378+
Test.@test isapprox(sum(solution.rolls), 299; atol = 1e-6) #src
378379
sum(solution.rolls)
379380

380381
# Note that this may not be the global minimum because we are not adding new

0 commit comments

Comments
 (0)