if two tasks are complete overlap, then it is allowed within capacity

36 views
Skip to first unread message

Zhiwei Feng

unread,
Jul 5, 2024, 3:19:36 AMJul 5
to or-tools-discuss
Hi All,

I just wonder if there exists any efficient way to model below:
if two interval task_i, and task_j are completely overlap (with same start, end, size), the overlap between them is allowed, otherwise, not. 
As in my real case, i have training task intervals. each training task means a trainer training a trainee. The capacity of the training task means that 1 trainer might be able to train several trainees at the same time. Ideally, the more parallel, the better. With the no_overlap function, it is easy to finish each training task interval noverlap with each other but only with 1 capacity. 
The similar cases like:

Thanks

Laurent Perron

unread,
Jul 5, 2024, 5:41:41 AMJul 5
to or-tools...@googlegroups.com
For the overlap part:

you have 3 states: a before b, a = b, a after b

you can create 3 bool vars.

a_before_b => end(a) <= start(b)
a_equal_b => start(a) == start(b) && a_equal_b => end(a) == end(b)
a_after_b => start(a) >= end(b)

and then

exactly_one(a_before_b, a_equal_b, a_after_b)
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/9062d950-8608-457d-88e7-478a95166e5fn%40googlegroups.com.
Reply all
Reply to author
Forward
0 new messages