Respect m activities out of n constraints activity(ies) preferred times

Started by Liviu Lalescu, January 14, 2026, 04:06:19 PM

Previous topic - Next topic

0 Members and 1 Guest are viewing this topic.

Liviu Lalescu

Dear collaborators,

@Vangelis Karafillidis suggested two things:

QuoteThe user does not really care about the number of the attempts of the code - they actually care about either
a) the number of constraints that are going to be violated (for example activities locked in time) or
b) about the number of violations of a single constraint (for example max hour daily)

I think (b) is very complicated, but for (a) it might be possible, and deliver a nice result. It could work for the 7 preferred times constraints: activity preferred starting time, activity preferred starting times, activity preferred time slots, activities preferred starting times, activities preferred time slots, subactivities preferred starting times, and subactivities preferred time slots:

The user selects n constraints of this type, which will only have 100% weight, and says that out of these constraints at least m activities will be correct (from the set t of total individual ID activities involved).

Hmm... it is possible to implement, but there is a big problem: the constraints do not have an ID, to consider a set of constraints inside this constraint.

Hmm... another big problem: we cannot say that an activity with 100% weight is to be skipped.

If we managed to implement this it would be a nice feature, like: activities A1, A2, A3, at least two activities out of these three should be placed correctly, like A1 on Monday, A2 on Tuesday, and A3 on Wednesday. And more general options.

Or we could just make a constraint m out of n which has also a list of accepted times for each involved activity. This might work.

Vangelis Karafillidis

#1
Hello @Liviu Lalescu.

I seems to me the the last alternative is the safest. I am not a coder... but this option seems to be the clearest one... So, a constraint which places m activities out of n activities in the selected time slots. What do you think as a coder?
But, is it possible to connect the "locked in time" activities of a generated timetable with this new constraint? Or maybe, "locked in time m out of n activities"? (n = the number of the selected activities).
And my last question: Is it possible to implement the other feature we discussed some time ago? For example... is it possible for the user to select a "time window" of (let's say) -1 hour to +2 hours (two values) for the selected (locked in time) activities? The idea is like this: Each activity has its own time slot in the generated timetable. Sometimes, the user can accept solutions (modifications) with the activities placed in slightly different positions (time slots). So... if the user can select the activities, the minimum number of the activities that they demand to remain locked in time, PLUS a possible slightly different position of the m activities.
What do you think?

Vangelis.


GUEFFAZ ABDELKRIM

من الافضل وضع الاقتراحين تحت التجربة حتى يتبين ذلك 

Liviu Lalescu

Dear GUEFFAZ,

The second alternative would be possible. The first one not, because the 100% constraints must be respected and because we have no constraint ID.