diff --git a/docs/src/tutorials/algorithms/tsp_lazy_constraints.jl b/docs/src/tutorials/algorithms/tsp_lazy_constraints.jl index f6b6e43325a..82dd8871eea 100644 --- a/docs/src/tutorials/algorithms/tsp_lazy_constraints.jl +++ b/docs/src/tutorials/algorithms/tsp_lazy_constraints.jl @@ -116,7 +116,7 @@ import Plots # The vertices are assumed to be randomly distributed in the Euclidean space; # thus, the weight (distance) of each edge is defined as follows. -function generate_distance_matrix(n; random_seed = 1234) +function generate_distance_matrix(n; random_seed = 1) rng = Random.MersenneTwister(random_seed) X = 100 * rand(rng, n) Y = 100 * rand(rng, n) @@ -124,7 +124,7 @@ function generate_distance_matrix(n; random_seed = 1234) return X, Y, d end -n = 40 +n = 20 X, Y, d = generate_distance_matrix(n) # For the JuMP model, we first initialize the model object. Then, we create the @@ -252,7 +252,6 @@ function subtour_elimination_callback(cb_data) if !(1 < length(cycle) < n) return # Only add a constraint if there is a cycle end - println("Found cycle of length $(length(cycle))") S = [(i, j) for (i, j) in Iterators.product(cycle, cycle) if i < j] con = @build_constraint( sum(lazy_model[:x][i, j] for (i, j) in S) <= length(cycle) - 1,