Iterative equations with dependence of Gurobi variables
AnsweredHello!
I have a problem in which I want to calculate the value of R. R is calculated with an iterative equation (see figure), that stops at convergence (Rn+1 = Rn). In the summatory, only the tasks j with higher priority (hp) than i are considered. If a task has higher priority or not than other, is evaluated in a Gurobi binary variable. My question is:
How could I implement an iterative process that depends on a Gurobi variable?
I can't find any information or hint.
Many thanks in advance.

-
Official comment
This post is more than three years old. Some information may not be up to date. For current information, please check the Gurobi Documentation or Knowledge Base. If you need more help, please create a new post in the community forum. Or why not try our AI Gurobot?. -
Hi Ana,
To introduce an iterative algorithm within an optimization model, you have to introduce an optimization variable for each iterative step \(R_{i}^{n}\). Thus, the maximum number of iterations has to be finite and known a priori. Then, you have to introduce each step of the iterative process as an equality constraint. Please note that it is important to set a valid lower and upper bound for each iteration optimization variable \(R_{i}^{n}\).
Best regards,
Jaromił0 -
Many thanks for your answer, Jaromil.
To know valid bounds for each iteration variable is not a problem. I think I can estimate the maximum number of iterations too.
Do you know where can I find documentation or examples of similar problems?
Many thanks again.
Best,
Ana
0 -
Hi Ana,
I am not aware of any specific examples targeting Gurobi. However, I know a nonlinear example of such an application. Section 5 of Mitsos et al. (2009) describes two similar applications. Therein, the iterative algorithms modeled in an optimization manner are integration algorithms using the central-difference formula and the explicit Euler method. I hope this helps.
Best regards,
Jaromił0 -
Many thanks again.
Best,
Ana.
0
Post is closed for comments.
Comments
5 comments