Alex Rivera | Logout

Teacher time schedule algorithm

Asked 2008-10-16T23:27:33.180
32

This is a problem I've had on my mind for a long time. Being the son of a teacher and a programmer, it occurred to me early on... but I still haven't found a solution for it.

So this is the problem. One needs to create a time schedule for a school, using some constraints. These are generally divided in two categories:

Sanity Checks

  • A teacher cannot teach two classes at the same time
  • A student cannot follow two lessons at the same time
  • Some teachers must have at least one day off during the week
  • All the days of the week should be covered by the time table
  • Subject X must have exactly so-and-so hours each week
  • ...

Preferences

  • Each teacher's schedule should be as compact as possible (i.e. the teacher should work all hours for the day in a row with no pauses if possible)
  • Teachers that have days off should be able to express a preference on which day
  • Teachers that work part-time should be able to express a preference whether to work in the beginning or the end of the school day.
  • ...

Now, after a few years of not finding a solution (and learning a thing or two in the meanwhile...), I realized that this smells like a NP-hard problem.

Is it proven as NP-hard?

Does anyone have an idea on how to crack this thing?

Looking at this question made me think about this problem, and whether genetic algorithms would be usable in this case. However it would be pretty hard to mutate possibilities while maintaining the sanity check rules. Also it's not clear to me how to distinguish incompatible requirements.


A small addendum to better specify the problem. This is applied to Italian school style classrooms where all students are associated in di

Edit
Report

1 Answer

2

This reminds me of this blog post about scheduling a conference, with a video explanation here.

How I would do it:

Have the population include two things:

  • Who teaches what class (I expect the teachers to teach one subject).
  • What a class takes on a specific time slot.

This way we can't have conflicts (a teacher in 2 places, or a class having two subjects at the same time).

The fitness function would include:

  • How many time slots each teacher gives per week.
  • How many time slots a teacher has on the same day (They can't have a full day of teaching, this too must be balanced).
  • How many time slots of the same subject a class has on the same day (They can't have a full day of math!).

Maybe take the standard deviation for all of them since they should be balanced.

answered 2008-12-24T07:48:45.973

Your Answer