Teacher time schedule algorithm

前端 未结 8 709
灰色年华
灰色年华 2021-01-30 00:20

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.<

8条回答
  •  礼貌的吻别
    2021-01-30 00:50

    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.

提交回复
热议问题