Main Menu

Min gaps

Started by xtzetzias, September 14, 2025, 10:11:03 PM

Previous topic - Next topic

0 Members and 1 Guest are viewing this topic.

xtzetzias

Hello everyone! It's been a while for me.
I've have a question and perhaps a request. Is there a way to set min gaps per day or per week for a teacher? I don't see a relative constraint. It seems a bit strange perhaps, but i need it.
If there isn't a way, then could two constraints be added? One for min gaps per day and one for min gaps per week.
Thanks

Liviu Lalescu

Hello, xtzetzias! Welcome back! :)

If you need a variable break, you could use teacher(s) max hours daily in an hourly interval.

Your exact request is too difficult, but if you want I could write it in the list of suggestions (the TODO list). Please let me know if the constraint above does not work for you and I should add your suggestion in the TODO.

xtzetzias

Thanks for the answer!

I will think more of it, but at a first thought, i cannot find a way to use the constraint you propose. What i'm trying to do is to force a teacher spend a min hours per day at school which is more than the actual teaching hours. For example if a specific timetable gives him or her 2 teaching hours on Tuesday, then there should be at least one gap between these two hours, so that he stays for at least three hours at school.

(I'm a bit surprised. I thought it would be an easy constraint to implement. I guess that's because i know nothing about how fet's code works :-))

Liviu Lalescu

You are welcome!

I added your suggestion in the list.

On a second thought, your "teacher(s) min span per day" might be possible, but I am not sure if it would be efficient.

xtzetzias


Vangelis Karafillidis

Hello.

Liviu, this situation is quite common in Greek schools. The directors of studies expect the teachers to have a minimum number of gaps (especially per week), in order to provide "secretarial" support services. Constraints such as "teacher(s) - min gaps per day", "teacher(s) - min gaps per week", "teacher(s) - min span per day", "teacher(s) - min span per week" (or maybe... "teacher(s) - min hourly span per week" or something like that) are in some cases quite useful.

Vangelis.


Liviu Lalescu

Hello, Vangelis,

I will also add your words in the suggestion.

Vangelis Karafillidis

Thanks. You know, maybe something like "teacher(s) - min total hourly span per week" could solve these problems. I think that most of the time, "min gaps" could be "replaced" with the above mentioned constraint.

Vangelis.


xtzetzias

Hi Vangelis.
You explained the "greek" situation very well, thanks :-).
I was thinking last week what you just wrote, if "teacher(s) - min total hourly span per week" could replace "min gaps per week". It can, i think. However, in terms of per day restriction, i think it's not the same. "Min total houly span per day" is not such a good replacement for "min gaps per day". It's more restrictive, because it forces a somehow evenly distribution of teaching hours, even when it is not necessary (or else many gaps could be placed in the same day, which is not a good. It should be used along with other restrictions, in order to give the same result.

Vangelis Karafillidis

Hello.

It seems that this situation occurs in quite many cases in Greek schools. What I think is that "teacher(s) - min total hourly span per week" in combination with existing constraints could solve the real-life problem we both described, at least in most cases.

Vangelis.


Liviu Lalescu

I also added this further conversation in the TODO. However, I am not sure it is possible/feasible.

Vangelis Karafillidis

Hello.

Liviu, this is not an "exact" problem. Let's say that the timetabler just needs to achieve a minimum number of gaps for specific teachers. This can be achieved via different approaches (theoretically). ANY of this approaches could be useful towards this direction. For example, if the implementation of "teacher(s) - min daily span" is easy, this could provide the timetabler with a tool to solve this type of problems. The exact constraint is not so important. The important part is to have ANY kind of constraint that helps the timetabler.

Vangelis.


Liviu Lalescu

Hello!

Oh, I understand, Vangelis. I will add also your latest explanation in the TODO list.

xtzetzias

I thought i found a workaround, but actually I did not.
If someone could add a new tag (let's call it "Empty"), make a new dummy activity under the "Empty" tag for each teacher (with as many hours as the min gaps he/she should have per week) and force this activity not to be first nor last in the teachers day, it would do the job. "A set of activities begins teacher's day" seemed a promissing constraint, as i would gather all "real" activities under one tag (let's say "Lesson") and then force Lesson activities to begin teachers day (and after that also end teachers day). However this doesn't work this way (as Youssef explained).

Vangelis Karafillidis

#14
I think that there are some "indirect" ways to achieve a FET behavior that resembles "min gaps". The problem is that these indirect ways are based on (let's say) quite complicated tricks, so there is virtually no flexibility. I.e. if the user needs to change this "indirect" realization of "min gaps" (for example modify "min gaps"), they should rearrange the description of the problem (which is quite complicated).

Vangelis.