I'm working on university scheduling problem and using simple genetic algorithm for this. Actually it works great and optimizes the objective function value for 1 hour from 0% to 90% (approx). But then the process getting slow down drammatically and it takes days to get the best solution. I saw a lot of papers that it is reasonable to mix other algos with genetiс one. Could you, please, give me some piece of advise of what algorithm can be mixed with genetic one and of how this algorithm can be applied to speed up the solving process. The main question is how can any heuristic can be applied to such complex-structured problem? I have no idea of how can be applied there, for instance, greedy heuristics.
Thanks to everyone in advance! Really appreciate your help!<hr />
I have:<ul><li>array filled by ScheduleSlot objects</li> <li>array filled by Lesson objects</li> </ul></li> <li>
I do:<ul><li>Standart two-point crossover</li> <li>Mutation (Move random lesson to random position)</li> <li>Rough selection (select only n best individuals to next population)</li> </ul></li> </ol>
Additional information for <strong><em>@Dougal</em></strong> and <strong><em>@izomorphius</em></strong>:<br /> I'm triyng to construct a university schedule, which will have no breaks between lessons, overlaps and geographically distributed lessons for groups and professors.<br /> The fitness function is really simple: fitness = -1000*numberOfOverlaps - 1000*numberOfDistrebutedLessons - 20*numberOfBreaks. (or something like that, we can simply change coefficients in fron of the variables)<br /> At the very beggining I generate my individuals just placing lessons in random room, time and day.<br /> Mutation and crossover, as described above, a really trivial:<ol><li>Crossover - take to parent schedules, randomly choose the point and the range of crossover and just exchange the parts of parent schedules, generating two child schedules.</li> <li>Mutation - take a child schedule and move n random lessons to random position.</li> </ol>Answer1:
My initial observation: you have chosen the coeficients in front of the numberOfOverlaps, numberOfDistrebutedLessons and numberOfBreaks somewhat randomly. My experience shows that usually these choices are not the best one and you should better let the computer choose them. I propose writing a second algorithm to choose them - could be neural network, second genetic agorithm or a hill climbing. The idea is - compute how good a result you get after a certain amount of time and try to optimize the choice of these 3 values.
Another idea: after getting the result you may try to brute-force optimize it. What I mean is the following - if you had the initial problem the "silly" solution would be back track that checks all the possibilities and this is usually done using <a href="http://en.wikipedia.org/wiki/Depth-first_search" rel="nofollow">dfs</a>. Now this would be very slow, but you may try using <a href="http://en.wikipedia.org/wiki/Iterative_deepening_depth-first_search" rel="nofollow">depth first search with iterative deepening</a> or simply a depth resticted DFS.Answer2:
For many problems, I find that a Lamarckian-style of GA works well, combining a local search into the GA algorithm.
For your case, I would try to introduce a partial systematic search as the local search. There are two obvious ways to do this, and you should probably try both.<ol><li>
Alternate GA iterations with local search iterations. For your local search you could, for example, brute force all the lessons assigned in a single day while leaving everything else unchanged. Another possibility is to move a randomly selected lesson to all free slots to find the best choice for that. The key is to minimise the cost of the brute-search while still having the chance to find local improvements.</li> <li>
Add a new operator alongside mutation and crossover that performs your local search. (You might find that the mutation operator is less useful in the hybrid scheme, so just replacing that could be viable.)</li> </ol>
In essence, you will be combining the global exploration of the GA with an efficient local search. Several GA frameworks include features to assist in this combination. For example, <a href="http://gaul.sourceforge.net/tutorial/evolution.html" rel="nofollow">GAUL</a> implements the alternate scheme 1 above, with either the full population or just the new offspring at each iteration.