Julia JuMP - array index which is an index of another array

Viewed 74

I have to solve a problem with permutations. The function takes vector a with n elements as a parameter. I declare b as @variable - there should be the permutation 1:n that gives the best result after finding the solution of a problem. The error appears when I want to create @constraint. I have to use a[b[1]], so it takes the first element from vector which is a variable. It gives my error, that I can't use type VariableRef as a index of an array. But how can I get around this when I have to use it?

1 Answers

I sounds as if you have two optimisation problems one of which is an integer programming problem. You might think about separating the two.

(Sorry for not writing a comment, my reputation is still too low ;-) )

Related