Every school faces it each year: fit dozens of classes into a grid of time slots and rooms so that nothing clashes. A teacher can't be in two rooms at once. A student group can't take two subjects in the same slot. A lab can't host two classes simultaneously.
For a handful of classes you can juggle it by hand. But the constraints tangle: solving one clash by moving a class creates another somewhere else, which forces a third move, and soon you're chasing your own tail across the whole grid.
That's timetabling — and beneath the everyday chore sits one of the hard problems. It's a close relative of graph coloring: each class is a node, clashing classes are connected, and a "color" is a time slot. Coloring without conflicts is NP-hard, and so is the timetable.
Comments
Loading comments...