Dear Liviu, I have another question for you:
is it possible to say to FET that two teachers ("A" and "B") never teach the same day of the other?
For example: if teacher "A" teaches on Monday and Thursday, "B" doesn't teach on these days, etc.
Please note that one has the constraint: 2 min and max day per week, the other 3 min and max days (total days per week in the institute are 5, so no problem)
Right now, I add to the activities of both teachers a third teacher "C", that must work for minimum 5 days, so to "spread" in all 5 days the "A and "B" activities (I use the feature called in italian: "compresenza", I dont' know the english translation...)
the "A" activities become "A"+"C" activities
and "B" activities become "B"+"C" activities
with "A": min/max 2 days
"B" min/max 3 days
"C": min/max 5 days
is there another cleaner way to obtain that?
Thank you!
Best regards
Luca
Hello, Luca :)
I do not understand the correctness of your method.
The procedure is simple in principle, but involves a lot of tedious work: add a constraint min 1 days between activities 100% for each pair of an activity of T1 and of T2. So, if they have each 10 activities, 10*10=100 constraints, which is a lot.
It is possible to create a custom version so that you won't have to work to input these constraints.
Hi Liviu
Thank you for your reply.
My solution worked, so I don't want to further bother you with a custom version.
I only try to be more clear with the explication of my solution, sorry if it wasn't understandable in my last post...
I remember that "A" works 2 days (not more, not less) and "B" 3 days (not more, not less). The week contains 5 days.
1) I created a dummy teacher "C"
2) I added this teacher to all activities of teachers "A" and "B"
3) I impose that teacher "C" works for min 5 days (the sum of the 2 days of "A" and the 3 days of "B"). This constraint forces FET to distribute all the activities of two teachers on 5 days: two of them will be "with" "A" (he can work only 2 days, not 3), the other "with" "B" (he can work only 3 days, not 4) so it won't be any overlapping between their activities. No possibility to have a day with activities of both teachers.... If there is a day with activities of both teachers, it implies that "A" or "B" work 1 day over the limit, or "C" works 1 day below the minimum... and this is impossible ... At least... I think! :)
I hope to have well explained it, but at the same time I don't wont that you "waste your time" with this question :)
Your opinion is too important for me, so I reflected a lot on this solution when you told me your doubts... and now I'm less sure than before!!
But so far, it works... ;D (unless it was only a question of luck, but I don't think so: I generated almost 10 timetables with this solution, all ok)
Have a nice evening!
Thank you
Luca
Hello, Luca,
Indeed, it seems correct. I drew a table on paper :)
Are you a mathematics teacher? :)
There is only one thing remaining: I think using many min days constraints or a customization to consider internally min days constraints might work faster. But it does not matter if you can obtain your solutions in an acceptable time. And it is always better to use the official FET, for me and for you.
Edit: Also, if the teachers do not have the magic 2 vs 3 working days in a 5 days week, your method does not work?
Depending on your dataset there might be an other easy solution:
if teacher A have got 2 activities with a 100% min day constraint and teacher B has 3 activities with a 100% min n day constraint, then you can just put that 5 activities to a min n day constraint (and of course you still need teacher A with max 2 days per week and B with max 3 days per week.)
Hi Liviu
Quote from: Liviu Lalescu on September 22, 2020, 08:44:23 PM
Are you a mathematics teacher? :)
No, I'm not, but I love math! :D
Quote from: Liviu Lalescu on September 22, 2020, 08:44:23 PM
There is only one thing remaining: I think using many min days constraints or a customization to consider internally min days constraints might work faster. But it does not matter if you can obtain your solutions in an acceptable time. And it is always better to use the official FET, for me and for you.
Thank you for you offer, I prefere me too to use the official version (by the way and sorry for the O.T.: I use a lot the feature you created last year after some emails with me, now in the official version: "Max span with exception +1" and it's really useful! Thanks again!)
Quote from: Liviu Lalescu on September 22, 2020, 08:44:23 PM
Edit: Also, if the teachers do not have the magic 2 vs 3 working days in a 5 days week, your method does not work?
I think (but I didn't go deeper in it) that it can work only if the sum of the worked days of the two teachers are less than the week duration. Obviously, you'll have to set the "C" duration = to this sum (not less, not more).
Only to explain: I need this because in next days probably the two teachers "A" and "B" will be "fused" in "A", so I'd like to have since now a timetable compliant with this situation. I'm telling you it because you could think that my two colleagues "A" and "B" hate each other and don't want to be at school in the same time :D (I'm joking!!)
Have a nice day!
Quote from: Volker Dirr on September 22, 2020, 09:26:05 PM
Depending on your dataset there might be an other easy solution:
if teacher A have got 2 activities with a 100% min day constraint and teacher B has 3 activities with a 100% min n day constraint, then you can just put that 5 activities to a min n day constraint (and of course you still need teacher A with max 2 days per week and B with max 3 days per week.)
Hi Volker!
Thank you for your suggestion
In my dataset, "A" has 4 activities and "B" 6 activities. Does your solution work also in this situation (putting all 10 activities in the constraint)? It was the first solution I thought on, but I'm not sure about the result...
Thank you again, have a nice day
Luca
Thank you, Luca, you too!
It's depeding on your dataset.
You said that teacher A has got 4 activities.
If all 4 activities are in different classes, then my suggestion doesn't work perfect (you can manual select 2 activities, but that is not perfect; might be not critical).
If there are 2 activities in the same group and they already have a min n day constraint with a very high weight (i always suggest only using 100% weight), then it is perfect to select that 2 activities for my suggested constraint.
Similar to the other teacher.
So if you can select 2 activities from teacher A and 3 activities from teacher B and you know that there should be a 100% min n day weight between them, then youst set that 5 activities into a min n day constraint with 100%.
Thank you, Volker