I have few tasks t1, t2, t3, t4, t5
which need to be assigned to resources r1, r2
, the tasks are located across multiple districts d1, d2
, for example t1, t2, t3
are located in district d1
and t4, t5
are located in district d2
. Each task have some duration like t1 : 3 hours, t2 : 3 hours, t3 : 4 hours, t4 : 4 hours, t5 : 5 hours
also each resource have 8 hours
of daily capacity.
Here my question is how shall I create decision variables and constraints considering following requirements
- How do I enforce that in a day resource can only be in one district ?
In other words, if resource is in
district d1
then he can only attendt1, t2, t3
- task
t3
can only be assigned toresource r1
.