Teacher time schedule algorithm

前端 未结 8 864
灰色年华
灰色年华 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:51

    Answering my own question:

    The FET project mentioned by gnud uses this algorithm:

    Some words about the algorithm: FET uses a heuristical algorithm, placing the activities in turn, starting with the most difficult ones. If it cannot find a solution it points you to the potential impossible activities, so you can correct errors. The algorithm swaps activities recursively if that is possible in order to make space for a new activity, or, in extreme cases, backtracks and switches order of evaluation. The important code is in src/engine/generate.cpp. Please e-mail me for details or join the mailing list. The algorithm mimics the operation of a human timetabler, I think.

    Link


    Following up the "Constraint Based Reasoning" lead by Stringent Software on Wikipedia lead me to these pages which have an interesting paragraph:

    Solving a constraint satisfaction problem on a finite domain is an NP-complete problem in general. Research has shown a number of polynomial-time subcases, mostly obtained by restricting either the allowed domains or constraints or the way constraints can be placed over the variables. Research has also established relationship of the constraint satisfaction problem with problems in other areas such as finite model theory and databases.

提交回复
热议问题