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.

infoo_

Hello

I tried to generate a timetable from the attached file, but 2 seconds later it get stucks at 257 out of 323 activities.

It seems the path to found a solution is similar to this answer:

Quote from: Volker Dirr on January 18, 2023, 11:37:29 AMSo please check carefully in the first problem (with time constraint) which activity is number 283.
Then delete the constraints. And check the order of the activities is changed. The old activity 283 might no be at a totaly different place! Please let FET generate and check if it was able to place the "old 283" (might be now "400"). Only if it place the activity you might have found the problem. Check the new activity that isn't able to be placed. It might be a new problem or still the old one! If it is a new problem, then fix the new problem. If you can't see a problem, then it might be still the old problem! In that case the old acitity 283 and the "new" activity have the "same" problem. (So they might share the same room, the same teacher or the same room). If both activities have such a "share" thing, then normaly there is the bug that you need to solve.

It's hard for me to figure out how to solve it. That is, I do not understand the steps to follow.

All activated constraints are necessary. Maybe splitting subactivities can work, but I don't realize which is the first one I should pay attention to.

I tried to read the menu dialog. It starts saying:

QuotePlease check the constraints related to following possibly problematic activity (or teacher(s), or students set(s)):
-- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- --
Id: 131 (    1/5 - RODRIGUEZ - LENGUA Y LITER - 2C - 2C)
-- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- --

But then it says:

QuotePlease check the constraints related to the last activities in the list below, which might be impossible to schedule:

Here are the placed activities which lead to an inconsistency, in order from the first one to the last (the last one FET failed to schedule and the last ones are most likely impossible):

Then a long list of activities are mentioned, so I guess I should start looking the last ones of that list, which are:

Quote...
No: 250, Id: 61 (    2/5 - TALARICO - LENGUA Y LITER - 1C - 1C)
No: 251, Id: 124 (    2/5 - MIGUEZ - MATEMATICA - 2C - 2C)
No: 252, Id: 80 (1 - PRIMA - T. ED DIGITAL - 2C - 2C)
No: 253, Id: 196 (2/4 -     RUSSO - ORGANIZACIONES - 3C - 3C)
No: 254, Id: 130 (    2/5 - RODRIGUEZ - LENGUA Y LITER - 2C - 2C)
No: 255, Id: 129 (2/5 -     RODRIGUEZ - LENGUA Y LITER - 2C - 2C)
No: 256, Id: 131 (    1/5 - RODRIGUEZ - LENGUA Y LITER - 2C - 2C)
No: 257, Id: 195 (    2/4 - RODRIGUEZ - LENGUA Y LITER - 3C - 3C)
No: 258, Id: 194 (2/4 -     RODRIGUEZ - LENGUA Y LITER - 3C - 3C)

Volker says "please check carefully in the first problem (with time constraint)" but I don't know if it related to the first activity of the list (id 131) or the last activity of the list (id 194).

How to proceed?

infoo_

#1
I can't find the problem.

All my attempts were on afternoon (1º 12:50-13:30 and so on) because the menu dialog throws a lot of activities related to those hours.

So I manually checked that teachers available times constraints fill necessary slots for total duration of activities in courses 1C,2C,3C,4C and 5C.

Then I splitted some 2+2 activities (min days between=1 constraint) into 2+1+1. For each new activity created, two min days=1 constraints were added.

I also tried to deactivate some min days between constraints for courses 2C,3C without success.

What could be happening?

Liviu Lalescu

The id 131 is what made the generation impossible, because it is the highest activity which could not be placed.

Volker Dirr

It is always good to try a minimum example to catch the bug.
In your case it is in group 2c.
See attached file and fix the bug there.

infoo_

Hello

Quote from: Liviu Lalescu on February 22, 2025, 05:08:35 AMThe id 131 is what made the generation impossible, because it is the highest activity which could not be placed.

I guess this is the id number from where we need to start checking. Ok.

Then you say "because it is the highest activity which could not be placed", what does "highest activity" mean?

infoo_

