[CP-SAT] Modelling a mimimum in a cumulative constraint

364 views
Skip to first unread message

Dan G

unread,
Oct 23, 2023, 4:25:59 AM10/23/23
to or-tools-discuss
Hello,

We are solving a RCPSP. We are using Cumulative constraints to limit the capacity. Our endusers would like to ensure that the activity is at least above a certain level. For instance, we will not load a given machine if it has not at least a workload of X kg.


From my understanding, we need to switch from Cumulative to Reservoir constraints.
Are we right or we are missing something more efficient in modelling?

Thanks in advance for your answer.

Best Regards,
Dan

Dan G

unread,
Oct 23, 2023, 8:48:57 AM10/23/23
to or-tools-discuss
Looking further into the reservoir constraint definition, I think we are wrong .

To clarify my question, we have intervals and associated demands. We would like that the demands d on any given time slot t should respect the following constraints

\forall t;  \sum demands_t = 0 or min_{capacity} <= \sum demands_t <= max_{capacity}

Thanks in advance.
Dan

Laurent Perron

unread,
Oct 23, 2023, 9:38:25 AM10/23/23
to or-tools...@googlegroups.com
This is an extremely hard constraint to propagate, and it is not supported directly.

You will need to iterate over all time points, and add the contributions of all demands that cross that time point.
This is a 'heavy' model.
Laurent Perron | Operations Research | lpe...@google.com | (33) 1 42 68 53 00



--
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 on the web visit https://groups.google.com/d/msgid/or-tools-discuss/07c23ef7-9806-4b25-bd57-18e322d832e4n%40googlegroups.com.

Dan G

unread,
Oct 24, 2023, 4:36:01 AM10/24/23
to or-tools-discuss
Hello Laurent,

Thank you for your answer. We will try to find another way to model this kind of constraint, maybe by reducing the number of days possible and then post processed the solution.

Best Regards,
Dan

David Lubinsky

unread,
Oct 24, 2023, 6:03:12 AM10/24/23
to or-tools...@googlegroups.com
You might be better off with a big outer loop searching for the right number of machines of each type.  If all machines are the same a simple binary search will work, if you have different machine types you can look at more unconstrained solutions to guess the best machine mix and solve again. 

Laurent Perron

unread,
Mar 30, 2024, 5:16:55 AM3/30/24
to or-tools...@googlegroups.com

Laurent Perron | Operations Research | lpe...@google.com | (33) 1 42 68 53 00


Reply all
Reply to author
Forward
0 new messages