Stuck generation and I don't know how to fix it

Started by infoo_, February 21, 2025, 10:59:40 PM

Previous topic - Next topic

0 Members and 1 Guest are viewing this topic.

Liviu Lalescu


Volker Dirr

Quote from: infoo_ on February 22, 2025, 09:19:02 PMBefore starting to remove students/teachers/activities, I would like to know if breaking 2+2 activities into 2+1+1 activities can fix the bug(s).
[...]
What do you think? Would it be possible to find those "magical" activities to try to make it solvable?

Might be possible. But for that I must read your data set more carefully to answer it. That is over my time limit for free support.

But in my opinion from my quick reading only: You have much too many teachers not available times. I bet at least a few of them have no "real" reason. You should remove them all if they are not 100% needed. Set max gaps constraints to make nice timetables for teachers.

Volker Dirr

Quote from: infoo_ on February 22, 2025, 09:23:52 PMTeachers not available times are done by teachers. They send their available times and I just put them into FET.

This year a lot of teachers have marked little available hours. They work on other schools, and we ask they to please mark wide availability times, but many do not do so-

I think this is 80% of the problem

Yes. That is a problem. It doesn't work like that. You will get impossible timetables if teachers can just choose the free times.
First: Teachers must tell you reasons. No good reason -> No not available time
Second: If they work at other schools, then it is clever if you talk with the timetable maker of the other school(s).

infoo_

I know...

Thank you for your help

With respect to 2A, @Volker Dirr deactivating this works fine 2A:

Min days between activities, WP:100%, NA:3, Id:73, Id:74, Id:75, mD:1, CSD:yes

After so many attempts, I see a problem with 4C and 5C. My timetable only has those groups. It got stuck

Volker Dirr

#19
As I already said: In my opinion removing min n day constraints is not a good variant to fix that problems. You should remove teachers not available times. It is much too easy to get impossible timetables if just a few teachers select the same not available times.
It is not normal that teachers can select so many not available times. In normal case teachers shouldn't have not available time constraints at all. Set only not available times if they are forced to work at that times. Don't give them not available times, just because they want to go shopping or sleep longer or clean the car or lawn mowing or watch tv. You must remove all that times. The teachers get paid for their work.

Volker Dirr

#20
There are many "bad" constraints and/or activity plannings in that data set.

For example teacher VAZQUEZ:
He is not available on the last day in the morning. He can only work in the evening.
But you gave him only activities of students that have no activities in the evening at all. They have only activities in the morning.
And you have a lot of those "bugs".

You must do a better activity planning or you must remove that not available time constraints of the teachers. The min n day constraints are needed by the students. You can't remove that constraints. The teachers get money to teach the students. You can't set the students bad constraints. You must remove the unnecessary not available time constraints from the teachers or you must do a better activity planning.

infoo_

#21
Thanks for looking the data

I am not sure if I understood you correctly

Quote from: Volker Dirr on February 23, 2025, 01:00:16 AMHe is not available on the last day in the morning. He can only work in the evening.

You mean on day VIERNES? Because he is free first three days on first seven hours (7 am to 12:05 am). And he is free on the last hour of every day (17:50 to 18:30). He has good availability in the mornings, but not so in the afternoons

Quote from: Volker Dirr on February 23, 2025, 01:00:16 AMBut you gave him only activities of students that have no activities in the evening at all. They have only activities in the morning.

VAZQUEZ teachs in groups 3A, 3B, 4A and 4B (morning groups). CERAVOLO (VAZQUEZ) teachs in groups 4C and 5C (afternoons).

VAZQUEZ and CERAVOLO (VAZQUEZ) are the same teacher, so he teachs both on mornings and afternoons. So that probably caused the confusion

In general, Ta and Tb (Ta) always refers to the same teacher Ta. This is due sometimes Tb (Ta) can have different availability times than Ta, and sometimes they share the same availability. That's why activities not overlapping constraints play a crucial role here: if those constraints were not present and a timetable with Ta teaching at same time as Tb (Ta) was found, it is not correct (Ta would be teaching in two groups at the same time)

Volker Dirr

#22
Quote from: infoo_ on February 23, 2025, 01:19:21 AM[...]VAZQUEZ teachs in groups 3A, 3B, 4A and 4B (morning groups).

Yes, but he is not available in the morning on Friday. He is only available in the evening. So he will never be able to teach in the evening, since he has only morning groups.
And it looks like you have also other teachers with those situations.

