3

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?

josliber
  • 43,891
  • 12
  • 98
  • 133
user11406
  • 1,208
  • 1
  • 13
  • 25
  • What's the input and output? Do you get number of rooms and hour of classes and need to assign them? Please be more specific. – amit Apr 23 '14 at 11:00

1 Answers1

2

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.

Ronald
  • 2,842
  • 16
  • 16