subject with 6h per week - setting order of preference for 2+2+1 split

Started by school-exp, October 12, 2025, 11:12:58 AM

Previous topic - Next topic

0 Members and 1 Guest are viewing this topic.

school-exp

Please see image attached, I imagine that I need to set this as a 2+2+1+1 split activity but how can I implement the order of preference?

[2+2+2] or [2+2+1+1] better than [3 non consecutive+2+1] better than [3+3+1]

You cannot view this attachment.



thanks!

Volker Dirr

If I see it correct, then you need an activity with 2+2+1+1 with min day 0% weight AND add an extra min day constraint with the 2+2+1 (so don't add the last "1") with min day 100%.

school-exp

thanks, I think I don't need to check consecutive in both constraint?

The way i understand it is that the min day at 100% always forces a 2+2+1 solution.

Then you have 1 last period to add to the week and because the second min day has 0% weight it can go in a day with already 2 periods or 1 period.
Because consecutive is not checked the cyan solution is preferred to the violet.

Am I correct?

Since adding all this contraints is time consuming (I have many subjects with this same structure) I thought of alternatives:


1: Accept only green and cyan solutions. Divide the subject in an activity with split 2+2+1 min day 100% and a second activity with just 1 period. Add a max hourly span of set of activities set to 2.
Wouldn't this replicate your solution without the need to add constraints to each subject?

2: Drop requirements and accept only green solutions. Could this be obtained with a 2+2+1+1 and a max hourly span of set of activities set to 2? This constraint is easier to add because I can filter activities by subject and apply to all of them.


Liviu Lalescu

For the constraints min days between activities with 100% weight, the consecutive if same day is ignored. For your case, to allow a day with 2+1 not consecutive, you need to not select the consecutive if same day for 2+2+1+1 0%.

school-exp

Thanks Liviu, While you were answering I was modifying my reply, could you have a look? I added alternatives

Liviu Lalescu

Quote from: school-exp on October 12, 2025, 04:19:16 PMBecause consecutive is not checked the cyan solution is preferred to the violet.

Am I correct?

No! The cyan and violet are both accepted, randomly or as constrained by the other things. FET will not choose preference to none of cyan or violet.

QuoteSince adding all this contraints is time consuming (I have many subjects with this same structure) I thought of alternatives:

1: Divide the subject in an activity with split 2+2+1 min day 100% and a second activity with just 1 period. Wouldn't this replicate your solution without the need to add constraints manually?

2: Drop requirements and accept only green solutions. Could this be obtained with a 2+2+1+1 and a max hourly span of set of activities set to 2? This constraint is easier to add because I can filter activities by subject and apply to all of them.


1. The single activity can then be anywhere.

2. Max hourly span of a set of activities is for other things, I think. If for (A1,A2,A3) max hourly span is 2, then A1 and A2 can be on different days, but their hours must at most span 2.

If you want the most efficient solution, (A1,A2,A3,A4) (2+2+1+1), you could add A1,A2,A3 min 1 days 100% and A1,A2,A4 min 1 days 100% and A3,A4 min 1 days 0% consecutive=true.

If you want easy to input data, you could add A1,A2,A3,A4 (or only A3,A4) min 1 days 0% consecutive=true, and add a tag to these 4 activities, and students max 2 hours daily for this tag.

I prefer min days for efficiency, but also tag max hours daily might be good in practice.

Liviu Lalescu

If you want some activities with at least a gap between them, min gaps between activities. But it will not allow 1+1 on same day.

Max hourly span of a set of activities is computed for all the activities in a constraint, indifferent if they are on different days. It is a wrong constraint to use here, if I understand correctly.

school-exp

so "consecutive checked" => must be consecutive
"consecutive unchecked" => it can be consecutive or not, depends on situation, no preference


Quote from: Liviu Lalescu on October 12, 2025, 05:45:24 PMIt is a wrong constraint to use here

you are right, I actually meant "students max 2 hours daily" but searching in FET I got confused


Quote from: Liviu Lalescu on October 12, 2025, 05:34:36 PMIf you want the most efficient solution, (A1,A2,A3,A4) (2+2+1+1), you could add A1,A2,A3 min 1 days 100% and A1,A2,A4 min 1 days 100% and A3,A4 min 1 days 0% consecutive=true.

If you want easy to input data, you could add A1,A2,A3,A4 (or only A3,A4) min 1 days 0% consecutive=true, and add a tag to these 4 activities, and students max 2 hours daily for this tag.

When you say most efficient solution, do you mean in terms of time to generate a timetable?

Apart from computer time, is there any difference in the final result between the 2 method (efficient solution vs easy to input)?

thanks a lot

Liviu Lalescu

Yes, for the first paragraph.

Second paragraph, OK.

Third paragraph: yes, time, but also I prefer min days also for efficiency. It is a clearer constraint for the algorithm: the program know exactly what to do at each step. For students/teachers max hours daily with a tag, the algorithm chooses a bit more randomly. But, I might be wrong and in practice the max hours with tag might work the same.

school-exp


Liviu Lalescu