Like I said: You must remove all not available times that have not a good reason. In all other cases you will just get impossible timetables like now and if you don't remove those times, then you might only get solutions if you do very bad timetables for students or if you swap the teachers of activities. But that last 2 variants are bad. Remove that many not available time constraints. That is not normal. You can't let the teacher choose the not available hours. That is in normal case always impossible (except if you have much luck). If just a few teacher select the same not available time, you will get impossible data sets, like right now. You are the boss, you pay the teachers so you can tell them when they must come to work and when they don't need to come to work. If the teachers thinks shopping, walking with the dog and watching tv is more imported then earning money, then hire other teachers or pay them less money (I now, you can't do that by law. But I think you know what I want to tell you with that).
You can give the teachers nice timetables by adding max gaps time constraints with a low max value. And by adding min hours per day constraints. Most teachers will like that. (Yes, I know. I low number of teachers like gaps. So don't give that teachers a max gaps constraint or even add them a max continuously hours constraint)

infoo_

#23
Quote from: Volker Dirr on February 23, 2025, 10:53:59 AMAnd it looks like you have also other teachers with those situations.

Right. However, that does not imply bugs. Currently I am looking for the bug(s)

Quote from: Volker Dirr on February 23, 2025, 10:53:59 AMLike I said: You must remove all not available times that have not a good reason. In all other cases you will just get impossible timetables like now and if you don't remove those times, then you might only get solutions if you do very bad timetables for students or if you swap the teachers of activities. But that last 2 variants are bad. Remove that many not available time constraints. That is not normal. You can't let the teacher choose the not available hours. That is in normal case always impossible (except if you have much luck). If just a few teacher select the same not available time, you will get impossible data sets, like right now. You are the boss, you pay the teachers so you can tell them when they must come to work and when they don't need to come to work. If the teachers thinks shopping, walking with the dog and watching tv is more imported then earning money, then hire other teachers or pay them less money (I now, you can't do that by law. But I think you know what I want to tell you with that).
You can give the teachers nice timetables by adding max gaps time constraints with a low max value. And by adding min hours per day constraints. Most teachers will like that. (Yes, I know. I low number of teachers like gaps. So don't give that teachers a max gaps constraint or even add them a max continuously hours constraint)

I agree with you, but I am not a head of school. I will try to convince the authorities to talk with teachers

Today is Sunday, so tomorrow I will contact school

In the meantime I could not generate a timetable for courses 4C and 5C. I am convinced that there is at least a bug between those.

In the attached file you can see I have splitted the following activities (also I have fixed the slots of a constraint that I had put wrong):

    246 - 2/4 - ACCORINTI - MATEMATICA - 4C - 4C -
    THIS
    263 - 2/4 - TALARICO - LENGUA Y LITER - 4C - 4C -
    THIS
    319 - 2/4 - MIGUEZ - MATEMATICA - 5C - 5C -
    THIS
    321 - 2/4 - PASQUALI - QUIMICA - 5C - 5C -
    THIS
    327 - 2/4 - TALARICO - LENGUA Y LITER - 5C - 5C -
    THIS

You cannot view this attachment.

As you can see in the previous image, I took the job to try the 32 combinations between these 5 activities, alternating between the splitted ones (1+1) and the non-splitted ones (2).

In all generations it was stuck in about the same number of activities.

If you can take a look at it to identify the bug, I think it would be the starting point to notify the school of that, instead of asking them to talk to the majority of teachers throughout them.

That is, warning that some teachers of 2 courses must extend their available time is worth more than warning that teachers of 15 courses must extend their available time. And I'm determined to find it, but for now I couldn't

Thank you very much for your understanding and I appreciate any help

Volker Dirr

No time to read that all. Too much work for free support.
But you can check it yourself pretty quick: Set them all to 1+1 and set weight = 0%. Because FET is in that case allowed to place them together. If 1+1 with weight = 0% doesn't work, then all your combinations won't work. If you use weight = 0%, (and don't delete the min day constraint), then you can also see in the log file if FET placed them on the same day.

infoo_

#25
Quote from: Volker Dirr on February 23, 2025, 10:38:25 PMSet them all to 1+1 and set weight = 0%

What weight are you referring to? The activities don't have weight as far as I know, and min days constraints were deactivated before anything (those who impact 2+2 activities)

Volker Dirr

#26
If you already deleted the min n day constraints, then it is like 0%, just that you can't see in the log files if the activities are placed consecutive. In fact it even allows more, since they can be placed now not consecutive at the same day.
So if you set 1+1 and deleted the min n day, then ALL your combinations are IMPOSSIBLE, because 1+1 in fact allow to put them together to 2. You don't need to check anymore if 2 is possible. If 1+1 is impossible, then 2 is also impossible.
see the pictures here:
https://www.timetabling.de/manual/FET-manual.en.html#id_15

I must sleep now and work tomorrow. So It will take some time before reading here again.

infoo_

Quote from: Volker Dirr on February 23, 2025, 11:23:52 PMYou don't need to check anymore if 2 is possible. If 1+1 is impossible, then 2 is also impossible.

I tested with 2+2 and 2+1+1 activities, but you mean that testing with 2+1+1 also include 2+2 with all min days constraints deactivated?

Volker Dirr

If you testes 2+1+1 with weight 0% and it fails, then you already know that 2+2 is impossible, since 2+2 is a possible situation if you set 2+1+1 with weight 0% .
So you don't need to test 2+2 anymore.