Reputation: 3384
I'm writing a genetic algorithm for generating timetables.
At the moment I'm using these two heuristics:
I want to balance these two heuristics, so the algorithm wouldn't favor neither one. What would be the best way to achieve this?
Upvotes: 0
Views: 357
Reputation: 10184
Develop a scoring function to evaluate the quality of generated timetables. You have the idea for that in your two heuristics.
Generate some random timetable problems.
Choose some values to balance the two heuristics, generate solutions, and evaluate which ones look best (if you can't come up with a scoring function, then eyeball it).
choose a new set of balance weightings (i.e. around a neighborhood of the best choice from last time) and repeat
Upvotes: 0
Reputation: 18998
A very simple approach would simply be to add the scores together. At the end of the day, you want a blended score that goes up when either independent score goes up. You could use multiplication as well (being wary of number overflows depending on the size of your scores). With either approach you could weight the individual scores, e.g.
total_score = 0.4 * hours_score + 0.7 * holes_score
You could even make the weights user-configurable.
Upvotes: 1