Hello,
I work in an educational institute where we have courses running in simultaneous but different time periods, like this:
Course 1:
18h30 - 19h20
19h20 - 20h10
20h20 - 21h10
21h10 - 22h00
Course 2:
19h00 - 19h45
19h45 - 20h30
20h30 - 21h15
22h15 - 22h00
How could we set FET to avoid put teachers in simultaneous activities in both courses? Is there a restriction to block periods if another one is occupied?
Thanks in advance!
Hello, and welcome!
If you showed us your file it might be clearer. Otherwise, I am not sure I understand correctly, how did you input the FET hours? 1, 2, 3, and 4? And a teacher is for instance not allowed both in Course 1 19h20-20h10 and in Course 2 19h00-19h45?
If so, maybe these will help:
1) Teacher(s)/students (set) max 1 hours daily in hourly interval [1, 3). This is the easy way and preferred if possible.
or
2) Constraint activities (all activities of a teacher) occupy max 1 time slots from selection of slot 1 and slot 2 of Monday, then another constraint Tuesday, ..., Friday, then this for all the necessary teachers. This is a more flexible and general constraint.
Thanks for reply, and another thanks for developing such helpful software!
Maybe I was not clearly. These two courses run with different and intersect time schedules, like I said, and some teachers work in both of them. Example, if teacher A has the first classtime in course 1 (18h30-19h20), he can't work in first time of course 2 (19h00-19h45), and if teacher B have the the 3rd classtime in course 2 (20h30-21h15) he can't work in 3rd (20h20-21h10) and 4rd (21h10-22h00) time of course 1.
If you like, my file is in this link (https://ifbaedubr-my.sharepoint.com/:u:/g/personal/igor_schmidke_ifba_edu_br/EfTTMDZERk5An0RdTS7db4wBW34YQyNNYDTo7KnpDeyVJA?e=CcSzxd).
My colegues and me think that FET should have a time constrain to prevent activities of same teacher/subjects in a group of classtime/hours, but if you can think another simplier solution to our problem, I would love to read.
Thanks for attention.
You are welcome!
I am analyzing your file and will let you know.
Could you please confirm: hours 1..20, there are 6 conflicts: (13, 17), (14-17), (14-18), (15-19), (16-19), and (16-20)?
Quote from: Liviu Lalescu on March 14, 2025, 06:57:09 PMYou are welcome!
I am analyzing your file and will let you know.
Could you please confirm: hours 1..20, there are 6 conflicts: (13, 17), (14-17), (14-18), (15-19), (16-19), and (16-20)?
Exactly
Using the constraint activities occupy max time slots from selection, there are 6 constraints on each day, so 6x5=30 constraints on the entire week for each teacher. How many teachers teach both courses? I see you have ~100 teachers, so for all of them it would mean 3000 constraints (I think it would take 1-3 hours to input them manually), but I hope there are few teachers in both courses.
I will think of better solutions, but let me know the answer to my question above.
Hello again!
I added for the first teacher. It took me 4m20s. I estimate that to add for all 100 teachers would take much less than the computed ~430 minutes. I assume it would take less than 3 hours. The reason is that I added for the first teacher, not knowing the exact procedure and making mistakes and reading the paper.
See the attached file for the first teacher, the last 30 time constraints.
You are right, if there are many teachers like that we would need a new constraint, for all the teachers or for a teacher, mutually exclusive time slots. But I don't know a good name for this, and I always prefer to keep the number of types of constraints to a minimum. Is your situation common for more institutions? Are there many teachers in both courses?
I might go to sleep soon (21:55 here now).
Quote from: Liviu Lalescu on March 14, 2025, 07:17:08 PMHow many teachers teach both courses?
Not many, around 10, maybe less. But this difficult made our team to feed another software that is easier to swap activities after FET gave us a very nice starting point. I would like to make the entire timetable with FET, this is the reason to ask for help here.
Quote from: Liviu Lalescu on March 14, 2025, 07:55:43 PMIs your situation common for more institutions?
Here in Brazil, it's common to a big institution working with many "education categories" (Idk the english term for this), like latu sensu, strict sensu and technical degree, each one with his own time schedules and class duration, but sharing teachers. Almost every university and federal institute of education (where I work) could happen this.
I'm very happy with your help! Tell me if I could help in any way.
OK, I will think and maybe try to add some new constraints: teacher(s)/students (set) pair of mutually exclusive time slots. If so, I hope you could help with testing. I will let you know, here.
I just finished the engine part, the most important and difficult. It compiles, but I cannot run it until I make the interface part.
I need to take a break now. I hope to be ready later today with a snapshot for you to test, if you would like to help me with that. I will announce here.
Quote from: Liviu Lalescu on March 15, 2025, 03:40:40 AMOK, I will think and maybe try to add some new constraints: teacher(s)/students (set) pair of mutually exclusive time slots. If so, I hope you could help with testing. I will let you know, here.
I think the solution should create a constrain to block teachers in an hour if he's working in another specific hour.
I'll be glad to test.
Yes, exactly, that's what I said. The engine (most difficult and important) should be OK, I need to add the interface code and will put a snapshot for you to test. I hope I will be ready in say 5 hours, or more.
It is ready, I hope you'll like it:
https://lalescu.ro/liviu/fet/download/test/
I also attach your file, modified by me. The perfect variant does not solve because of teacher Julio, so I deactivated for him the last day's conditions. I added constraints for all the teachers, with the "Add constraints" button, 30 times (5 days x 6 constraints per day).
Please let me know. I hope to release soon the final version, maybe on Monday 17 March.
Amazing! Works like a charm!
Many thanks, Liviu, I send our regards from Instituto Federal da Bahia, tell me if you need something. I'll frequently visit your forum!
Thank you for the report! I am glad it works! You did a good suggestion.
I hope to release tomorrow the official version.
Regards from Craiova, Romania! :)
Well, FET is free software so, if you can afford a donation, it would be great.
Hello!
The new official version is just released. Thank you for your suggestion!
Thanks! Downloading now, must finish a timetable today.
Come here because of the new feature which solved this problem. But I think we could have solved this without the new feature.
Since the the overlapping time slots are alternating, we can set up the hours like this:
18h30 - 19h20
19h00 - 19h45
19h20 - 20h10
19h45 - 20h30
20h20 - 21h10
20h30 - 21h15
21h10 - 22h00
21h15 - 22h00
In other words, the overlapping timeslots are consecutive.
Then, we can add an Activity tag for each course, a different one for each set of overlaping timeslots. For example, Overlaps-18:30/19:00, Overlaps-19:00/19:20, etc.
Use the "min gap (hours) between a set of activities" constraint for each set of the courses with the same overlaps-xx tag. Make the min gap to be 1, so they cannot be consecutive.
Would that work?
I think there are more reasons it won't work:
1) There are many activities with duration 2. Otherwise, I would have also used this approach, but with teachers max 1 hours daily in two adjacent overlapping intervals.
2) You don't know which activities end up in which interval. You don't know the activity tags before the generation, but only after.
Quote from: yush on March 19, 2025, 07:28:05 PMCome here because of the new feature which solved this problem. But I think we could have solved this without the new feature.
Since the the overlapping time slots are alternating, we can set up the hours like this:
18h30 - 19h20
19h00 - 19h45
19h20 - 20h10
19h45 - 20h30
20h20 - 21h10
20h30 - 21h15
21h10 - 22h00
21h15 - 22h00
In other words, the overlapping timeslots are consecutive.
Then, we can add an Activity tag for each course, a different one for each set of overlaping timeslots. For example, Overlaps-18:30/19:00, Overlaps-19:00/19:20, etc.
Use the "min gap (hours) between a set of activities" constraint for each set of the courses with the same overlaps-xx tag. Make the min gap to be 1, so they cannot be consecutive.
Would that work?
I timetable created in such way could be confusing to read, specially for someone not involved in generation.
Ah, I jumped to the conclusion that each course would only occupy one timeslot. However, it might still work. If we think of the timeslots as "starting" time, and ignore the end time. We have:
18:30A
19:00B
19:20A
19:45B
20:20A
20:30B
21:10A
21:15B
With the A/B indicating what type of schedule it is on. If a teacher has a class of 2 timeslots in the "A" schedule, say, from 19:20A to 20:20A, we put the activities as having a duration of 3 hours, not 2. That's because it encloses the 19:35B timeslot.
The next timeslot that cannot be scheduled is 20:30B. So, by enforcing a min 1 hour gap, it ensure that we will have no overlaps.
Actaully, we don't need to have different activty tags for different pairs of consecutives. Just one tag for all activities from 18:30 to 22:00, because these are the hours that have the overlap problem.
Of course, even if this work for this case, it the same trick likely will not work for other overlapping timeslots configuration. The mutually exclusive constraint is definiely a nice addition!
I am not convinced that it would work. You could get igorsch's file from reply #2 and see it. There are 6 conflicts: hours 13 and 17, 14 & 17, 14 & 18, 15 & 19, 16 & 19, 16 & 20.
Thank you for the appreciation!