An IF-ELSE statement but involving variable changes
AnsweredI am modeling a complex scheduling problem, specifically, I am faced with a queue re-scheduling problem. In my model, \(\delta_{ijm}\) means that in queue m, i is the first of j. But considering an interjection, when \(\delta_{ijm}=1\) and an expression is satisfied, I need to let \(\delta_{ijm}=0, \delta_{ikm}=1, \delta_{kjm}=1\), representing the interjection of k into the queue between i and j

You can see that you must let \(\delta_{ijm}=1\) when the above equation makes sense, but below you must let \(\delta_{ijm}=0\), which is confusing to me
So how to express it in Gurobi (python),or how should I reform the equations?
-
I think that the statement
But considering an interjection, when \(\delta_{ijm}=1\) and an expression is satisfied, I need to let \(\delta_{ijm}=0, \delta_{ikm}=1, \delta_{kjm}=1\), representing the interjection of k into the queue between i and j
is incorrect. You are saying that if \(\delta_{ijm}=1\) and some expression, let's say \(ax \leq 0\) is satisfied then it should actually be \(\delta_{ijm}=0\), which is a contradiction to itself because then \(\delta_{ijm}\) should be \(0\) from the beginning.
If you want to model an actual variable change, then you will have to work with auxiliary variables. You could call them variable duplicates \(\delta, \delta'\) where it holds that \(\delta = \delta'\) unless \(\delta = 1\) and \(ax \leq 0\) holds where it would be \(\delta'=0\).
0
Please sign in to leave a comment.
Comments
1 comment