#5
SORRY, I (Volker Dirr) sadly modified your/this post :-(

Liviu Lalescu

Quote from: infoo_ on February 22, 2025, 08:34:00 PMHello

Quote from: Liviu Lalescu on February 22, 2025, 05:08:35 AMThe id 131 is what made the generation impossible, because it is the highest activity which could not be placed.

I guess this is the id number from where we need to start checking. Ok.

Then you say "because it is the highest activity which could not be placed", what does "highest activity" mean?

The activities are placed in order, say A1,..,Ai-1,Ai,Ai+1,...,An. This is the initial order reported by FET. If FET cannot place from Ai to An, then Ai is the highest I was referring to, and A1...Ai define an impossible partial data.

infoo_

Quote from: Liviu Lalescu on February 22, 2025, 08:38:59 PMThe activities are placed in order, say A1,..,Ai-1,Ai,Ai+1,...,An. This is the initial order reported by FET. If FET cannot place from Ai to An, then Ai is the highest I was referring to, and A1...Ai define an impossible partial data.

How can A1,..,Ai-1,Ai,Ai+1,...,An be placed in order if FET cannot place from Ai to An? It wouldn't be called "ordered placed activities", isn't it? Sorry if it is a silly question, but it is hard for me to understand the fundamentals about the generation

Liviu Lalescu

Quote from: infoo_ on February 22, 2025, 08:42:10 PM
Quote from: Liviu Lalescu on February 22, 2025, 08:38:59 PMThe activities are placed in order, say A1,..,Ai-1,Ai,Ai+1,...,An. This is the initial order reported by FET. If FET cannot place from Ai to An, then Ai is the highest I was referring to, and A1...Ai define an impossible partial data.

How can A1,..,Ai-1,Ai,Ai+1,...,An be placed in order if FET cannot place from Ai to An? It wouldn't be called "ordered placed activities", isn't it? Sorry if it is a silly question, but it is hard for me to understand the fundamentals about the generation

FET tries to place A1,...,Ai-1, and places them. Then it cannot place Ai.

A1...An is only the initial order, and FET tries to place them in this order. A1 is the most difficult activity, An is the easiest.

Volker Dirr

Ahh... Sorry. I sadly modified your post :-(
@Liviu, is there a way to UNDO my modification of post #5 ?

I only wanted to answer:
QuoteHowever, this is not enough for the original file

Because you have more bugs in your file.
Just do again a minimum example file with only group 2a. It also doesn't generate. You must fix that bug.

BTW: In my opinion deactivating that min day time constraint is not a clever bug fix, since you might get in worst case 3 hours continuously. You should think about the bug more detailed and find a better solution.

infoo_

Quote from: Liviu Lalescu on February 22, 2025, 08:44:09 PMFET tries to place A1,...,Ai-1, and places them. Then it cannot place Ai.

A1...An is only the initial order, and FET tries to place them in this order. A1 is the most difficult activity, An is the easiest.

Ok.

Quote from: Volker Dirr on February 22, 2025, 08:59:44 PMBecause you have more bugs in your file.
Just do again a minimum example file with only group 2a. It also doesn't generate. You must fix that bug.

BTW: In my opinion deactivating that min day time constraint is not a clever bug fix, since you might get in worst case 3 hours continuously. You should think about the bug more detailed and find a better solution.

Your "not clever bug fix" was right. Even with min days constraints deactivated it does not finish generating.

The report places 4C as a problematic group. Also 2A.

I will be extremely grateful if you guide me to find the bug. I don't need you to give me the solution, but where to start looking

Liviu Lalescu

Volker, I think there is no Undo on the forum.

infoo_, you can remove students/teachers/activities until a minimum file is unsolvable. You can choose which activities to remove from the initial order. Remove Ai+1, ..., An. Remove constraints while the file is still unsolvable.


Volker Dirr

#12
Yes. In your example file you can remove all (except the basic) room constraints.
And you can remove all students, except group 2a.
You will see, that this minimum example is also not solve able.
You need to find a good bug fix for that minimum example also.
(It looks like you have very many teachers not available times. Please think carefully about that. You should use that only if it is 100% needed; don't use it if a teacher want to have free at that time, just because he likes it. There must be a critical reason for this; like working at an other school. In all other cases you should only use max gaps constraints to make nice timetables for teachers.)

infoo_

#13
Ok. I will try to do it.

Before 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).

However, I don't know if there is an automatization for this to divide all 2+2 into 2+1+1, because doing it manually takes too long

I remember from previous timetables that with a couple of activities divided in that way, satisfactory schedules were found by FET.

What do you think? Would it be possible to find those "magical" activities to try to make it solvable?

infoo_

#14
Quote from: Volker Dirr on February 22, 2025, 09:14:49 PMYou will see, that this minimum example is also not solve able.

I see. As asked before, maybe breaking 2+2 acts into 2+1+1 can help a lot?

Quote from: Volker Dirr on February 22, 2025, 09:14:49 PM(It looks like you have very many teachers not available times. Please think carefully about that. You should use that only if it is 100% needed; don't use it if a teacher want to have free at that time, just because he likes it. There must be a critical reason for this; like working at an other school. In all other cases you should only use max gaps constraints to make nice timetables for teachers.)

Teachers 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