CP-SAT - Modelling alternate resources in RCPSP

234 views
Skip to first unread message

Dan G

unread,
Jan 15, 2025, 2:19:44 AM1/15/25
to or-tools-discuss
Hello everyone,

Happy new year to all of you and your loved ones. I wish that this year all of you reach optimality as fast as possible.

I have a scheduling model that relies on :
  • Time constraint such as before_task_start + task_duration <= after_task_start...
  • Cumulative to ensure that the resource are not exceeded
For some of my tasks, I would like to specify precisely with resource is used. For instance, instead of having a capacity of 3 machines, I would like to know which task is performed on which machine (A, B or C), knowing that the machine can process the task at the different consumption of resource.

My question is about the modelling part. For now, my first approach would be to create a cumulative constraint for each machine and a interval for each possible task on the machine and use the constraint add_exactly_one() to ensure that only one machine is used.

Since I am not used to all the concepts of scheduling and how to solve it in the best way, I am wondering if there is a more efficient way to model it.

Thank you in advance for your answer.

Best Regards,
Dan


Laurent Perron

unread,
Jan 15, 2025, 2:54:06 AM1/15/25
to or-tools-discuss
There is a complete rcpsp_sat.py example. 

--
You received this message because you are subscribed to the Google Groups "or-tools-discuss" group.
To unsubscribe from this group and stop receiving emails from it, send an email to or-tools-discu...@googlegroups.com.
To view this discussion visit https://groups.google.com/d/msgid/or-tools-discuss/e6553c6d-991f-4565-97e6-22705470d227n%40googlegroups.com.

Dan G

unread,
Jan 22, 2025, 4:58:31 AM1/22/25
to or-tools-discuss
Thank you.
With the example, I implemented additional Cumulative for the alternative resource and I used an add_exactly_one constraint to choose between the intervals.

Best Regards,
Dan

Laurent Perron

unread,
Jan 22, 2025, 5:08:37 AM1/22/25
to or-tools...@googlegroups.com
Yes, but this is already covered by the multi-mode rcpsp specification.
No need to change the code, just the data.
Laurent Perron | Operations Research | lpe...@google.com | (33) 1 42 68 53 00



Dan G

unread,
Jan 23, 2025, 4:23:50 AM1/23/25
to or-tools-discuss
Thank you Laurent. Your remark opened my mind and I am now reading about the multi-mode RCPSP and see how can I adapt my data for it.

Have a nice day.
Dan
Reply all
Reply to author
Forward
0 new messages