Hi. I’ve been struggling for nights with combinatorial optimization
Input = matrix with permutation.
Each row represents unit, and column means visit sequence for each place.
e.g) x = [ 1 2 3 4 ; 2 3 1 4 ; 3 1 2 4 ]
it means, First unit visits 1 first, and 2 3 4 in a row. Second unit visits 2 3 1 4
And also I made a function.
Based on markov chain, It calculate an expected complete time(=makespan).
function name is allinone(x). x is a matrix like above
My objective is to find an optimal x (visit sequence).
And if that is exist, I can calculate an expected complete time as well.
For this problem, I’ve searched for many packages, like JuMP, MHLib, ConstraintSolver, Combo(not available) and so on.
Based on that, I made a code like below.
using ConstraintSolver const CS = ConstraintSolver prio = [1 2 3 4; 2 3 1 4; 3 1 2 4] function testing() model = Model(CS.Optimizer) @variable(model, 1 <= x[1:3,1:4] <= 4, Int) for sqd = 1:3 @constraint(model, x[sqd,:] in CS.AllDifferent()) end @objective(model, Min, allinone(x)) optimize!(model) @show JuMP.value.(x) end testing()
But, When I put this, there is a error.
convert an object of type VariableRef to an object of type Int64”
How can handle this error? Can I get some advice?
And I’m not sure that I could solve this problem even if I handle this error.
So, Would you got some recommendation for this problem?
Thank you for reading this, and hope some replies.