How can we place all activities?

Started by infoo_, February 10, 2023, 05:40:43 PM

Previous topic - Next topic

0 Members and 1 Guest are viewing this topic.

Liviu Lalescu


infoo_

#91
I attach the file.

I think we have only 2 main problems.

1) We need

Activity with id=79 (2/3 -    Teacher AK - Taller de Lectura y Comprensión de Textos - 2A - 2A)
Activity with id=80 (    1/3 - Teacher AK - Taller de Lectura y Comprensión de Textos - 2A - 2A)

to be min days = 1

2) We need

Activity with id=116 (2/5 -    Teacher AJ (Suplente Teacher N) - Matemática - 2C - 2C)
Activity with id=117 (    2/5 - Teacher AJ (Suplente Teacher N) - Matemática - 2C - 2C)
Activity with id=118 (    1/5 - Teacher AJ (Suplente Teacher N) - Matemática - 2C - 2C)

to be min days = 1 (maybe this is more important than problem 1)


I will try to see what indexes can be manually divided in order to solve these problems. Ideally we should not divide index = 1 but indexes > 1 so we have at least 1 index with duration = 2 (the others can be duration = 1, no problem).

P.S. I set maximum number of gaps per week = 7 because 6 seemed impossible

EDIT: See next message

infoo_

Update: Problem 2 can be forgotten for the moment.

We must focus on problem 1.

I kept

Teacher min hours daily, WP:100%, T:Teacher AK, mH:2, AED:yes, C:
   Liviu: probably impossible (if I am not mistaking)

activated, but I think we should deactivate it.

Also, I will try to divide activities on 2A and focus on its constraints. If I have news, I will post them

infoo_

I was playing with activities of 2A by creating/deactivating some of them and acts. not overlapping / min days constraints related to them but I couldn't get further than ~300/325.

If you want I attach the fail file.

infoo_

#94
I tried message #49 for

79 -     2/3 - Teacher AK - T. de Lectura y Comprensión de Textos - 2A - 2A

but it can't generate a full timetable. It got stuck around 298/326 placed activities every attempt.

Any suggestion?

Liviu Lalescu

Maybe best is 1+1+1 (say A1, A2, A3), 0% (take care, 0%!!!), min 1 days, consecutive if same day = true (I suppose). And add a constraint two activities consecutive for A1 and A2, if you need such.

In this way, FET will never place A1, A2, and A3 on the same day.

Then, take care of the teacher, if he has only 3 hours, he cannot have min 2 hours daily.

I have 8 core processor. I generate multiple on 8 threads. If it gets stuck at the same activity in nearly all the threads in a relatively short time (say 298/326), I analyze activity 299 in the initial order (generate single to see the initial order). I also analyze the highest-stage timetable (with 298/326 activities placed).

You are pushing the limits of feasibility, that is why your timetable is so difficult to obtain.

infoo_

Yes I did that, as you noted we are stuck.

For indexes > 1 whose duration > 1, we can delete them and instead create new activities with indexes > 1 whose duration = 1 (first two activities consecutive), so we can allow non-consecutive subactivities. That's not a problem for the school.

We should take care of restrictions related to them, of course.

Should this be enough to find a full timetable? But this would imply a long work

Liviu Lalescu

I am not sure if this is enough to finish a timetable - you want to have very strong constraints and I am not sure it is feasible.

It might be possible to write a portion of code for FET to automate this process of converting from the old activities to the new ones. I am not sure if it is very complicated or how long would it take - might take a couple of hours or less.

infoo_

#98
Don't worry. I am testing creating manually and it does not take too long. I am picking those activities to change; those that are not assigned to any room, so it is easier.

However, it happens that as I deactivate the old activities and create the new ones, each time FET places fewer activities. For example, I have divided several activities and it stays in:

312 out of 353 -> 353 - 312 = 41

but we had before:

326 - 298 = 28

Why this happens? Shouldn't it be easier for FET to place activities like 1+1+1+1 that are possibly non-consecutive (except the first 2) than those that are consecutive pairwise like 2+2?

Liviu Lalescu

The initial order changes. Usually, activities with duration 2 are placed before those with duration 1.
(the conflicting index is multiplied with the duration.)

infoo_

Another question: I am using "two activities are grouped" instead of "two activities are consecutive" because we don't care about the order. Do you still suggest "consecutive" for performance reasons? Or is it the same in our case?

Liviu Lalescu

If I remember correctly, consecutive might be more efficient (because the initial order is better). Yes, I checked, it is better. So, if the activities are equivalent, prefer consecutive.

infoo_

#102
Thanks for the help!

Quote from: Liviu Lalescu on February 14, 2023, 09:57:47 PMMaybe best is 1+1+1 (say A1, A2, A3), 0% (take care, 0%!!!), min 1 days, consecutive if same day = true (I suppose). And add a constraint two activities consecutive for A1 and A2, if you need such.

In this way, FET will never place A1, A2, and A3 on the same day.

I don't understand why FET will never place them on same day.

We say 1+1+1 (say A1, A2, A3). At the moment FET can still place A1, A2 and A3 on same day.

Weight = 0%. We don't add any new revelant information. FET can still place A1, A2 and A3 on same day.

Min days = 1. Since it is 0%, I guess it doesn't matter. FET can still place A1, A2 and A3 on same day.

Consecutive = no. FET can still place A1, A2 and A3 on same day.

two acts are consecutive: A1 and A2. FET can still place A1, A2 and A3 on same day (for sure A1, A2 are placed on same day).

With this, how does FET know that A1, A2 and A3 are not placed on same day?

EDIT: Maybe because we set min days = 1. But that 0% baffles me... why 0% instead of 100%, differences?

infoo_

#103
I couldn't get any improvement from before. I deactivated some "not so important" constraints, so we should get better performance. I got even worse results. :-[


I deactivated activities whose (index = 1 && duration = 2) of courses 2A, 2B, 2C, 3C and 5C.

Then I created new activities of indexes = 4 or 5 with duration = 1 each, min days = 1, 0%, consecutive = no.

Then, for each new activity, I set "two activities are consecutive" for the first 2 subactivities.

But in all cases, it places 312 out of 368 activities, so 368 - 312 = 56...

The file is attached. Can someone take a look if I made a mistake, please?

Liviu Lalescu

By design, if there is a constraint min days between activities, FET will not place three activities on the same day. Maximum two. 0% because you don't care if there is one activity on a day or two.