Looking for help with AI::Genetic and classroom scheduling

merlyn on 2005-02-20T00:31:26

I'm trying to help "Captain Neil" out with scheduling the future geekcruises. I figure I can use AI::Genetic with it, but if someone has a better module, I'll use that instead. (If I can get this to work in time, we'll actually use it live for Perl Whirl 05, and I can give a talk about how it worked...)

The problem is that essentially a schedule consists of time slots with various rooms within the slots, and instructors (and hopefully students) to fill the rooms. The obvious constraints apply: rooms can't hold two things at once, and instructors can't be in two places at once. There's also some "better than others" solutions, like having the first and second place class requested by attendees both be available and in different time slots, and possibly some ordering of classes based on "part 1" "part 2" information. And, if I can get past all that, there's actually different classroom sizes that can bias the result as well.

So, where I'm stuck is how to best represent a particular schedule. Should the genes represent the timeslots for each classroom, with the values being the class for that slot? Or should they represent the classes, with the values representing the timeslot-classroom identification? Both of them seem to have advantages for mutation and crossover, but with the cross-constraints, it seems like nearly any crossover is going to generate a schedule that immediately gets stillborn as an impossible deal.

Does anyone have any experience with setting up this sort of thing?

(Also posted on Perlmonks.)