College fortnightly activities and avoiding gaps

Started by Liviu Lalescu, October 03, 2022, 11:23:49 AM

Previous topic - Next topic

0 Members and 1 Guest are viewing this topic.

Liviu Lalescu

Recently (yesterday) I had the opportunity to tackle the problem of fortnightly (once at two weeks) activities and students' gaps. In Romanian colleges there are such activities, say with tag "odd week" or "even week", and if they are not placed at the beginning or the end of the students' days they will generate gaps in the other week than they will be scheduled in reality (in FET, they will be scheduled each week, because the timetable is done for a single week).

So, I took the file and did this: tripled the students sets, one is "original", one is "original-odd-week", and the other is "original-even-week". Then tripled the activities (removing the tags for room constraints for the odd week and even week ones, because a room accepts only a single activity at a time), where the second set of activities has no teachers and odd students, and the third set of activities had the even students, and added same starting time constraints for each 3 activities: original, odd week, and even week. Then deactivated, for odd week students, the activities which had the tag "even week", and the same for even week students, deactivated the activities which had the tag "odd week".

This way, odd week students will have 0 gaps and even week students will have 0 gaps (along with all students having 0 gaps).

These changes to the file were done by some tricky code changes (about a page of new code).

I think a similar procedure can be done for teachers, but I think in our exact practical case this is unnecessary.

It seems to work (I don't have yet confirmation from the user with this timetable).


I have two ideas
first we assume that we have a week of N days
we create the real week RW and an imaginary week IW (which will be a waste week) each of length N ( afet week of length 2N)
let's call real week A the firstreal and odd week and real week B the second real and even week
we  divide each real groups of students in two, for example the real group 1 is divided into 1A and 1B as well as for the teacher T who teaches the lessons per fortnight (TA and TB)
each real room R is a virtual room (Fet room
each weekly activity contains teachers TA and TB and students 1A and 1B and is assigned real rooms and must start in the real week RW .each course per fortnight is made up of two activities :an odd containing a tag A containing teacher TA and the 1A students and the other even containing the tag B and the teacher TB and the 1B students and
 the activities of tag A are assigned fet rooms with suffixes A and those with tag B the fet rooms  with suffixes B then we add the min day N constraint between each pair so that among each pair only one will be assigned to the real week RW and the other in the imaginary week IW which we will not take into account


beware if you use the min hours daily constraint for students or teachers, we may have to add imaginary activities containing the student or teacher in question


the second idea
we work with a week of duration 2N
the first half is week A and the second half is week B
each weekly activity is doubled in two: one containing tag A and the other tag B with the following constraints:
max day between the N
min days between them N
max different room between them 1
all tag A activities start week A and tag B activities start week B
it represents the most realistic model of the situation


the only problem with the second approach is the enormous number of constraints to be entered
maybe it will be useful to automate them in a future version

Volker Dirr

If there are only a few fortnightly activities, i still recommend to use "workarounds" like i wrote it in the manual: