How to use gurobi to implement interval variable in cplex.cp
AnsweredI use CpoInterVal in cplex to model a time interval variable, and use its parameter "optional" to indicate whether the variable must exist. Now I am going to use gurobi to reconstruct the project. How can I use gurobi to model this kind of variable?

Could you please describe in more detail or in best case point to the CPLEX docs or an article describing the object you are using?
0 
Thanks for your reply!
Here is my usage case: Previously I was using cplex to model a factory flexible jobshop problem. Each product has several processes, and each process is processed on a corresponding type of machine. But there are many machines of each type, whose working times and rest times are different, they don’t necessarily have to be used.
In cplex, I can easily use docplex.cp.expression.interval_var to model machine resources variable, and use its parameter "optional" as the machine variable presence indicator, use the function docplex.cp.modeler.start_of to return the start of a process interval variable I need.
So the problem is：Is there a certain interface to meet the above requirements? If not, could you please provide some modeling references or some use cases to handle Resource Constraint Programming problem of this kind.
Thank you for all your assistance！
0 
In cplex, I can easily use docplex.cp.expression.interval_var to model machine resources variable, and use its parameter "optional" as the machine variable presence indicator, use the function docplex.cp.modeler.start_of to return the start of a process interval variable I need.
So the problem is：Is there a certain interface to meet the above requirements? If not, could you please provide some modeling references or some use cases to handle Resource Constraint Programming problem of this kind.
The interval variable expression is part of the Constraint Programming Optimizer. Constraint Programming uses specialized modelling objects and is in this regard inherently different from MixedInteger Programming , see What are the differences between Constraint Programming and MIP? for more differences.
There is no simple way to implement an equivalent version of the interval variable with an optional status in MIPs. The papers by Bowman 1959, Kondili et al. 1988, Wagner 1959, Manne 1960, and Laurent et al. 2017 discuss MIP formulation for machine scheduling problems. Maybe there is something, you can use. However, please be aware that in the end it might just be that using a Constraint Programming solver is the best way to proceed.
Best regards,
Jaromił0 
Thanks a lot! I got your point.
0
Please sign in to leave a comment.
Comments
4 comments