I don’t quite get how you can have k2<>k1 on this particular constraint, since k1 is already a running index on the left hand side, you cannot get a specific k1 outside the sum. For example, if the set contains 4 elements:{ s1,s2,s3,s4}, and l=s4, so on the left you have
y(s1,s4)+y(s2,s4)+y(s3,s4)
what do you want the right side to be?
Hi @deannezhang
Thanks for your reply! Please allow me to explain this constraint.
This is for a routing problem like TSP, y(k,l) is binary indicating whether location l will be visited immediately after location k.
So what I want from this constraint is to make sure the input degree must be equal to the output degree. But without setting k1<>k2, the solution will return a loop between two locations as y(s1,s4)=y(s4,s1), which is not what I’m looking for (and I couldn’t directly set y(k,l)|l>k since it will set the model to infeasible).
Now I got what you are saying. So on my right side, the value of k2 actually depends on the running result of k1 of the left side.That’s why I couldn’t add it.
So if I couldn’t directly set k1<>k2 here, is there any other way to get this done? Like using a subset or something? Or will this be solved after I add the subtour elimination? I’m sorry I’m really new to AIMMS and a little bit lost. Any help will be appreciated! Thanks!