Answer the question
In order to leave comments, you need to log in
Genetic Algorithm, How to write a fitness function?
I'm not asking for a code, I'm asking for directions.
I wanted to write a GA for scheduling university lessons, but I constantly stumble upon a false minimum, increasing the mutation rate does not help, everything else works (I use Accord.Genetic), so it's about my understanding of the fitness function. The conditions there are not difficult: teachers choose an hour in which they cannot work for one reason or another, some groups do not study in certain pairs (for example, my group does not study in 5, 6, 7.8 pairs, but a friend is exactly the opposite ), and the last condition - the group has a set of compulsory disciplines for the week, like 3 mathematics, 3 German. Of course, there should be no conflicts.
I used two options, but both will enter a false minimum
1) the fitness function has a range of values from 0 to 1, the criteria that are evaluated and their range, 48 is the number of possible pairs (6 days * 8):
Answer the question
In order to leave comments, you need to log in
You have all the parameters described so that in the ideal case the value of each of them will be equal to 1.
For example:
Conflict pairs for teachers = [0..1] (Number of Couples They teach - Number of Conflict Couples )/Number of Couples They teach Number of Conflict Couples
= 0, parameter value = 1.
As a result, you need to claim the maximum and not the minimum from your function.
Maybe rewrite the description of the parameters in reverse, so that the target value tends to 0?
For example:
Conflict Pairs for Teachers = [0..1] Number of Conflict Pairs/Number of Pairs They Teach
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question