I have 2 sets of tasks each with start and end times, I want to enforce a constraint that ensures that 2 tasks do not overlap with each other. I know that in constraint programming we have specialised constraints such as AddNoOverlap
, but how can I achieve the above through mixed integer programming (open source solvers). Below is the starter code :
# start and end times of a pair of tasks
# task 1
s1 = 9
d1 = 10
# task 2
s2 = 3
d2 = 5
def no_overlap(model, s1, d1, s2, d2):
# ensure that task 1 and task 2 do not overlap
pass