Question

I'm trying to build a genetic algorithm to solve a basic school timetabling problem.

I'm trying to work out what a good encoding would be for this problem. I could do it as a binary string something like this:

day  hour/time room
000  00000     000000

etc...

Is that the best encoding for my problem?

Was it helpful?

Solution

Since memory is hardly a problem nowadays, I'd choose a representation which

  1. is easy to work with from a programmers point of view (readability)
  2. supports your algorithm

Using bit arrays will save space, but you'll end up with a lot of macros or function calls to separate the information over and over again. This is hard to read, hard to write and slow. (At least I guess your algorithm won't perform bit operations on your data)

If this were a database question, I'd say you definitely need first normal form as a minimum. Any higher level of normalization will reduce the effort of keeping data consistent.

Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top