Beefy Boxes and Bandwidth Generously Provided by pair Networks
good chemistry is complicated,
and a little bit messy -LW
 
PerlMonks  

Re: Perl, Genetic Algorithms and Encoding...

by blokhead (Monsignor)
on Nov 15, 2003 at 18:25 UTC ( [id://307351]=note: print w/replies, xml ) Need Help??


in reply to Perl, Genetic Algorithms and Encoding...

I'd have to question why you think you need a GA for this problem. There are a lot of timetabling algorithms out there, as most scheduling problems can be modelled as graph matching/coloring problems. Maybe you just want to learn about GAs, which I think is a great reason! Even though this problem doesn't seem well-suited to a GA, you'll learn a lot along the way.

I disagree with eduardo's suggestion to not use Perl for this. Sure, EA/GAs do a lot of number-crunching, but I doubt you're dealing with gigs and gigs of data either. In my experience, Perl's many strengths have almost always made up for its raw computational speed. But I also have not used GAlib. If it really does make things that easy for you, and if you're as comfortable with C as with Perl, go for it. But I wouldn't put off Perl just because it's "slower." Besides, if you were out to make the fastest algorithm for this problem, you wouldn't be using a genetic algorithm anyway.

I'm obliged to plug my A Beginning Guide To Evolutionary Algorithms node. It is fairly general, but maybe you may find it helpful. Give it a read if you're not sure about how to put together the parts of an EA/GA. I also have a bunch of (biased) evolutionary algorithm links at the bottom of my homenode.

You seem to be having trouble coming up with a data representation, and that is usually the hardest part. If your goal is to make a conflict-free schedule, perhaps your fitness function could be the number of schedule conflicts, and your evolution can try to minimize that number. In picking a data representation for the schedule chromosome, try to make it one that facilitates easily mixing two schedules to a new schedule, preserving many aspects of the original schedules. I suggest an array indexed by either classes, students or teachers. That way you can just crossover the two arrays and not get any new schedule conflicts for whatever your indexing is in. Without more information about your problem, I don't think I can be more specific.

blokhead

  • Comment on Re: Perl, Genetic Algorithms and Encoding...

Log In?
Username:
Password:

What's my password?
Create A New User
Domain Nodelet?
Node Status?
node history
Node Type: note [id://307351]
help
Chatterbox?
and the web crawler heard nothing...

How do I use this?Last hourOther CB clients
Other Users?
Others scrutinizing the Monastery: (4)
As of 2024-04-18 04:28 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    No recent polls found