Conditional 5th and 6th Period Assignment

Started by limesanoj, June 18, 2019, 07:42:56 AM

Previous topic - Next topic

0 Members and 1 Guest are viewing this topic.


What is the approach or solution if we have a constraint that a teacher should not be assigned both the 5th period and 6th period. In other words, if he has a class in the 5th period already, he should be free during the 6th period. Or if he has been assigned the 6th period, he should be free during the 5th period. But it is OK if he is free in both the 5th and 6th periods. Thank you.


Add a dummy activity to the teacher with no student set. Now add a constraint "Activity has preferred starting times" and select 5th and 6th hour for this dummy activity.


Thank you so much @Nagendra for your solution. It was able to generate the desired timetable.  :)

Liviu Lalescu

Yes, and also this is possible:

- Add for each teacher for each day a constraint activities occupy max time slots from selection, all activities of that teacher, selected slots = 5 and 6 of that day, max occupied = 1. You need to update if you add/remove activities for a teacher.