Dear all, I have the following optimization problem implemented:
using JuMP, CPLEX, Printf
n=50
function Problem(c)
modelo = Model(with_optimizer(CPLEX.Optimizer))
(n, n) = size(c)
@variable(modelo, x[1:n,1:n], Bin)
@objective(modelo, Min, sum(sum(c[i,j]*x[i,j] for j=1:n) for i=1:n) )
@constraints modelo begin
c1[i=1:n], sum(x[i,j] for j=1:n) == 10
c2[j=1:n], sum(x[i,j] for i=1:n) == 10
end
status=optimize!(modelo)
X=value.(x)
return X
end
for i=1:10
c=-2 .+ round.(7*rand(n,n))
XStar = Problem(c)
end
There is a simple way to save the optimum variables “XStar” in 10 different archives (.jl or .dat) whose name depends of counter “i”?
Best regards.