min activities in a building

Started by Benahmed Abdelkrim, February 28, 2026, 11:14:18 AM

Previous topic - Next topic

0 Members and 2 Guests are viewing this topic.

Benahmed Abdelkrim

Hello!
Could you please take a look at these two files? One has the building constraint: minimum 1 activity, and the other doesn't. However, the generation speed and behavior are not the same. There's a 50-second difference (T_without constraint=5s, T_with constraint=55s. The random seed used is the same.
The 2 generated timetables are identical!

s10=1, s11=1, s12=0,
s20=1, s21=1, s22=0.
B.A/krim

Liviu Lalescu

Hello, Benahmed,

I will have a look at your files a bit later (now I am compiling a snapshot). However, as I told you, the new constraint min 1 activity in a building is very slow. Maybe by luck you obtained without the constraint a solution, and then adding the constraint makes things much slower.

The finishing random seeds are the same?

Benahmed Abdelkrim

Quote from: Liviu Lalescu on March 12, 2026, 11:05:11 AMThe finishing random seeds are the same?
Yes, they are the same?!

s10=2243316414, s11=4198963596, s12=1764949901,
s20=1050249024, s21=2683648393, s22=2170710787.
B.A/krim

Liviu Lalescu

Yes, Benahmed, I checked also on my computer, the same. So, with the new constraint it is 10 times slower... :(

I apologize, but I cannot make the new constraint faster. It is checking very much information when running.

I am sure that if you find a solution for the "without" file, which does not respect the min hours new constraint, the behavior and the final seed will be different for the "with" file, but of course much slower on average.

Benahmed Abdelkrim

Quote from: Liviu Lalescu on March 12, 2026, 11:51:31 AMYes, Benahmed, I checked also on my computer, the same. So, with the new constraint it is 10 times slower... :(

I apologize, but I cannot make the new constraint faster. It is checking very much information when running.

I am sure that if you find a solution for the "without" file, which does not respect the min hours new constraint, the behavior and the final seed will be different for the "with" file, but of course much slower on average.


 Can we add a note warning the user that this constraint is not fully optimized and significantly slows down generation, indicating that this constraint requires improvement...?
B.A/krim

Liviu Lalescu

Oh, sure! Please let me know if you have the exact English suggestions - otherwise I'll add mine.

Benahmed Abdelkrim

Suggestion: This constraint has not been fully optimized. It can slow down generation; use it only when necessary and when required.
You can modify it or suggest another sentence.
B.A/krim

Liviu Lalescu

OK, I will do, and update to FET-7.8.0. Please write below the Arabic translation of this field:

---
This constraint has not been fully optimized. It can slow down generation; use it only when necessary and when required.
---

Benahmed Abdelkrim

#38
هذا القيد لم يتم تحسينه بشكل كامل. يمكن أن يؤدي استخدامه إلى تباطؤ الإنتاج؛ استعمله للضرورة وعند الحاجة فقط
B.A/krim

Liviu Lalescu

It is ready.

I wish to deeply apologize to Benahmed and to the Arabic users of FET-NSRT for the fact that the new constraint is so slow! In my defense:

1) I did not know it is that slow. I warned it was slow, but I did not know that it is so much slower.

2) It is a research problem. We cannot guarantee each time perfection.

Benahmed Abdelkrim

Thank you very much, dear Liviu!
   We hope it will be better in the future. Until then, it can be used, but with patience, or by using some tricks, like the one I used, which is dividing the teachers into groups, each group teaching a different subject, as shown in the example above (labeled "without").
B.A/krim

Liviu Lalescu

You are welcome, dear Benahmed, and thank you for your understanding!

I saw your "without" file, but I don't understand the trick, sorry. But it is no problem.

Benahmed Abdelkrim

#42
The trick used to avoid slowing down generation and to avoid using this new space constraint specific to buildings is to follow these steps:
1.   Add a number of pseudo rooms equal to the number of real rooms. Each building should consist of one real room and one pseudo room. For example, building R1 consists of one real room (R1) and one pseudo room (r1).
2.   Add two subjects, sub1 and sub2
3.   Choosing the mode: morning – afternoon
4.   Imagine a synoptic diagram of the solution: The week consists of 5 days, the number of time slots available in the morning and afternoon, Morning-afternoon behavior of teachers (exclusive, unrestricted, exceptions...)
5.   Calculate the activities to be placed in the real rooms: Number of real rooms X Number of available time slots per week.
6.   Calculate the total number of activities:
Number of half-days worked/Teacher X Number of available time slots / each half-day X Number of teachers
7.   Calculate the number of activities placed in pseudo rooms: Total number of activities – Number of activities in real rooms
8.   Enter teacher activities as mentioned above.
9.   Enter time constraints
10.   Enter space constraints

The file attached below clearly illustrates these steps. ...
B.A/krim

Liviu Lalescu

#43
Probably a small mistake in your file. I attach a screenshot. The rest of the buildings seem OK.

But why should each building have at least one activity?

Benahmed Abdelkrim

Thank you for the report. Yes, it was a mistake. Room R2 was assigned to building R1.
I have corrected it and reattached the file.
B.A/krim