Main Menu

weights in FET

Started by Chafik Graiguer, August 29, 2009, 01:54:41 PM

Previous topic - Next topic

0 Members and 1 Guest are viewing this topic.

Chafik Graiguer

How FET interprets consraint's weights?
I have read
Quote100% means satisfied all the time, 95% means in some cases constraints are not respected.
is there only two cases: 100% and 95% ?

say, I have the following levels of importance for "Not available":
1-very important (must)
2- important (must, unless impossible)
3-somewhat important (preferable)
4- a little bit important (just in case it is possible)

what percentage should I use for each case?

What is the defference between
Max gaps=0 weight: 95%
Max gaps=1 weight: 95%
I think, if FET fails to respect constraint, in both cases, the maximum will not be respected, so there will be 1, 2, 3 .. gaps

Liviu Lalescu

You can choose any weight, like 87.675% or more likely 99% or 99.75%.

FET will skip a constraint with x% with 100-x% probability. But: FET retries. That means: a constraint with weight 99.75% may be broken in 4.80% of cases for the final timetable (instead of 0.25%). So, if the weight is too high, FET will take longer to solve, but it will try to break it.

Max gaps has only weight 100%.

For max hours daily: if you have max hours daily 5 with 90%, you may get a timetable with 8 hours daily. So, the recommendation: add also a max 6 hours with 100%.

Chafik Graiguer

OK thanks
I have got the idea now :)
for any weight under 100%, it is usefull to "stop" relaxation by another constraint with 100% weight
This way, we will have a range
in the above example:
5 hours daily is maximum in 90%,
if no possible, we allow more,
but not more than 6  

Well, I will collecte all those tips and ask Volker to add them into the manual
Maybe , I will reelease an arabic manual  as well

Volker Dirr

#3
Quote
Well, I will collecte all those tips and ask Volker to add them into the manual

I also read always here and hopefully update manual again.
but i also don't want to conceal that i don't like using weight with less then 100%. In my opinion less then 100% weights are only ok to the last constraint you added into your dataset.
All other constraint should have 100%.
In my opinion it is a better style to do it this way:
add a 100% weight with 6 hours.
if FET solve:
modifiy to 100% weight with 5 hours.
if FET isn't able to solve that:
think about why.
then modify again up to 6 hours.
and just add (some) more specific constraint with 5 hours, BUT 100%. (of course not to the problematic teacher, group, or whatever.)

so i like this style more:
THINK why it is problematic and add only 100% constraints.

The advantage is:
- you will be faster
- you will maybe get a solution even your 90% idea fail, because FET skiped a timetable with 90%, even you maybe want to use it, but FET will not show you that timetable
- you don't need to think/decide later if you see the logfile, because you done already before

So i recommend, think before, not after generating. that will save you much time and FET will not skip a possible solution by bad luck.

Liviu Lalescu

Volker, I don't agree entirely. If the timetable can respect max 6 hours and respect max 5 hours with 2 exceptions out of 100, then you should use 99% or something like that.

Volker Dirr

yes. like i wrote it is ok to the last constraint you add. but i saw some guys add very many constraints with less then 100%. and if they use only 100% and think, then they wouldn't add conflicting unneeded, just time consuming, constraints.

we should "teach" to avoid it (and yes, i use only 100% in my dataset). FET users will get "bad" results if they don't think enough and "(nearly) always" use less then 100% constraints. don't forget the samplesets where users add "min n day constraint" and "grouped constraint" to the same activities with weight <100%. that is pretty stupid and time/solution wasting. there are many other examples like this.

so in my opinion it is correct to nearly always use 100%, just the "last" one (for my sake maybe also last 2 or 3) constraint should get less then 100% weight.

but of course every FET user can do what he want. but if he watch the conflicts text and see "hey, there are some broken constraints that i don't like, i will generate again to see if other "better" constraints are broken in the next geeration", then he is wasting also time in my opinion.

of course there is a problem if you try to think but can't find the "problematic" thing. i know that. i just recommend to avoid. everybody can do what he want.

i don't want to disallow 100% constraints, i just want to say "avoid them as long as possible". by this you also avoid "conflicts" in choosing the best generation.

Chafik Graiguer

I think both Liviu's and Volker's methods are good
it is a matter of strategy

Now I came across another issue:
why Max days per week is 100% only? is there any workaround to lower this weight ?

Liviu Lalescu

QuoteI think both Liviu's and Volker's methods are good
it is a matter of strategy

Now I came across another issue:
why Max days per week is 100% only? is there any workaround to lower this weight ?

No workaround (because even the interval max days per week constraint has only 100%).

It is 100% because, like gaps, with lower weight you will obtain poor timetables.

Chafik Graiguer

#8
OK
but, what does mean "poor" timetable ?
Say, we have 6working days per week
If I want absolutelly 5 working days, I will set weight to 100%
If I set Max working days per week=5, with weight: 90%, this means it is not 100% important to have 5 days, but it is preferable..
When FET fails to respect it, teacher will fall back to 6 working days
So there is no poor timetable for him! because, if 5 days limits was realy necessry, I would set it to 100%
So weight under 100% will give FET more freedom dealing with some teachers, and it will gave us hopefully  5 working days whenever possible !!

Liviu Lalescu

You'll need to set 99.99% and still FET will fail many times. You'll set maybe 99.999% and in 5% of cases the constraint will fail. Also, the algorithm is very slow with 99.999%. It is because of the algorithm.

Chafik Graiguer

#10
Well
Suppose FET fails, there is no problem here. constarint is not so important
Many times, I saw FET acheives honorable results with other constraints set under 100%, even to 80%, like "A set of activities has a prefered time slots"

Liviu Lalescu

Yes, but max days per week will fail in all cases if weight is say 95% or even higher. And the time to generate will be much slower.

Chafik Graiguer

Thanks for comments
I understand now !!
As you told earlier:
QuoteIt is because of the algorithm.

Chafik Graiguer

#13
I come back again with another question about weights !!
In the Space constraints, there is some constraints with 0 to 100 % weight
So what does mean to set a weight under 100% to
"A subject has a set of prefered rooms"
or
"A teacher has a (a set of) home room "

Deoas it mean that the teacher's activities or the subject's activities could be, possibly, scheduled without a room ?

for a given ativity or subject or teacher, Can I set two rooms:   R1 with 100% and R2 with 80%, so R1 gets priority over R2 ?

Liviu Lalescu

Yes, 90% preferred room means that in about 10% of cases the room has no room attached. If you have a 100% home room, then, if the preferred room is skipped, then activity is put into the home room.